Re: Sequencer project
Re: Sequencer project
- Subject: Re: Sequencer project
- From: Aran Mulholland <email@hidden>
- Date: Tue, 17 Aug 2010 21:39:32 +1000
I have written a step sequencer and I found it better to base my timing on the timestamp passed to the render thread. Also the way you have NSTimer instantiated will tie it to the ui thread and if you have interaction on the ui thread it might not get called just when you want it to. Core Audio has its own render thread, so i like to use the information from there to know where i am in time.
The timestamp passed to the render thread is guaranteed to be as accurate as your output device. So I would have to disagree with your summary as being the best approach. If you want sample accurate timing in your sequencer, use the sample timestamp.
cheers
aran
On Tue, Aug 17, 2010 at 6:01 PM, Patrick Muringer
<email@hidden> wrote:
Hi,
If I try to summarize what I've red until now on this list it may be useful for everyone having the wish to create a step seq:
For a one track seq,
1. Use a NSTimer that triggers each bufSize (init in Main thread)
2. Use AudioUnit to play samples or to use a SW synth (init in Main thread, use it in "timed thread")
3. Fill with 0 an inBuf when nothing has to be played (in "timed thread")
4. Check if time > 60 / (tickPerBeat * bpm) (in "timed thread")
4.a if no, fill with 0 or with what was previously
4.b if yes, get the "Sample" samples and fill inBuf
5. Check in we arrived at Nbeat and loop (set time to 0) if yes. (in "timed thread")
Does it sound correct?
Could it make sense for anyone to create a quick tutorial/project for such a simple example, maybe as an extension of the wonderfull one made by timbolstad?
Thanks for your help.
Patrick
_______________________________________________
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
_______________________________________________
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