0

I am trying to play MIDI Notes in iOS using AudioGraph and AudioUnit. I used kAudioUnitSubType_MIDISynth to successfully create MIDISynth Unit, loaded sound font file into the unit, and used NOTE ON (0x90|0) message to start a note.

osStatus = MusicDeviceMIDIEvent(midiSynthUnit,
                                0x90|0,
                                60, //Pitch
                                100, //Velocity
                                0);

However, I would like to pause the music player at some point. When the music player has resumed after pause, the note on time might be passed already.

The image hereunder is an example, the vertical line is where the MIDI has to be resumed in time, a note D3 has passed its start time but not yet ended: Resume Midi in time where NOTE ON has passed

How can I play the midi note from the middle its time?

Thanks

John
  • 2,672
  • 2
  • 23
  • 29
  • A synthesizer is controlled by sending it note-on and note-off messages. When you pause the player, no messages are sent during the pause. After the pause, messages continue to be sent. How do you want to change this? Do you want to send additional messages? – CL. Jul 26 '19 at 12:21
  • @CL. For the example here, I'm pausing at time=7.45s, there should be a NoteON Message (D4) on time=7.3s and last until time=7.7s, but when I pause and resume at 7.45s, the D4 Note will hit its NoteON and the whole Note will not appear – John Jul 29 '19 at 03:03
  • What do you mean with "last" and "appear"? There are only note-on and note-off messages. Please specifiy exactly when note-on and note-of should be sent. – CL. Jul 29 '19 at 06:46

0 Answers0