Skip to content

Instantly share code, notes, and snippets.

View eduardfrigola's full-sized avatar

Eduard Frigola eduardfrigola

View GitHub Profile
@eduardfrigola
eduardfrigola / aconnectByName.sh
Created March 6, 2019 20:52
This bash script is intended to connect to usb-midi devices. I need this to connect my akai EWI to my Novation PEAK. So that would be bash aconnectByName.sh "EWI-USB" "Peak". If devices found automatically connects to the first port of the midi device (easy to add port choosing)
#!/bin/bash
inPort=-1
outPort=-1
output=$(aconnect -l)
i=0
while read -r line; do
#process"$line"
if [[ $line == *$1* && $line == *"client"* ]]; then
arrLin=($line)
inPort=${arrLin[1]}