Skip to content

Instantly share code, notes, and snippets.

@trentgill
Created October 28, 2021 19:03
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save trentgill/e5500f1ab06ced0ba91abc89caa56912 to your computer and use it in GitHub Desktop.
Save trentgill/e5500f1ab06ced0ba91abc89caa56912 to your computer and use it in GitHub Desktop.
proposition for different syntax of launch quantization
--- when starting a timeline, there is the ability to quantize the 0 beat
-- this lauch-quantization is essentially just called `clock.sync(quant)` before beginning
-- here is a standard timeline loop with default quantization
t1{ duration, action
, duration, action
}
-- note that the above is just sugar for this (ie tl() => tl.loop() )
t1.loop{ duration, action
, duration, action
}
-- initially i intended to method chain on the end (like everything else)
-- but implementation is tough, and seems ideal because it's the 1st thing that happens
t1{ duration, action
, duration, action
}:sync(4)
-- the simplest option is to add an optional standalone sync value before the table
-- nice because it's terse & puts the quantization up front (where it happens in time)
-- cons are less clarity of meaning & it's strange to have the first arg be optional
t1(4, { duration, action
, duration, action
})
-- this approach is wordier, but clarifies intent by clearly starting with the launch quantization
-- then chaining into the loop which is the Main Event.
-- cons are more words & requires explicit loop (rather than tl{}) but maybe that's a good thing?
-- i'm leaning this way, but i'm also sure there are other options if people have ideas???
tl.launch(4)
:loop{ duration, action
, duration, action
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment