matthewscharles / instrument-maker

A framework for making digital instruments with sensors, driven by a need to improve access.
http://www.instrumentmaker.org/
GNU General Public License v3.0
18 stars 5 forks source link

im.sequence does not behave as expected #24

Closed alexmlucas closed 4 years ago

alexmlucas commented 4 years ago

Expected behaviour: On keypress, im.sequence to output a 'C' note followed by a 'D'. Actual behaviour: On keypress, no output from im.sequence.

Patch:

[im.keypress q]
|
[im.step 2]
|
[im.sequence 0 1]
|
[im.scale C major 6]
|
[im.tunedperc]
|
[im.speaker]
matthewscharles commented 4 years ago

That's interesting - not clear at first glance whether the issue lies with im.step or im.sequence, but this is a logical next step from the help file. I'll look now.

matthewscharles commented 4 years ago

Ok, so I had forgotten that im.sequence is fixed at 8 steps.

This is because it's difficult to read the number of arguments entered by the user, as they show up as 0..and we should expect the user to be able to type in something like [im.sequence 1 2 0 0 0 0 0 0] without this being truncated.

We should be able to work around this. I'm looking at some information here: https://forum.pdpatchrepo.info/topic/12221/abstractions-and-subpatches/5

Otherwise we could drop in a marker to set the bounds of the sequence. I'm loath to add an argument to define the length of the sequence as I find this confusing with other objects.

matthewscharles commented 4 years ago

This works now under Pd 0.50 .. so might have compatibility issues with Bela etc. but will default to the previous experience if so.

Worth noting that if im.step is shorter than the length of the sequence in im.sequence, the combination might not work the way that you expect it to.. (the behaviour makes sense to me as a gamelan player). Putting in a "last step" function would be a slightly different process, and will need to happen some time. Feel free to re-open if you need that sooner rather than later.

matthewscharles commented 4 years ago

just to clarify that last comment: im.step should divide the sequence up as evenly as possible. so if we have

[im.step 2] | [im.sequence 0 1 2 3 4 5 6 7]

it will play the first and middle note (0 and 4)

[im.step 3] into the same sequence will play 0, 2, and 5

etc.

alexmlucas commented 4 years ago

Great, thanks for taking the time to explain. Would it be useful to add some information on sequence length and im.step interaction to the help file?

matthewscharles commented 4 years ago

If you're up for doing that and making a pull request, great! Otherwise I can get onto it later myself.