f6f6 wrote:I'm using Pianoteq on a MacBook Air. I can sleep/wake the Mac and power on/off the MIDI device and everything works fine. However, I need to manually wake up the Mac by pressing a key on the Mac keyboard.
I'd like to be able to sit down, power on the MIDI keyboard, and play - without touching the computer. In a sense, I'd like the Mac to function like an appliance. Pianoteq is always running, but something needs to wake the machine up (like whenever a MIDI device is connected or a MIDI message arrives). If this worked, the Mac could even be headless.
Has anyone found a way to accomplish this, like a "Wake on MIDI" utility? Googling for that as a phrase didn't turn up anything. Thanks!
Uhm, are you aware you can't sleep when PianoTeq is running? All it does is to sleep the displays.
Cause PianoTeq is preventing sleep.
Run "pmset -g" to look it up.
To make things more complicated, you need to kill several services to truly sleep. Doublecheck with a Kill-A-Watt.
It's like 50 watt sleep vs 9 Watt after the command.
You may have to enter sleep manually. I did it like this.
killall "Amphetamine";killall "Audio Hijack"; killall "Calendar"; killall "Electron"; killall "Finder";killall "KeePassXC";killall "Mumble"; killall "Pianoteq 7";killall "Preview";killall "QuickTime Player";killall "Typora"; killall "Vivaldi";killall "java"; killall "prl_client_app";killall "thunderbird";pmset sleepnow
Other than that, you would have to map one of your MIDI piano keys as keyboard command with a third party tool.
But it may be possible that this very tool also PREVENTS the sleep, double check with "pmset -g"
Now that you know all of that, you may wonder if you can STOP PianoTeq when your Piano is not in use and START PianoTeq when your Piano has been activated.
You can do like this:
#!/bin/sh
if system_profiler SPUSBDataType | grep -c -i "Roland Digital Piano" | grep -q "1"; then
if ps aux | grep -v grep | grep -c -i Pianoteq | grep -q "0"; then
open "/Applications/Pianoteq 7/Pianoteq 7.app";
fi
else
if ps aux | grep -v grep | grep -c -i Pianoteq | grep -q "1"; then
killall "Pianoteq 7" &>/dev/null;
fi
fi
For translating midi keys to keys, you can use https://www.pgmusic.com/forums/ubbthrea...ber=430438 but ONLY if you are not using an M1 chip.