Dynamic Scales using Timevars?

Hi! I read about var objects, and one thing I really want to do is to have dynamically changing scales within players. So I thought I could just create a Timevar and provide it as a parameter to the player, which sounds simple enough:

p1 >> blip([0,1,2,3], scale=[Scale.minor, Scale.major]) + (0,2,4)

scales = var([Scale.minor, Scale.major])
p1 >> blip([0,1,2,3], scale=scales) + (0,2,4)

But it turns out that’s not supported yet - the player just goes silent.

I didn’t find anything in the docs about this behavior, so I want to know if there is a way to achieve this or if it needs implementation. If possible, I want to avoid setting the default scale - which also does not generate this effect.


1 Like

For this you need to use a Pvar (A Pattern TimeVar) and the default scale like so:

Scale.default=Pvar([Scale.major, Scale.minor])

Using the scale as a keyword doesn’t work with a Pvar unfortunately. You can find our more about the Pvar and other vars here.


Thanks a lot for the reply Ryan, will try that out soon!
That’s unfortunate - I rely heavily on modal interchange, and relying on the chromatic for that kind of defeats the purpose of having a scale system. If there’s any other way to emulate this behavior, please let me know.

1 Like

I’ve added this behaviour for using Pvar for scales in Players to the GitHub version and will add to the version on pip soon.

1 Like

Nice job, man!! Thank you!