// title: How to write a Pbind in a specific key (tonality) or mode // author: Bruno Ruviaro // description: // Modes, scales, keys (tonal music) inside Pbinds. How to write a Pbind for example G minor or mixolydian #4 sing \scale and \degree. // code: // MODES, SCALES, KEYS inside Pbinds // How to write Pbinds in a specific key, for example G minor // (using \scale and \degree inside Pbind) ( Pbind( \scale, Scale.minor, // natural minor scale \degree, Pseq([0, 1, 2, 3, 4, 5, 6s, 7, 8, 9, 10, 11]), // s for sharp, b for flats as needed \root, 7, // 0 is C, 1 is C#, etc. For G minor, we put the root at 7 (seven semitones above C) \dur, 1/2 ).play ) // \degree considers 0 to be the first scale degree. // If you prefer to think of 1 as the first scale degree (like in "movable do" solfege), simply add -1 to the end of the line. // The example below is in Eb Major ( Pbind( \scale, Scale.major, \degree, Pseq([1, 2, 3, 4, 5, 6, 7, 8]) - 1, \root, 3, // Eb Major \dur, 1/2 ).play ) // F Mixolydian #4 ( Pbind( \scale, Scale.mixolydian, \degree, Pseq([1, 2, 3, 4s, 5, 6, 7, 8], 3) - 1, \root, 5, // F mixolydian with #4 \dur, 1/4 ).play ) Scale.directory;