Midi Controllers
Hey all! Long time user, first time poster, yada yada...
The problem
I'm really slow at typing out notes using my computer keyboard, so I want to use my midi controller to speed up the process of inputting notes into Picotron's tracker.
My solution
I wrote up a quick shell script to allow me to use my midi controller within Picotron's (and by extension Pico-8's) tracker. You can run it in the background, and it just looks for input from my midi controller and simulates the appropriate keypress to input the note in the tracker.
I made it following the advice from this Stack Exchange thread. It requires a unix-like shell, as well as aseqdump
and xdotool
, to work.
#!/usr/bin/env sh aseqdump -p "YOUR_MIDI_DEVICE_HERE" | \ while IFS=" ," read src ev1 ev2 ch label1 data1 label2 data2 rest; do case "$ev1 $ev2 $data1" in "Note on 48" ) xdotool type z ;; "Note on 49" ) xdotool type s ;; "Note on 50" ) xdotool type x ;; "Note on 51" ) xdotool type d ;; "Note on 52" ) xdotool type c ;; "Note on 53" ) xdotool type v ;; "Note on 54" ) xdotool type g ;; "Note on 55" ) xdotool type b ;; "Note on 56" ) xdotool type h ;; "Note on 57" ) xdotool type n ;; "Note on 58" ) xdotool type j ;; "Note on 59" ) xdotool type m ;; "Note on 60" ) xdotool type q ;; "Note on 61" ) xdotool type 2 ;; "Note on 62" ) xdotool type w ;; "Note on 63" ) xdotool type 3 ;; "Note on 64" ) xdotool type e ;; "Note on 65" ) xdotool type r ;; "Note on 66" ) xdotool type 5 ;; "Note on 67" ) xdotool type t ;; "Note on 68" ) xdotool type 6 ;; "Note on 69" ) xdotool type y ;; "Note on 70" ) xdotool type 7 ;; "Note on 71" ) xdotool type u ;; "Note on 72" ) xdotool type i ;; "Note on 73" ) xdotool type 9 ;; "Note on 74" ) xdotool type o ;; "Note on 75" ) xdotool type 0 ;; "Note on 76" ) xdotool type p ;; esac done |
Questions for the community
As far as I know, Picotron (and Pico-8) only has keyboard shortcuts to input notes from C3 to E5, so I still have to manually adjust octaves if I'm composing outside of that range. Is there anyone out there more informed than I, who knows of any way to input all the notes using a keyboard? Or better yet, is there a way to have Picotron itself listen for midi input? Because if so, then the gates would be wide open to hack on the tracker itself.


.jpg)
This is so cool! I've been wanting to make this put I never sat down and actually did it. Thank you so much for sharing! I was also postponing switching to back to linux, so now I have two good reasons :)



This is great, thanks for putting this together! I modified it a bit so that you can hold down keys in the Instrument editor:
#!/usr/bin/env sh aseqdump -p "32:0" | \ while IFS=" ," read src ev1 ev2 ch label1 data1 label2 data2 rest; do case "$ev1 $ev2 $data1" in "Note on 48" ) xdotool keydown z ;; "Note off 48" ) xdotool keyup z ;; "Note on 49" ) xdotool keydown s ;; "Note off 49" ) xdotool keyup s ;; "Note on 50" ) xdotool keydown x ;; "Note off 50" ) xdotool keyup x ;; "Note on 51" ) xdotool keydown d ;; "Note off 51" ) xdotool keyup d ;; "Note on 52" ) xdotool keydown c ;; "Note off 52" ) xdotool keyup c ;; "Note on 53" ) xdotool keydown v ;; "Note off 53" ) xdotool keyup v ;; "Note on 54" ) xdotool keydown g ;; "Note off 54" ) xdotool keyup g ;; "Note on 55" ) xdotool keydown b ;; "Note off 55" ) xdotool keyup b ;; "Note on 56" ) xdotool keydown h ;; "Note off 56" ) xdotool keyup h ;; "Note on 57" ) xdotool keydown n ;; "Note off 57" ) xdotool keyup n ;; "Note on 58" ) xdotool keydown j ;; "Note off 58" ) xdotool keyup j ;; "Note on 59" ) xdotool keydown m ;; "Note off 59" ) xdotool keyup m ;; "Note on 60" ) xdotool keydown q ;; "Note off 60" ) xdotool keyup q ;; "Note on 61" ) xdotool keydown 2 ;; "Note off 61" ) xdotool keyup 2 ;; "Note on 62" ) xdotool keydown w ;; "Note off 62" ) xdotool keyup w ;; "Note on 63" ) xdotool keydown 3 ;; "Note off 63" ) xdotool keyup 3 ;; "Note on 64" ) xdotool keydown e ;; "Note off 64" ) xdotool keyup e ;; "Note on 65" ) xdotool keydown r ;; "Note off 65" ) xdotool keyup r ;; "Note on 66" ) xdotool keydown 5 ;; "Note off 66" ) xdotool keyup 5 ;; "Note on 67" ) xdotool keydown t ;; "Note off 67" ) xdotool keyup t ;; "Note on 68" ) xdotool keydown 6 ;; "Note off 68" ) xdotool keyup 6 ;; "Note on 69" ) xdotool keydown y ;; "Note off 69" ) xdotool keyup y ;; "Note on 70" ) xdotool keydown 7 ;; "Note off 70" ) xdotool keyup 7 ;; "Note on 71" ) xdotool keydown u ;; "Note off 71" ) xdotool keyup u ;; "Note on 72" ) xdotool keydown i ;; "Note off 72" ) xdotool keyup i ;; "Note on 73" ) xdotool keydown 9 ;; "Note off 73" ) xdotool keyup 9 ;; "Note on 74" ) xdotool keydown o ;; "Note off 74" ) xdotool keyup o ;; "Note on 75" ) xdotool keydown 0 ;; "Note off 75" ) xdotool keyup 0 ;; "Note on 76" ) xdotool keydown p ;; "Note off 76" ) xdotool keyup p ;; esac done |
[Please log in to post a comment]