Post by slmnv on Mar 18, 2019 3:28:21 GMT
Here is what I made to use for live looping as it needs drums with a bit of variability.
This is early version and I expect many fixes / improvements may be applied to that.
Patterns I put there are not the best, I made them for demonstration. If you know how to make the sound better, please chime in.
This is early version and I expect many fixes / improvements may be applied to that.
Patterns I put there are not the best, I made them for demonstration. If you know how to make the sound better, please chime in.
# Scene for random auto drums
# Input is midi clock, e.g. from looper
# Output is MIDI drumming in channel 10
# Notes are played from 16 step drum pattern
# Several modules may be merged
IF LOAD
ASS L0 = 00 # clock count
ASS L1 = 00 # drum shift
ASS L2 = 00 # pattern shift
ASS L3 = 09 # Pattern velocity 0-F
# Drum pattern has 16 steps with probability of a note 0-F
ASS L10 = 03 03 03 00 00 00 03 00 00 03 01 03 03 03 03 05
# Pattern shift 0-F is randomly selected from array
ASS L20 = 00 00 00 00 04 04 04 04 04 00 00 00 0F 08 00 00
# Drum patch 0-7F is randomly selected 0 - skip a note
ASS L30 = 2A 2A 2A 2A 2A 2E 2E 2E 2E 2E 00 00 00 00 00 00
ASS L50 = B8 07 # cc to catch for global probability factor L52
ASS L52 = 40 # affect chance a note is played
ASS L53 = 40
END
IF M0 == L50 L51
IF M2 <= 40
ASS L52 = M2
ASS L53 = 40
END
IF M2 > 40
ASS L52 = 40
MAT L53 = 7F - M2
END
END
IF M0 == F8 # MIDI clock
MAT L0 = L0 + 1 # MIDI clock counter
MAT L0 = L0 % 60
IF L0 == 0 # start of a bar
ASS L2 = R10
MAT L2 = 20 + L2
ASS L2 = LL2 # update random shift from array at L20
SET LB0 L2
END
MAT LA = L0 % 06
IF LA == 0 # 16th note
MAT LB = L0 / 06
MAT LB = LB + L2 # 16th note + pattern shift
MAT LB = LB % 10 # no more than 0F
MAT LB = 10 + LB
ASS LB = LLB # note probability from array at L10
MAT LB = LB * L52 # global factor
MAT LB = LB / 40
MAT LC = RF * L53
MAT LC = LC / 40
IF LB > LC
ASS LC = R10
MAT LC = 30 + LC
ASS LC = LLC # MIDI note from array at L30
IF LC != 0 # note not empty
MAT LD = 7F * L3
MAT LD = LD / 0F
SND 99 LC LD # channel 10 is for drums in GM
SND 89 LC 00 +D100 # note off
END
END
END
END
IF M0 >= FA # MIDI start, stop
IF M0 <= FC
ASS L0 = 0
END
END
XX = XX +B