AUTO SCALER example by PHOBoS ----------------------------- played: MIDI values of played notes status: NoteOn/NoteOff status of MIDI notes notes: MIDI notes transposed to 1 octave scale: scale in ascending order created from notes ================================================================================== | ON| |OFF| 0, 1, 2, 3, 4, 5, 6, 7 ================================================================================== played[ -, -, -, -, -, -, -, -] status[ -, -, -, -, -, -, -, -] notes [ -, -, -, -, -, -, -, -] scale [ -, -, -, -, -, -, -, -] ------------------------------- | 12| played[12, -, -, -, -, -, -, -] shift played >>, add 12 status[ 1, -, -, -, -, -, -, -] shift status >>, add status value of 12 notes [ 0, -, -, -, -, -, -, -] scale [ 0, -, -, -, -, -, -, -] ------------------------------- | 76| played[76,12, -, -, -, -, -, -] shift played >>, add 76 status[ 1, 1, -, -, -, -, -, -] shift status >>, add status value of 76 notes [ 4, 0, -, -, -, -, -, -] scale [ 0, 4, -, -, -, -, -, -] ------------------------------- | 12| played[76,12, -, -, -, -, -, -] shift 12 >> to position after notes with status value 1 status[ 1, 0, -, -, -, -, -, -] change status value of 12 notes [ 4, 0, -, -, -, -, -, -] scale [ 0, 4, -, -, -, -, -, -] ------------------------------- | 76| played[76,12, -, -, -, -, -, -] shift 76 >> to position after notes with status value 1 status[ 0, 0, -, -, -, -, -, -] change status value of 76 notes [ 4, 0, -, -, -, -, -, -] scale [ 0, 4, -, -, -, -, -, -] ------------------------------- | 97| played[97,76,12, -, -, -, -, -] shift played >>, add 97 status[ 1, 0, 0, -, -, -, -, -] shift status >>, add status value of 97 notes [ 1, 4, 0, -, -, -, -, -] scale [ 0, 1, 4, -, -, -, -, -] ------------------------------- | 5| played[ 5,97,76,12, -, -, -, -] shift played >>, add 5 status[ 1, 1, 0, 0, -, -, -, -] shift status >>, add status value of 5 notes [ 5, 1, 4, 0, -, -, -, -] scale [ 0, 1, 4, 5, -, -, -, -] ------------------------------- | 44| played[44, 5,97,76,12, -, -, -] shift played >>, add 44 status[ 1, 1, 1, 0, 0, -, -, -] shift status >>, add status value of 44 notes [ 8, 5, 1, 4, 0, -, -, -] scale [ 0, 1, 4, 5, 8, -, -, -] ------------------------------- | 5| played[44,97, 5,76,12, -, -, -] shift 5 >> to position after notes with status value 1 status[ 1, 1, 0, 0, 0, -, -, -] change status value of 5 notes [ 8, 1, 5, 4, 0, -, -, -] scale [ 0, 1, 4, 5, 8, -, -, -] ------------------------------- | 45| played[45,44,97, 5,76,12, -, -] shift played >>, add 45 status[ 1, 1, 1, 0, 0, 0, -, -] shift status >>, add status value of 45 notes [ 9, 8, 1, 5, 4, 0, -, -] scale [ 0, 1, 4, 5, 8, 9, -, -] ------------------------------- | 45| played[44,97,45, 5,76,12, -, -] shift 45 >> to position after notes with status value 1 status[ 1, 1, 0, 0, 0, 0, -, -] change status value of 45 notes [ 8, 1, 9, 5, 4, 0, -, -] scale [ 0, 1, 4, 5, 8, 9, -, -] ------------------------------- | 97| played[44,97,45, 5,76,12, -, -] shift 97 >> to position after notes with status value 1 status[ 1, 0, 0, 0, 0, 0, -, -] change status value of 97 notes [ 8, 1, 9, 5, 4, 0, -, -] scale [ 0, 1, 4, 5, 8, 9, -, -] ------------------------------- | 13| played[13,44,45, 5,76,12, -, -] shift played below 97 >> (discard 97), add 13 status[ 1, 1, 0, 0, 0, 0, -, -] shift status below 97 >>, add status value of 13 notes [ 1, 8, 9, 5, 4, 0, -, -] scale [ 0, 1, 4, 5, 8, 9, -, -] ------------------------------- | 60| played[60,13,44,45, 5,76, -, -] shift played below 12 >> (discard 12), add 60 status[ 1, 1, 1, 0, 0, 0, -, -] shift status below 12 >>, add status value of 60 notes [ 0, 1, 8, 9, 5, 4, -, -] scale [ 0, 1, 4, 5, 8, 9, -, -] ------------------------------- | 44| played[60,13,44,45, 5,76, -, -] shift 44 >> to position after notes with status value 1 status[ 1, 1, 0, 0, 0, 0, -, -] change status value of 44 notes [ 0, 1, 8, 9, 5, 4, -, -] scale [ 0, 1, 4, 5, 8, 9, -, -] ------------------------------- | 9| played[ 9,60,13,44, 5,76, -, -] shift played below 45 >> (discard 45), add 9 status[ 1, 1, 1, 0, 0, 0, -, -] shift status below 45 >>, add status value of 9 notes [ 9, 0, 1, 8, 5, 4, -, -] scale [ 0, 1, 4, 5, 8, 9, -, -] ------------------------------- | 7| played[ 7, 9,60,13,44, 5,76, -] shift played >>, add 7 status[ 1, 1, 1, 1, 0, 0, 0, -] shift status >>, add status value of 7 notes [ 7, 9, 0, 1, 8, 5, 4, -] scale [ 0, 1, 4, 5, 7, 8, 9, -] ------------------------------- | 13| played[ 7, 9,60,13,44, 5,76, -] shift 13 >> to position after notes with status value 1 status[ 1, 1, 1, 0, 0, 0, 0, -] change status value of 13 notes [ 7, 9, 0, 1, 8, 5, 4, -] scale [ 0, 1, 4, 5, 7, 8, 9, -] ------------------------------- | 12| played[12, 7, 9,60,13,44, 5,76] shift played >>, add 12 status[ 1, 1, 1, 1, 0, 0, 0, 0] shift status >>, add status value of 12 notes [ 0, 7, 9, 0, 1, 8, 5, 4] ignore note value of 60 for scale (same as 12) scale [ 0, 1, 4, 5, 7, 8, 9, -] ------------------------------- | 72| played[72,12, 7, 9,60,13,44, 5,76] shift played >>, add 72 status[ 1, 1, 1, 1, 1, 0, 0, 0, 0] shift status >>, add status value of 72 notes [ 0, 0, 7, 9, 0, 1, 8, 5, 4] ignore note values of 60 and 12 for scale (same as 72) scale [ 0, 1, 4, 5, 7, 8, 9, -] ------------------------------- | 85| played[85,72,12, 7, 9,60,44, 5,76] shift played below 13 >> (discard 13), add 85 status[ 1, 1, 1, 1, 1, 1, 0, 0, 0] shift status below 13 >>, add status value of 85 notes [ 1, 0, 0, 7, 9, 0, 8, 5, 4] scale [ 0, 1, 4, 5, 7, 8, 9, -] ------------------------------- | 60| played[85,72,12, 7, 9,44, 5,76] shift played above 60 << (discard 60) status[ 1, 1, 1, 1, 1, 0, 0, 0] shift status above 60 << notes [ 1, 0, 0, 7, 9, 8, 5, 4] ignore note value of 12 for scale (same as 72) scale [ 0, 1, 4, 5, 7, 8, 9, -] ------------------------------- | 77| played[77,85,72,12, 7, 9,44,76] shift played above 5 << (discard 5), shift played >>, add 77 status[ 1, 1, 1, 1, 1, 1, 0, 0] shift status above 5 << notes [ 5, 1, 0, 0, 7, 9, 8, 4] ignore note value of 12 for scale (same as 72) scale [ 0, 1, 4, 5, 7, 8, 9, -] ------------------------------- | 72| played[77,85,12, 7, 9,44,76, -] shift played above 72 << (discard 72) status[ 1, 1, 1, 1, 1, 0, 0, -] shift status above 72 << notes [ 5, 1, 0, 7, 9, 8, 4, -] scale [ 0, 1, 4, 5, 7, 8, 9, -] ------------------------------- | 7| played[77,85,12, 9, 7,44,76, -] shift 7 >> to position after notes with status value 1 status[ 1, 1, 1, 1, 0, 0, 0, -] change status value of 7 notes [ 5, 1, 0, 9, 7, 8, 4, -] scale [ 0, 1, 4, 5, 7, 8, 9, -] ------------------------------- | 12| played[77,85, 9,12, 7,44,76, -] shift 12 >> to position after notes with status value 1 status[ 1, 1, 1, 0, 0, 0, 0, -] change status value of 12 notes [ 5, 1, 9, 0, 7, 8, 4, -] scale [ 0, 1, 4, 5, 7, 8, 9, -] ------------------------------- | 9| played[77,85, 9,12, 7,44,76, -] shift 9 >> to position after notes with status value 1 status[ 1, 1, 0, 0, 0, 0, 0, -] change status value of 9 notes [ 5, 1, 9, 0, 7, 8, 4, -] scale [ 0, 1, 4, 5, 7, 8, 9, -] ------------------------------- | 77| played[85,77, 9,12, 7,44,76, -] shift 77 >> to position after notes with status value 1 status[ 1, 0, 0, 0, 0, 0, 0, -] change status value of 77 notes [ 1, 5, 9, 0, 7, 8, 4, -] scale [ 0, 1, 4, 5, 7, 8, 9, -] ------------------------------- | 85| played[85,77, 9,12, 7,44,76, -] shift 85 >> to position after notes with status value 1 status[ 0, 0, 0, 0, 0, 0, 0, 0] change status value of 85 notes [ 1, 5, 9, 0, 7, 8, 4, -] scale [ 0, 1, 4, 5, 7, 8, 9, -] -------------------------------