Skip to content

Instantly share code, notes, and snippets.

@coderofsalvation
Created August 3, 2025 20:34
Show Gist options
  • Save coderofsalvation/f4d4098a818328868bc04da074ff9f94 to your computer and use it in GitHub Desktop.
Save coderofsalvation/f4d4098a818328868bc04da074ff9f94 to your computer and use it in GitHub Desktop.
ALSA midimonitor script to facilitate qtractor & sunvox for entering MSB/LSB/PC values.
#!/bin/sh
#
# usage:
#
# [code]$ midimonitor $(aseqdump -l | awk '/MYCONTROLLER/ { print $1 }')
# 32:0 Control change 0, controller 72, value 112, CCEEXXYY = C8007000
# 32:0 Control change 4, controller 72, value 112, CCEEXXYY = C8007000
# 32:0 Control change 0, controller 0, value 120, CCEEXXYY = 80007800
# 32:0 Control change 0, controller 32, value 64, CCEEXXYY = A0004000
# --- Bank: 15424
# --- Program: 67
# --- Sunvox CCEEXXYY = 80007800
# --- A0004000
# --- 00350083
# --- 83004200
# [/code]
#
# ps. replace MYCONTROLLER with a string which matches your synthesizer/keyboard (see `aseqdump -l`)
aseqdump -p $1 | awk '
BEGIN{
MSB=0
LSB=0
}
/controller / { printf $0", CCEEXXYY = %02X00%02X00\n", $6+128, $8 }
/(System|Note)/ { print $0 }
$5 == "controller" && $6 == "0," { MSB=$8; }
$5 == "controller" && $6 == "32," {
LSB=$8
printf("--- Bank: %i\n", ( (MSB*128) + LSB) )
}
$5 == "program" {
printf("--- Program: %i\n", ($6+1) )
printf("--- Sunvox CCEEXXYY = 8000%02X00\n", MSB )
printf("--- A000%02X00\n", LSB )
printf("--- 00350083\n")
printf("--- 8300%02X00\n", $6 )
LSB=0
}
'
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment