• 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: Sun, 10 Mar 2013 14:53:23 -0400

I think I found the answer. It seems to work now that I call `MusicDeviceMIDIEvent' from synth audio unit's pre-render callback.

Rob

On Sat, Mar 9, 2013 at 8:06 PM, Rob Nikander <email@hidden> wrote:

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;
    }

 _______________________________________________
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

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

  • Prev by Date: Re: Understanding offline MIDI MusicDevice render
  • Next by Date: Apple's Midi multimedia controller selection
  • Previous by thread: Re: Understanding offline MIDI MusicDevice render
  • Next by thread: get samples from an electric guitar
  • Index(es):
    • Date
    • Thread