Re: MIDI Transpose?
Re: MIDI Transpose?
- Subject: Re: MIDI Transpose?
- From: William Stewart <email@hidden>
- Date: Tue, 3 Jun 2008 17:53:48 -0700
Jay
You can also transpose the notes on the fly - the overhead in
iterating through the midi sequence data copying tracks, etc, is very
lightweight. We ref count the music events, to minimise the affect of
having to copy
One approach I'd recommend if you are doing this is to copy the track
to a new track (and have that track muted), and then go and transpose
the data, then unmute the new track and mute the other one...
Also - a good way to read in the files into a sequence for this kind
of thing is to use the "parse midi channels to tracks" flag :
kMusicSequenceLoadSMF_ChannelsToTracks
from <AudioToolbox/MusicPlayer.h>
That gives you one sequence track for every MIDI channel of data in
the midi file. should be very useful for this kind of thing.
I'd encourage you to play with this stuff abit and just see how it
works out for you
Bill
On Jun 3, 2008, at 2:33 PM, Jay Koutavas wrote:
The thing we're building only does output to the built-in synth, no
external midi out is needed.
In all my previous discussions about "sending to the speakers" I
should have been saying "sending to the built in synth." With this
now understood, I see where my attention needs to go -- to learn how
to send transpose requests to the Apple DLS synth.
Thank you, I feel I have a workable course of action to pursue now.
At 2:18 PM -0700 6/3/08, Brian Willoughby wrote:
On Jun 3, 2008, at 07:29, Jay Koutavas wrote:
The preflight tweaking of the loaded file is a clever idea which
had not occurred to me. However, reloading the file each time the
transpose request occurs is cumbersome. We need to transpose
numerous times after a given load. Even while playing, ideally.
Now that you've described a need for transposition while playing,
that pretty much puts the nail in the coffin on handling transpose
while reading the file.
Manipulating the notes mathematically on the fly seemed less
daunting then pitch bending. But Peter's suggestion about tweaking
the time pitch unit makes it seem less so.
Not only less daunting, but better-sounding, and less CPU-
intensive. It's practically sacrilege to use the time pitch unit
when you are playing MIDI data. The audio quality will suffer and
the CPU usage will go up. I don't think you've begun to exhaust
the CoreMIDI options just yet.
Bill pretty much put the nail in the per-midi note transpose on-
the-fly when he stated there's not destination endpoint
representing speakers.
I disagree with your interpretation. You've not examined the
options of disconnecting your MIDI player from the sound generator.
So long as you connect your MusicPlayer directly to the selected
MIDI device, you're stuck with the untransposed pitches. You
should examine my suggestion to use a virtual end point between the
sequence and the synth.
It might help to point out that speakers are not MIDI devices.
Even if you had a destination endpoint for the speakers, how could
you transpose the MIDI data on a device that doesn't deal with MIDI
data?
I think you should describe your intended MIDI system arrangement.
Do you support external MIDI devices? If so, then time pitch will
not be able to affect the audio without additional CoreAudio
routing and substantial audio interface I/O. Do you limit your
users to only using software MIDI instruments? Is your program
restricted to only the Apple DLS Synth? If the latter is the case,
then you could create a virtual MIDI input which transposes
incoming MIDI data and then sends it to the DLS Synth. You would
then modify your current MusicPlayer to send the SMF playback data
to your virtual MIDI port instead of directly to the DLS, and thus
you would have on-the-fly transposition. The sound quality in this
arrangement will be superior to using the time pitch unit, and it
will take less CPU.
P.S. You could also consider sending a MIDI Transpose Event to the
Apple DLS Synth without altering the MIDI data. I have not tested
this fully for compliance, but the MIDI specification has very
flexible transpose features, and most General MIDI Devices are
required to implement these features.
Brian Willoughby
Sound Consulting
--
--------------------------------------------------------
Jay Koutavas mailto:email@hidden Heynow
Software http://www.heynow.com
Windham, New Hampshire, USA
--------------------------------------------------------
_______________________________________________
Do not post admin requests to the list. They will be ignored.
Coreaudio-api mailing list (email@hidden)
Help/Unsubscribe/Update your Subscription:
This email sent to email@hidden
_______________________________________________
Do not post admin requests to the list. They will be ignored.
Coreaudio-api mailing list (email@hidden)
Help/Unsubscribe/Update your Subscription:
This email sent to email@hidden