@dhj @LeeHarvey
Quick update. Thanks to the scripting logic and the gig file that LeeHarvey was gracious enough to send along, I now have a pretty viable solution in progress.
I have a data collection script that polls the MOTU interface, converts the raw values from the MOTU datastore to more useful values, and writes it to a text file. I have this collection on a loop so it keeps the text file up to date.
I am building out in GP the rest of the stuff needed to display the content but here is a pic of the working prototype.
If anyone is interested, here is the MOTU collection script I have going so far (will be updating so this is not final but sharing to capture progress)
#!/bin/zsh
# Set the IP address of your MOTU AVB device
DEVICE_IP="10.0.0.88"
# Output file
OUTPUT_FILE="motu_values.txt"
# Convert MOTU 0–4 scale to continuous dB
convert_to_db() {
local value="$1"
if [[ -z "$value" ]] || ! [[ "$value" =~ ^[0-9.]+$ ]]; then
echo ""
return
fi
local db
if (( $(echo "$value < 0.0" | bc -l) )); then
db="-inf"
elif (( $(echo "$value <= 1.0" | bc -l) )); then
db=$(echo "-60 + ($value * 60)" | bc -l)
elif (( $(echo "$value <= 4.0" | bc -l) )); then
db=$(echo "(($value - 1.0) / 3.0) * 12.0" | bc -l)
else
db="+inf"
fi
printf "%.1f dB" "$db"
}
# Extract "value" field from JSON
extract_value() {
echo "$1" | sed -n 's/.*"value":[[:space:]]*\([^}]*\).*/\1/p'
}
# Convert mute/solo values: 0 → Off, 1 → On
convert_on_off() {
case "$1" in
0|0.0|0.000000) echo "Off" ;;
1|1.0|1.000000) echo "On" ;;
*) echo "" ;;
esac
}
# Main loop
while true; do
echo "Channel,Fader_dB,Mute,Solo,Aux5_dB,Aux6_dB" > "$OUTPUT_FILE"
for i in {0..23}; do
CH_NUM=$((i + 1))
FADER=$(extract_value "$(curl -s "http://$DEVICE_IP/datastore/mix/chan/$i/matrix/fader")")
MUTE=$(extract_value "$(curl -s "http://$DEVICE_IP/datastore/mix/chan/$i/matrix/mute")")
SOLO=$(extract_value "$(curl -s "http://$DEVICE_IP/datastore/mix/chan/$i/matrix/solo")")
AUX5=$(extract_value "$(curl -s "http://$DEVICE_IP/datastore/mix/chan/$i/matrix/aux/4/send")")
AUX6=$(extract_value "$(curl -s "http://$DEVICE_IP/datastore/mix/chan/$i/matrix/aux/5/send")")
FADER_DB=$(convert_to_db "$FADER")
AUX5_DB=$(convert_to_db "$AUX5")
AUX6_DB=$(convert_to_db "$AUX6")
MUTE_STATUS=$(convert_on_off "$MUTE")
SOLO_STATUS=$(convert_on_off "$SOLO")
echo "$CH_NUM,$FADER_DB,$MUTE_STATUS,$SOLO_STATUS,$AUX5_DB,$AUX6_DB" >> "$OUTPUT_FILE"
done
echo "[$(date)] Data written to $OUTPUT_FILE. Sleeping 5 minutes..."
sleep 300
done```
