Shortcut for Audio On/Off

bkshepard's icon

Is there a keyboard shortcut in Max for turning audio on and off, or does that need to be done in System Preferences (Mac)

Roman Thilenius's icon


u can bind anything you like to a dac~ ?

bkshepard's icon

Yeah, I'm aware of that. I'm trying to do it without having to configure anything. Similarly to the way you can switch back and forth from edit mode with Cmd-E or presentation mode with Cmd-Opt-E without having to configure anything, I'm hoping there might be an already configured shortcut for turning audio on and off. I don't see it in the docs, so it's probably not there. I just thought I'd ask in case someone knew a secret trick.

Jake Exkorn's icon

Hi BKSHEPARD,

It took some configuring, but you can use this patch that I have attached. Apparently, key mapping doesn't transfer, so just follow these steps and you will be set up:

1. Paste this patch into a new patcher.
2. Make sure the patcher is unlocked and open the subpatch (Cmd-doubleclick) that's located in the top left corner.
3. Click on "assign midi map", which is located on the bottom toolbar.
4. Click on the toggle, then right click it, enable it for mapping, and press the key command you would like. This will save the key command that you will be able to use to turn on and off the audio.
5. Click file/create template, name the template, and then use file/new from template when making new patchers.

I hope this helps!

Best,
Jake

Max Patch
Copy patch and select New From Clipboard in Max.

bkshepard's icon

Thanks for the suggestions, folks. What I'm attempting to do is configure an Elgato Stream Deck to have an Audio On/Off button. I don't want to have to configure anything inside the patch, I just want to turn audio on and off, as if I'm clicking the little "Power" icon in the lower-right corner of the patcher toolbar.

The stream deck can be programmed for all sorts of key commands and text messages. Since a single key command doesn't seem to exist, I was hoping I can send a message to dsp from the Stream Deck. I've tried various versions of sending a "; dsp start" and "; dsp stop" message, but Max doesn't seem to recognize the message coming from an external device. Is there a way to send messages to Max from an external USB controller?

Source Audio's icon

what can you send from that elgato ?
osc , midi , anything else ?
anything that max can receive and bang
"; dsp start" or "; dsp stop" messages

bkshepard's icon

Thanks, SA!

I'm still getting the Stream Deck figured out, but it seems to be primarily limited to either key commands like Cmd-N, Cmd-Opt-E, etc., or just basic text commands. For example, I can send the letter "n" (without the "") to create a new object, or send more complex strings like "m ; dsp start Tab" which will create a message, insert the text "; dsp start", and then deselect the object.
Unfortunately:
1. That only works if the patcher is unlocked
2. I can't find a way to click the message after it's created
3. I end up with a new, identical message every time I press the button on the Stream Deck

If I try to send just "; dsp start" (either with or without the ""), Max seems to interpret it one character at a time. Thus, Max ignores everything until the "s" and then creates a slider, then the "p" creates a new sub patcher and gives it the name "start" which, of course, the Max Console informs me doesn't exist.

What I'm hoping to find is a way to format a text string that Max interprets as a single message, not just a string of characters. I'll keep digging and experimenting. I should also note this is purely for my own work environment. I bought the Stream Deck for use with some other apps and it's great for them. I just thought I'd play around with it and try to adapt it for how I work in Max while I was getting the hang of the device.

Brian

LSka's icon

After fiddling with the max-keycommands.txt file (which is inside the 'C74/init' folder) I found a working hack.
First, I tried to bind the "dsp start" and "dsp stop" commands to a key command, but that didn't work.
So I cread two little abstractions called "DSP_Start" and "DSP_Stop":

DSP_Start:

Max Patch
Copy patch and select New From Clipboard in Max.

DSP_Stop:

Max Patch
Copy patch and select New From Clipboard in Max.

Then I edited the max-keycommands.txt file adding these lines:
max definecommand k patcher insertobj DSP_Start;
max definecommandinstructions patcher k "start dsp";
max definecommand v patcher insertobj DSP_Stop;
max definecommandinstructions patcher v "stop dsp";

The abstractions are self-destructing, so they start/stop the dsp and then disappear.

The shortcuts only work in edit mode, though.

Source Audio's icon

l had a look at that desk, it has very limiting functions.
why would one pay so much for that toy ?

if you want to use keys or shortcuts
Max would have to be foreground app
to react to them.

If you can live with it, use something that probably won't trigger other stuff,
like to hold command + alt + control and type arrow up.
If that desk can output to hi object in Max
(being usb, it could act as hid keyboard ???)
then you could capture keystrokes also if Max is not front most app.

or you write some script to bring max to foreground and toggle dsp status

then launch that script from the desk
on Mac a little applescript app
on pc cmd turned into exe


bkshepard's icon

As I said, I bought that "toy" for use with other applications for which it works great! I just thought I'd see if I can make it work with Max as well.