help with multi-step list processing ¯\_(⊙_☉)_/¯
Hi all, I'm trying to input some musical data into a special format for use in an aleatoric piece. Basically, I need to turn one data pair that is similar to MIDI (pitch + onset time) into a bunch of data points that "fill up" the intervening space explicitly, instead of just waiting for a 0 command.
So, I might start with a few Rhythm + Pitch pairs like example 1, showing a rest on the downbeat, an F on beat 2, etc etc.

First, I want to turn the list into one that is all whole-number rhythms. So, in this case, I need it to multiply the rhythm column by 2, to make the 9.5 into an 19 (ex. 2). BUT I would like to figure out how to do this robustly, so that it could handle a list with eighth notes and triplets, for example, and still figure out the minimum multiplier needed to produce all whole numbers. This will re-label the data in terms of its smallest common note value, without having to do a bunch of cumbersome multiplication when inputting it from a score.

Second: I want to 'expand' the list so that each smallest rhythm value is in its proper (ordinal) place on the spreadsheet (i.e. in the coll object). And, besides 'fanning out' the list like this, I would like each new entry to repeat the 'pitch' value of the preceding original data point (ex. 3).

I think this can all be done in max with zl objects, but I'm really struggling to get it to work. Any help is greatly appreciated!
thanks! -bd
What do you want to do in the end with the ex.3 list? Is it data formatting for the sake of it, or is to be used with some logic later? If the second, which kind of logic? I feel like the first table could be enough actually.
Like if you want to be able to randomly pick a note in your sequence while preserving the duration of each segment, you can generate a number between the min and max value of first column (between 0 and 14), find what is the closest value below that generated number, and take the value from second column. Like a random 11.3 would give the row starting with a 10, giving note 72.
It is to be used in kind of the way you say! I would like to have a slow "background" process reading through this list at a steady pace, as dictated by the rhythm, but then an actual process for outputting pitches which samples from certain distances in the "future" or the "past", rather than just the current moment.
The process you describe ("find the closest number below the generated one, then match it with the corresponding number in the right column") would work perfectly for what I am trying to do, but I wouldn't know how to implement this. Can this be done with coll objects, or should I look into something else?
thanks!
[coll] is good for storing and querying this kind of data, but not so for editing them by hand. I was first thinking using a [coll.codebox] for direct access, but sadly you cannot have float indexes in coll. Either integers or symbol. So you would end up with something like:
8, 74;
9, 72;
"9.5", 71;
10, 72;or
5, 8 74;
6, 9 72;
7, 9.5 71;
8, 10 72;None of which is practical to edit by hand.
So I decided to use jit.cellblock instead. Easier to edit with mouse and keyboard, but less practical to extract data from it.
This should get you started:
Please in the future, provide an example patch, with what you did so far and at least your data so we don't have to rewrite them by hand, and suggest options closer to what you did already.