I really like this proposal. I may watch the video again and have some more comments.
Early thoughts:
What about temporal recursion? Or maybe you can change the period of a periodic block from within a periodic block?
To get around the time unit question, we could has msec, sec, minute, hour, etc functions that take a number and convert it to the internal time representation (seconds), or something similar. Maybe unit postfixes could be supported?
It would be nice to have an xox style method of setting non-uniform repeating patterns.
Something that would not fit into the periodic model might be an xox style sequence specification like [1,0,0,1,0,0,1,0,1,0] but where each number is a probability that an event will be emitted on that step.
Including functionality like this really begs the question for me, where do you stop? It makes it easy to do some things, but the mapper scripting language is still very limited and at some point you have to step outside of it and make a device. This relates to my concern that maps are secretely devices, or that devices should be able to serve as maps, or something...
Ideally periodic blocks should smoothly support live coding in some way. E.g. if I live edit the arpeggiator example to change the pattern or add more pitches, the local variable i should not be reset when the map updates?
Do vectors support non-integer (interpolated) lookup? If so, the proposed envelope constructor could simply return a vector (or something that acts just like one), and use square brackets for lookup.
What about envelopes with curved (exponential, logarithmic, sigmoid, ease in/out, ping-pong ball, etc) stages?
What about ridiculous breakpoint automation with dozens or hundreds of stages? Does the syntax need to support that ergonomically, or should that be assumed to be computer generated?
Maybe it would be more convenient to have env(targets, durations), where each argument is a vector? Can we have vectors of vectors?
Can we pass functions as arguments? Then we could also have a vector of curve lookup functions that take an argument from 0 to 1 and produce a curve shape...
I start to feel a little bit confused about variable scope. Is y just global? Can you declare a variable anywhere? What would its scope be? It's not always clear with curly brace syntax...
I had a bunch of other thoughts but I will start a new thread as I think they are a bit tangential.
TW