tmhglnd / mercury

A minimal and human-readable language and environment for the live coding of algorithmic electronic music.
http://www.timohoogland.com/mercury-livecoding
GNU General Public License v3.0
291 stars 13 forks source link

ring spread() methods only output low to high #58

Closed GuillemGongora closed 3 years ago

GuillemGongora commented 3 years ago

In the ring spread() family, the output is always ordered from low to high, independently from the order of the arguments. spreadInclusive(4 1 4) outputs the same as spreadInclusive(4 4 1). This could save a line for an unnecessary ring invert().

tmhglnd commented 3 years ago

Yeah, have to redesign this indeed. It originated from the fact that you can also say spread(10 5), which will then use 5 als the "lower" bound and set a 0 as the higher bound (because there is no argument there). But then I swap the arguments to make sure the lower = 0 and higher = 5. Only this means that the arguments also get swapped when the arguments are both added.

tmhglnd commented 3 years ago

Now included in e105a4eebdaa2f6f39342545822dc7ef44bf5c85