Real time changes to MIDI data
Real time changes to MIDI data
- Subject: Real time changes to MIDI data
- From: David Hicks <email@hidden>
- Date: Thu, 13 Oct 2011 18:15:48 -0400
Sorry for the basic nature of my query.
I currently have an app that does non-real time algorithmic transformation of standard MIDI Files. Transposition, pitch-class mapping, rhythmic rotation and reversal, etc.
Now I want the user to be able to manipulate UI controls to affect the playback of the SMF in real time.
My current playback uses an AUGraph with DLS Synth, MusicSequence with MusicTracks, and MusicPlayer. I have a Callback attached to the DLS Synth, by which I keep track of time via the inTimeStamp with its mHostTime and mSampleTime fields. Currently I just use these timing data to update a measure and beat counter.
I need to be able to alter the MIDI note events of my SMF on the fly and 'just in time', so that the user's changes will be accurately reflected in what I send to DLS, and to a saved new SMF.
I thought I might be able to use the MIDIPacketList and MIDISend functions with their use of hostTimes with this AUGraph setup, but it appears these functions work only with MIDIEndpoints, i.e. hardware or other running apps. Am I correct on this point, no can do?
If it is indeed possible to use MIDISend with an AUGraph, does this mean that an AUGraph node (MusicDevice) can be treated as a MIDIEndpoint? I see nothing in sample code or headers that indicates this is possible, but I thought I should ask.
If MIDISend is not a possibility, am I correct that the best way to do real time adjustments to my SMF is to use MIDINoteMessages and MusicTrackNewMIDINoteEvent, keeping track of the timing of the note events by converting my Synth Callback's timestamps to MusicTimeStamps (Float64) which, as I understand them, are in terms of beats?
(The use of the Callback seemed a good way to go because theoretically I can fetch a frame's worth of note events 1 frame ahead of when they are needed by CoreAudio for DLS, which would allow me to map accurately user UI changes.)
Thanks for any help and corrections,
David
_______________________________________________
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