• 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: Audio Unit synth how-to
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: Audio Unit synth how-to


  • Subject: Re: Audio Unit synth how-to
  • From: Chris Rogers <email@hidden>
  • Date: Fri, 6 May 2005 16:16:26 -0700

Sure, you'll always have to deal with the latency issue. But most
AudioUnit host applications allow you to set the hardware buffer size quite
small. 128 sample-frames delivers pretty good real-time response
for live keyboard playing in my experience. For some devices you
may be able to set it even lower....


Chris Rogers
Core Audio
Apple Computer




Thanks. What about latency?

Suppose I have a 1024-sample buffer that I am rendering, and a note on
event happens when I am at sample 512. Do I have to wait until the end
of rendering 1024 samples before I am sent the note-on event?

(I have noticed the 1024 sample buffer size when using Logic Express as
a host).


Many thanks,
Hamish

--- Chris Rogers <email@hidden> wrote:

Have a look at the inStartFrame argument to the HandleNoteOn()
method.
This gives a sample-frame offset where the note should start during
the
current render buffer.  It is normal and correct that you should see
HandleNoteOn() and Render() being called in the same thread.
At the start of every render cycle, notes and parameter changes are
scheduled,
then your Render() method is called to synthesize the results for
that time slice....

Chris Rogers
Core Audio
Apple Computer



On May 6, 2005, at 3:18 PM, h wrote:


I am writing an Audio Unit synth based on the MusicDeviceBase class

in

the CoreAudio examples.

What I am finding is that HandleNoteOn() and Render() are being

called

on the same thread (checked using pthread_self()). Obviously, this
causes note on/off events to be made only between calls to

Render().

This allows accuracy of only +/- 1024 or 512 samples, depending on

the

number of frames requested.

How do I make the calls to HandleNoteOn/HandleNoteOff come in on

the

appropriate thread, and how do I make sure that the notes are

turned

on/off in a sample-accurate matter (presumably I need to check

before

processing each sample in Render())? Is it something to do with the
inStartFrame parameter to HandleNoteOn/Off?

Is there an example of a sample-accurate midi synth audio unit?

Thanks,
Hamish



__________________________________
Do you Yahoo!?
Make Yahoo! your home page
http://www.yahoo.com/r/hs
 _______________________________________________
Do not post admin requests to the list. They will be ignored.
Coreaudio-api mailing list      (email@hidden)
Help/Unsubscribe/Update your Subscription:
40apple.com

This email sent to email@hidden








Yahoo! Mail Stay connected, organized, and protected. Take the tour: http://tour.mail.yahoo.com/mailtour.html

_______________________________________________
Do not post admin requests to the list. They will be ignored.
Coreaudio-api mailing list (email@hidden)
Help/Unsubscribe/Update your Subscription:
40apple.com


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
References: 
 >Re: Audio Unit synth how-to (From: h <email@hidden>)

  • Prev by Date: Re: Audio Unit synth how-to
  • Next by Date: Re: MusicPlayer and MusicSequence channelizing
  • Previous by thread: Re: Audio Unit synth how-to
  • Next by thread: Re: Audio Unit synth how-to
  • Index(es):
    • Date
    • Thread