Skip to content

Instantly share code, notes, and snippets.

@Enkerli
Last active April 9, 2016 06:46
Show Gist options
  • Save Enkerli/75de6cd3762a7e14c9a67c5922034870 to your computer and use it in GitHub Desktop.
Save Enkerli/75de6cd3762a7e14c9a67c5922034870 to your computer and use it in GitHub Desktop.
Quick Sonic Pi script using MIDI in from a WX11 wind controller to control amplitude. Based on Robin Newman’s blogpost: https://rbnrpi.wordpress.com/2016/04/01/a-completely-different-way-to-use-sonic-pi-with-a-midi-controller/
require 'drb/drb'
DRB_URI="drbunix:/var/tmp/sonic-pi-midiconnector"
@midi = DRbObject.new_with_uri(DRB_URI)
use_bpm 240
use_synth :dtri
note_node=play 60, release: 100, attack: 1
live_loop :ctl do
control note_node, amp: @midi.k2/127.0
sleep 0.19
end
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment