Post by ki on Dec 3, 2018 14:43:52 GMT
This script distributes the note output of the Rozeta XoX or Rozeta Rythm drum sequencers so that each of the drum hits is send on a separate channel - thereby allowing to change the output note number per channel and use different notes for the accented hits.
If one for instance wants to use SynthDrum Kick AU for the kick drum and Ruismaker for the other drums, configure your host in a way that both read their midi from this StreamByter script and limit SDK to channel one and RM to read from channels 2 to 8.
See corresponding audiobus forum thread for Audiobus and AUM exsample session presets.
# Split Rozeta XOX/Rythm to separate midi channels.
#
# Version: 2 / 03.12.2018
# Author: -ki https://forum.audiob.us/profile/_ki
#
# Use Ruismaker template in XOX/Rythm settings.
#
# Incomming Rozeta XOX or Rozeta Rythm notes are split
# onto separate midi channels. Depending on the input
# velocity either the defaultNote or accentNote specified
# for that channel is send. The notes are set in the
# translation table ‚L’ below.
# The velocity split is set by accentMinLevel
#
# To handle the ‚note off‘, the note send on ‚note on’
# is stored in a table in ‚K‘
#
#
# The labels display the incomming notes in hex and
# the resulting output channel. For unknown notes
# (the ones not in the xoxNote[] array) „UNK“ is
# output to label 1 instead of a channel.
# =================================
ASS L40 = 64 # var accentMinLevel // vel >= 100 dec
ASS L00 = 31 33 36 38 3A 3D 3F 42 # var note[00-0F] // xoxNotes in hex
# 49 51 54 56 58 61 63 66 // Decimal
# BD SD CP LT MT HT CH OH // Sound
# 1 2 3 4 5 6 7 8 // Output channel
# =================================
# Translation table
ASS L10 = 30 30 30 30 30 30 30 30 # var note[10-1F] // Default note per channel
ASS L20 = 3C 3C 3C 3C 3C 3C 3C 3C # var note[20-2F] // Accent note per channel
# =================================
# Examples for transtation tables
#
# Send 30=‚C2‘ as default and 3C=‚C3’ for accents in all channels
# ASS L10 = 30 30 30 30 30 30 30 30
# ASS L20 = 3C 3C 3C 3C 3C 3C 3C 3C
#
# Transparent setting, always send the original notes
# ASS L10 = 31 33 36 38 3A 3D 3F 42
# ASS L20 = 31 33 36 38 3A 3D 3F 42
#
# Custom: variable accent note for BD, SD and CP. The 3 toms use raising notes
# ASS L10 = 30 30 30 3C 43 47 30 30
# ASS L20 = 34 3C 36 3C 43 47 30 30
#
# =================================
# —————— Do not modify below this line ————————————————
#
# Version history
# v2 / 03.11.2018 Removed unused variables, indentation
# v1 / 14.09.2018 Inital version
ASS K00 = 0 0 0 0 0 0 0 0 # var noteSend[] // Stores note send to channel
ASS I0 = 0 # var i = 0
ASS I1 = 0 # var endFlag = 0
IF I1 == 0 +L # while( endFlag == 0) {
IF M1 == LI0 # if (inputNote == note[i] { // xoxNote
# //—— NoteOn
IF MT == 90 # if (inputCmd == $90) {
MAT I2 = 90 + I0 # var midiCmd = $90 + i
MAT I4 = I0 + 10 # var offset = i + 10 // offset to default note
IF M2 >= L40 # if (inputVelocity >= accentMinLevel) {
MAT I4 = I0 + 20 # offset = i + 20 // offset to accent note
END # }
SND I2 LI4 M2 # send( midiCmd, note[offset], inputVelocity)
ASS KI0 = LI4 # noteSend[i] = note
ASS I1 = 1 # endFlag = 1
# // Show note and channel on labels
MAT I3 = I0 + 1 # var outChannel = i + 1
SET LB0 M1 # show(Label0, inputNote)
SET LB1 I3 # show(Label1, outChannel)
END # }
# //—- NoteOff
IF MT == 80 # if (inputCmd == $80) {
MAT I2 = 80 + I0 # var midiCmd = $80 + i
SND I2 KI0 M2 # send( midiCmd, noteSend[i], inputVelocity)
ASS I1 = 1 # endFlag = 1
END # }
END # }
# //—- Loop managment
IF I1 == 0 # if (endFlag == 0) {
MAT I0 = I0 + 1 # i++
IF I0 >= 8 # if (i >= 8) {
ASS I1 = 2 # endFlag = 2
END # }
END # }
END # }
IF I1 == 2 # if (endFlag == 2) {
SET LB0 M1 # show(Label0, inputNote)
SET LB1 SUNK # show(Label0, „UNK“)
END # }
# // Block incomming NoteOn/NoteOff
8X = XX +B
9X = XX +B