Two things here - 1. Transposing Intervals. 2. Inverting intervals.
Hi.
I am attempting to build a patch that is a Matrix (like the one Schoenberg invented), but only 'showing' one line of the matrix at time (P, R, I, or RI) in any transposition. The initial row is randomly generated. This doesn't play anything ar make any sound, it just displays the row (using Mira) on my iPad so I can read it, play and record (and do other various things) with a second patch that I am interfacing with my instrument.
Here is what I have so far: P and R, and subsets:
I have managed tho create a 12 tone row where I can randomize the notes with one touch. I can make it retrograde using ZL rev, and using ZL slice I can make subsets. For this I am using note letter names. But it might be better for the next step to use numbers and after the math, convert the numbers to letters, or attach/assign the letters to the numbers.
What I need to finish:
1. Trying to figure out how to transpose numbers (or pitches). For example, I can label the pitches 0 - 11 like in 12 tone music - 0 = C. If I transpose the whole thing up to D, I can +2 the original 0-11 and this will give me 2-13. But I need the numbers (notes) that go above 11 to wrap around. For example, in this scenario B (11) transposes up to C# (1) which means 11 goes to 1, not 13. I will need for this to work for all 12 pitches (or numbers) at once even if the numbers are unordered instead of sequential.
Any takers?
2. Much more difficult! I want to be able to invert the intervals. If I have for example a simple C, D, E, or 0 2 4 - how do I get that to out put the inversion, C Bb, Ab, or 0 10, 8? Or, more complex, C C# A (0, 1 9) inverts to C B Eb (0 11 3). Keeping in mind that I will be using all 12 notes, randomly ordered, and needing them to wrap around for transposition like no 1 above.
Any takers?!
Also, the patch that I posted is just my layman attempt at this. The whole thing can be trashed and rewritten using more refined solutions!
Thanks
Wil
1- use modulo % 12 to solve first issue.
2- inversing intervals or chords - subtract all list members from the first one (0)

vexpr (12 - $i1)% 12 @scalarmode 1
transpose list same way ...

vexpr ($i1+$i2)% 12 @scalarmode 1
Thanks @SOURCE AUDIO. This fantastic!
Hi @SOURCE AUDIO.
That code you sent went a long way in 3 days (or maybe 2, since I'm about 14 hours ahead)!
Anyway, here's what I made. Didn't need the inversion in the end cause I found the jit.cellblock and when I used your transposition code, it was just a matter of populating umenus to organize the vertical position of each row. (I think I did use inversion though to populate the umenus for P and R and out put their info).
I am wondering something else now. As you can see I used jit.cellblock to display the results that I was aiming for - section 2 "sets". This was the goal of this short endeavor. NOT the matrix, but to able to display iterations of matrix in a quick readable fashion for performance purposes.
However, jit.cellblock will not work with Mira. And I want to sent the "sets" over to my iPad so I can put it on a music stand and read and "doodle"! This is ultimately a music score.
So I am wondering "longwindedly" what the next best closely related object is to jit.cellblock that will work with Mira. I didn't like using 'comment' - the spacing bothered be. Same with umenu, the spacing feels off. I guess I could make individual umenus and spend time sizing them and aligning them perfectly, but I'm wondering if there is something less tedious.
Thanks
Wil
I am not using mira, so can't be of any help with that...