[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: [sc-users] How to use timingOffset from the Quant class ? Can i tweak it while running a Task ?



On Dec 30, 2013 3:22 AM, "henrique matias" <hems.inlet@xxxxxxxxx> wrote:
>
> Having a look now on the link you sent.
>
> What i basically would like to do, is to have a Task syncronised to my TempoClock but playing 47ms ahead.
>
> In this case i'm using Event on the Task, to fire midi messages. 
>
> Will \lag on the event work with negative delay?

If you want the midi message to go out at, say, 3.953 beats (so that it will sound at 4.0 beats with the 47 ms delay), then the task needs to wake up before 3.953.

If "synchronized with the clock" means that the task wakes up at 4.0 beats, to sound at 4 beats, that's not possible. You can't send a midi message earlier than now.

I think you'd have to convert the ms delay into beats and use it as a negative phase in Quant, e.g.,

task.play(clock: c, quant: [-1, -0.047 * c.tempo])

The conversion is unavoidable, I think. Scheduling is always in beats.

hjh