Volca Beats velocity control with MidiPipe

Audio, MIDI and other software, not including effects or instruments
Post Reply
Posts: 1
Joined: 24 Aug 2017, 03:12

Volca Beats velocity control with MidiPipe

Post by J0J0 » 24 Aug 2017, 08:15

I wanted to share what I came up with to realize velocity control for my Volca Beats. I decided to not post into the already very tangled "MidiPipe FAQ" topic.

The foundation for my code was provided by a post from wiffbi over at the Ableton forum: https://forum.ableton.com/viewtopic.php ... 0#p1726110
Thanks again!

The MidiPipe file is attached to this post.

Code: Select all

on runme(message)
	#set message to {144, 36, 100}
	set note_list to {36, 38, 43, 50, 42, 46, 39, 75, 67, 49}
	set CC_list to {40, 41, 42, 43, 44, 45, 46, 47, 48, 49}
	set cnt to 1
	repeat with drum in note_list
		if (item 2 of message) is (drum as integer) then
			# returns 0 for channel 1, 1 for channel 2, etc.
			set channel to ((item 1 of message) mod 16)
			# 176 is CC on channel 1	
			set first_byte to (channel + 176)
			set CC_no to (item cnt of CC_list)
			set CC_val to (item 3 of message)
			#display dialog "channel:" & channel + 1 & " " & ¬
			"CC_no:" & " " & CC_no & " " & "CC_val:" & CC_val
			set (item 1 of message) to first_byte
			set (item 2 of message) to CC_no
			set (item 3 of message) to CC_val
		end if
		set cnt to (cnt + 1)
	end repeat
	return message
end runme
I know I could have spared some variables but wanted to make it more readable when realizing the debug "display dialog".
You can comment out the lines "on runme(message)" and "end runme", and comment in the "set message to {144, 36, 100}" line to try it out and debug in apples "Script Editor"

"Pass Through" has to be enabled for the "AppleScript Trigger" tool.

It seems to work correctly but one thing that concerns me is that the Note On commands are always slightly ahead of the CC commands when watching with a midi monitor (or Alist tool in midipipe). This is not a surprise and actually what I expected but theoretically it would be better to first set the volume per CC command and THEN hit the drum, right?

I'd appreciate any ideas on how I could realize this!

One idea would be to deactivate "pass through" and have the AppleScript return two midi messages, first the CC then the Note. Is this possible?


Post Reply