You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
I would like to skip using the web server part and just configure everything through GPIO, even without MIDI controllers, so it would be nice to control various parameters directly through the command line.
I don't know if there is a nicer way of doing that, but for now I used virtual MIDI port and emulated MIDI commands:
midiemu.sh - run this @ reboot with sudo crontab -e
#!/bin/bash
# Load the snd-virmidi module
sudo modprobe snd-virmidi
sudo pipedalconfig --restart
input_port=32:0
output_port=33:0
aconnect -d -i $input_port
aconnect -d -o $output_port
# Connect the virtual MIDI input to the virtual MIDI output
aconnect $input_port $output_port
selectpreset.sh
#!/bin/bash
# Check if an argument is provided
if [ $# -eq 0 ]; then
echo "Usage: $0 <decimal_input or preset_name>"
exit 1
fi
input=$1
# Check if the input is a decimal or a string
if [[ "$input" =~ ^[0-9]+$ ]]; then
# Input is a decimal
decimal_input=$input
else
# Input is a string
json_content=$(cat /var/pipedal/presets/Default+Bank.bank)
# Search for the order of the preset in the list
order=$(jq -r --arg name "$input" '.presets | map(.preset.name) | index($name)' <<< "$json_content")
# Check if a matching preset was found
if [ "$order" == "null" ]; then
echo "Preset with name '$input' not found."
exit 1
fi
echo "Found preset with name '$input'"
decimal_input=$(printf "%02X" "$((order + 0))")
fi
amidi -p hw:4,0 -S "C0 $decimal_input" && echo Selected preset number $decimal_input
Example usage:
pi@gtrpi:~ $ ./selectpreset.sh solo
Found preset with name 'solo'
Selected preset number 09
pi@gtrpi:~ $ ./selectpreset.sh 1
Selected preset number 1
reacted with thumbs up emoji reacted with thumbs down emoji reacted with laugh emoji reacted with hooray emoji reacted with confused emoji reacted with heart emoji reacted with rocket emoji reacted with eyes emoji
-
I would like to skip using the web server part and just configure everything through GPIO, even without MIDI controllers, so it would be nice to control various parameters directly through the command line.
I don't know if there is a nicer way of doing that, but for now I used virtual MIDI port and emulated MIDI commands:
midiemu.sh - run this @ reboot with sudo crontab -e
selectpreset.sh
Example usage:
Beta Was this translation helpful? Give feedback.
All reactions