Hello everyone, I just started using FoxDot and I’m having problems understanding how it works when you use a simple player.
So, my question is: how do i get a player to always start playing my sequence of notes/durations from its beginning?
For example, I have 3 simple fragments -each one with a different total duration- and whenever I call p1 it appears to start each fragment “de-synchronized”.
f1n = [0,4,7,4]
f1d = [1,1,1,1] # total duration 4
f2n = [4,5,6,6]
f2d = [0.5,0.5,1,1] # total duration 3
f3n = [11,12]
f3d = [4,1] # total duration 5
p1 >> pluck(f1n,dur=f1d)
p1 >> pluck(f2n,dur=f2d)
p1 >> pluck(f3n,dur=f3d)
I would like echa pattern to start always -whenever called- with its first note and duration, not midway as it does. Is there a way? Thanks!
Hmm, there isn’t an elegant solution that currently exists but there is plan for it to be part of FoxDot at some point soon (should be quite simple). All FoxDot players “start” from the time 0 (when the program opens) but you want to have them start when the line of code is evaluated. This behaviour does exist for
var objects but not for Players yet. As a very clumsy workaround, you could use
var objects like so:
p1 >> pluck(var(f2n,dur=f2d,start=now), dur=var(f2d,f2d,start=now))
So values for pitch and duration are measured in terms of time relative to “now” (when the code is evaluated) but have to be stored in TimeVars. This will be changed to the following at some point soon:
p1 >> pluck(f2n, f2d, start=now)
Which is a lot cleaner
Thanks, I will definitely start working with this temporal solution you indicate - looking forward to trying this second more intuitive way you point out. It looks neat!