major scale randomisation

crispypancakes's icon

anyone know how would i get the random object to generate a value between 1-12 based on the major (TTSTTTS)scale. The notes i need are 1,3,5,6,8,10,12.

any help would be appreciated.

Christopher Dobrian's icon
Max Patch
Copy patch and select New From Clipboard in Max.

Since the pattern of T and S in a major scale is not easily obtained by a mathematical formula, it's best just to store it in a table. Here's an example using the numbering system 0,2,4,5,7,9,11. Just add 1 to that to get your numbering system. The example also includes a formula to generate a stack of fifths in Lydian mode, which you can convert into an out-of-order C major scale, but the table lookup method is more efficient and straightforward. Add some whole-number multiple of 12 to transpose these pitches to different octaves, and add some number of semitones to transpose to a different key.

Luke Hall's icon

I'm not at a computer with max on but from memory something like [random 7] to [zl lookup 0 2 4 5 7 9 11] should get you started

seejayjames's icon

fun :)

you want [random] to make random index numbers, which look up the scale degrees you want, rather than try and generate the numbers themselves. Then you can load a [umenu] or other list-based data structure (table, multislider, etc.) with as many scales as you want:

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

(edit: zl lookup eliminated a half-dozen objects in my original patch...doh :)

Chris Muir's icon

I have a "jump into the deep end of the pool" note / scale quantizer called ScaleMaster, which can be found here: http://www.xfade.com/max/ScaleMaster/

Also Christopher, in your patcher, the table wasn't set to save data with patcher.

crispypancakes's icon

amazing thanks. i'll try this when i get home.

Christopher Dobrian's icon
Max Patch
Copy patch and select New From Clipboard in Max.

@Chris Muir: Thanks. Felt sure I had done that, but maybe I hadn't yet saved the patcher. Here's a revised version:

Yiannis Ioannides's icon

Or simpler, with [zl scramble]. It automatically scrambles everything from a list, and you code less.