• Open Menu Close Menu
  • Apple
  • Shopping Bag
  • Apple
  • Mac
  • iPad
  • iPhone
  • Watch
  • TV
  • Music
  • Support
  • Search apple.com
  • Shopping Bag

Lists

Open Menu Close Menu
  • Terms and Conditions
  • Lists hosted on this site
  • Email the Postmaster
  • Tips for posting to public mailing lists
Re: Understanding offline MIDI MusicDevice render
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: Understanding offline MIDI MusicDevice render


  • Subject: Re: Understanding offline MIDI MusicDevice render
  • From: Rob Nikander <email@hidden>
  • Date: Sat, 09 Mar 2013 20:06:14 -0500




On Fri, Mar 8, 2013 at 11:39 PM, Paul Davis <email@hidden> wrote:
On Fri, Mar 8, 2013 at 10:56 PM, Rob Nikander <email@hidden> wrote:
[...] 
a suitable type of AudioUnit has a functioning MIDIEvent() method that can be called just before you call Render, to deliver MIDI Data to the plugin. there are other MIDI-related methods to deliver non-channel MIDI messages.

Ah, thanks. I see the functions like `MusicDeviceMIDIEvent` in MusicDevice.h. I wrote a sample program to try to do this, but I'm doing something wrong. Strangely, if I uncomment the cout output line, it works -- the output AIFF file contains piano notes. But when it's commented out, the file is silent. Is this some kind of threading issue I don't know about? The abbreviated/pseudo code is:

    open an ExtAudioFile to write an AIFF file
    setup Generic Output and DLSSynth units, synth set to offline render
    time = 0.0
    while (time < 5.0) {
        send 'note on' to synth on half seconds
        send 'note off' to synth on full seconds
        AudioUnitRender(out, &flags, &timeStamp, numFrames, buffers)
        // cout << "weird" << endl;
        ExtAudioFileWrite(f, numFrames, buffers) );
        time += numFrames * (1.0 / sampleRate);
        timeStamp.mSampleTime += numFrames;
    }

thanks,
Rob
 _______________________________________________
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

  • Follow-Ups:
    • Re: Understanding offline MIDI MusicDevice render
      • From: Rob Nikander <email@hidden>
References: 
 >Understanding offline MIDI MusicDevice render (From: Rob Nikander <email@hidden>)
 >Re: Understanding offline MIDI MusicDevice render (From: Paul Davis <email@hidden>)

  • Prev by Date: Re: get samples from an electric guitar
  • Next by Date: Re: Understanding offline MIDI MusicDevice render
  • Previous by thread: Re: Understanding offline MIDI MusicDevice render
  • Next by thread: Re: Understanding offline MIDI MusicDevice render
  • Index(es):
    • Date
    • Thread