Creating an extensive list based on relationship between set numbers

Joni950's icon

Hello everyone,
I'd like to ask for some help regarding this problem I've encountered, that maybe someone of you have a quick fix for. I have a list (containing of 8 unique numbers) and I was wondering if there is an easy way to calculate the difference between those numbers and have a function for repeating that same relative values both rising and falling.

My list: 44 46 48 49 51 53 55 56
Difference between numbers: 2 2 2 1 2 2 1

I would like to create a way for Max to repeat this pattern forward (up);
56 58 60 61 etc...
and backwards (down);
44 43 41 39 etc...

My patch looks way to complicated and is full of bugs, and I haven't found an answer anywhere yet.
I want to make a sequence that is transposed diatonically by a second sequencer, in order to sketch melodies and progressions fast and easy.

Thank you so much,

MelodyMaker-MKI.maxpat
Max Patch


J

Source Audio's icon

vexpr $i1 + $i2 @scalarmode 1

use your interval list and offset root note.

-------
zl objects might get helpful to reorder lists or split them
instead of pak -> unpak -> pak etc
-----
Transposing like that might produce notes out of midi range, which can cause problems, even corrupt midi port.
I would insert clip 0 127 and thin the list


Joni950's icon

Thanks for your response,
really helpful stuff!

This technique is superb for transposing, but it's not really what I'm trying to do; I want to be able to transpose diatonically (keeping the relative values within the list, but changing the starting point of that order and generate a new list). I think what I'm after could be described as your example, but quantized to the relative values of the scale fed into [vexpr].

Any thoughts?

/J

Source Audio's icon

no, sorry, I have no idea what you mean.
can you post one source and one destination list, so that I can try to understand it.
2 2 2 1 2 2 1 are intervals of a scale or distance between list members if you prefer to
describe it that way.
Maybe I took it wrong because they sum in 12 = chromatic scale and repeated root.
and it looked as lydian scale ... 0 2 4 6 7 9 11
If you really mean diatonic transposition or melody shift ...
Then simply move each note in a list a diatonic step higher or lower.
but for that you need to set the tonality.
otherwise we are again in chromatic transposition.
if you pick any scale and key then your available notes
are given.
if what you want is to pick any note
and create a list which adds intervals you again end in a scale
set 55, add 2 2 2 1 2 2 1 = 55 57 59 61 62 64 66 67
in case that is G lydian scale than your available notes
are
1 2 4 6 7 9 11 13 14 16 18 19 21 23 25 26 28 30 31 33 35 37 38 40 42 43 45 47 49 50 52 54 55 57 59 61 62 64 66 67 69 71 73 74 76 78 79 81 83 85 86 88 90 91 93 95 97 98 100 102 103 105 107 109 110 112 114 115 117 119 121 122 124 126 127
same as D major scale

double_UG's icon

Max Patch
Copy patch and select New From Clipboard in Max.

Joni950's icon

Hey, thanks for the replies.
The source list contains of 8 unique list members and I want them to be transposed while maintaining their relation to their neighbouring list members.

Source example:
48 50 52 53 55 57 59 60 (C-major)

What I want:
...36 38 40 41 43 45 47 [48 50 52 53 55 57 59 60] 62 64 65 67 69 71 72...

That is adding an octave above and below the source list, and I've been able to do it using the tips you gave me in your previous post. But, this only works when the source list is within a span of 12 semitones with my current routing (patch attached).

What I want is to be able to give a source list spanning over 12-semitones, analyze the relative values between the list members and get a full list of available values between 0 and 127.

Still not making sense?
Thanks,
J

MelodyMaker_MKII.maxpat
Max Patch


Source Audio's icon

let's see
list is fixed at 8 notes
they can be as much apart from each other, even over 2 octaves
you want to get intervals of that 8 notes related to 1st or lowest note in the list
and build several new lists which keep same intervals from the root.
what if list is 22 44 66 88 100 111 123 ?
where do you transpose that ?
anyway, you first need intervals of 7 notes related to root one.
in your first patch list was
50 53 59 62 65 72 79 83
intervals to the root are
3 9 12 15 22 29 33

now what would be your wished transposed list up, and what down ?
Or what should even be 1st item in transposed list to build intervals ?

Source Audio's icon

this could make it if that is what you want

Max Patch
Copy patch and select New From Clipboard in Max.

you just need to extend it in both directions till
limits 0 - 127 are reached ...

Joni950's icon

Hey Source Audio,
thank you so much and sorry for my late reply.
Looks really good!

One thing though; the scale transposed down from the source list is reversed in order. It's no longer following the same key, but the order of the steps has been reversed. So, it's not really transposing down but rather mirroring the movement upwards, downwards, making a kind of symmetric scale.

Any thoughts on how to correct that?

And also, how would I keep scaling this source list up to a maximum value? So that it would give me all the possible notes from the range 0-127, for example.

Thank you,
J

Source Audio's icon

You can accumulate transposed list and transpose it again into direction till it reaches limit.
I forgot what was this all about ...
post the list of down transposed items for me to see what you exactly want.
for input
50 53 59 62 65 72 79 83
example I posted produces in down direction
17 21 28 35 38 41 47
what would you want this list to be instead ?
post your 7 numbers.

Joni950's icon

Thank you!

Source list:
44 46 48 49 51 53 55 56

Up transposed:
58 60 61 63 65 67 68 (which is what we are getting)

Down transposed, I want:
32 34 36 37 39 41 43
(vs. what we're getting now)
32 33 35 37 39 40 42

Thank you,
J

Source Audio's icon

in that case you use 1st and 8th list items as start point to add intervals from original list in opposite directions.

Max Patch
Copy patch and select New From Clipboard in Max.

Joni950's icon

Oh, this looks incredible.
I think I can figure out the last tweaks now, to make it behave exactly the way I want!

Thank you SO SO SO much, your help has been incredible! Thank you so much.

All the best,
J