Assign any keyboard button to smoothly adjust the channel volume in Ableton

lazy circuit's icon

Hi all.


Please tell me, is it possible to somehow assign any keyboard button to smoothly adjust the channel volume in Ableton? If you use the standard mapping functionality, you can only adjust the extreme volume values (minimum and maximum) - binary

I want to assign a volume increase of 1 dB to the Q button, and a volume decrease of 1 dB to the A button on one channel. On the second channel it is similar to buttons W and S and so on.

I want to make M4L device for it. How to assign a slider change to a channel volume change in Ableton?

Maybe there is another way to achieve my goal? Help me please

presskey.maxpat
Max Patch

Source Audio's icon

You need to get ID of track volume, observe it and set it's value

using your inc dec stuff.

Source Audio's icon

No, just read LOM.

But the trouble might be that Live is stupid software, and

you might get stuck between your inc/dec stuff,

observing of current value, Live automation,

storage etc.

P.S.

There is another very clever thing in Live:

it uses float 0. ~ 1. for parameter range,

displays it in decibels -70 ~ 6, but in very unconventional exp curve.

You will have a lot to do to step in 1 db steps...

Some time ago I captured volume and send automation in 0.1 db steps to float values

here is volume list a ~ db

lazy circuit's icon

cool! Thanx!
Am I right that volume ID i can get using [live.path live_set view selected_parameter] ?

If it is very difficult to increase by 1dB, then this is not necessary. In principle, I am satisfied with how it is now being increased in the patch.

Source Audio's icon

You can get all track IDs and also names from a single m4l device,

no need to get any parameters.

You address volume using message like :

live_path live_set tracks 1 mixer_device volume $1

You even don't need track ids and names

if you have fixed track layout.

I would suggest you decide how many steps control shoud have,

then make map using my posted values.

using gain~ like in your patch makes no sense.

also you could use some modifier keys for faster stepping.

lazy circuit's icon

Thank you very much for your help. It seems I've succeeded.

Please tell me how to now connect increasing and decreasing gain with the volume of the track?

What about hotkeys in Ableton? For example, I assign the track increase to S, but this key is already occupied by Solo

And why is it that if I assign keys and then click on another part of the Ableton interface, the buttons stop working? Why does this happen?

presskey.amxd
amxd
Source Audio's icon

I am not using Live for many reasons and can't really

properly help you.

Conflict with live key shortcuts and your own ones

and focus to receive keystrokes in your device

could be solved by using hi object to capture keys,

but that works only on mac, not on windows.

Also problematic is link between automated track volume,

scaling of observed 0 - 1 value to db scale, and adjusting volume with stepper.

other option is to ignore db scale, and simply push float

up/down using for exampe 0.01 step size.

You should decide what to do, and also report if you use mac or windows.

Source Audio's icon

this is a fast mod of your patch

presskey2.amxd
amxd


lazy circuit's icon

oh, thank you very much for the example.

Suitable for me only for Mac

Source Audio's icon

There is lot of work left to do

to make anything usefull.

1- decision about track selection - fixed layout 10--16 tracks

allways audio tracks first ?

or popup menus to select tracks and keys ?

2- keys selection - fixed ones to avoid main colision with Live

key shortcuts ?

3- if you want to use hi object, you have to capture/encode

keystrokes on your hardware, it is not that easy.

lazy circuit's icon

1. I think we can limit ourselves to 10 tracks. I think that's enough. But popup menus to select tracks and keys also sounds very logical and beautiful. I would choose the way to make it easier

2. I think fixed ones to avoid ableton hotkeys. I find it very difficult to reassign a hotkey set by the developers. I don't really understand how to get around this фтв how to avoid conflicts

3. If it’s very difficult, then without hi object =)

Source Audio's icon

I will suggest to make first a simple version

as example.

10 fixed numeric keys that select track and run stepper,

shift key decides if up or down.

tracks fixed 0 - 9.

You can later modify keys or add track selection, whatever,

when you get more into LOM.

But hi object must be used to get keystrokes no matter what is currently selected in Live.

I need to know - what keyboard are you going to use ?

If it is MacBook , threre is no keypad, USB keyboard could use keypad.

So on could use right arrow and/or * instead of shift and so

run stepper with right hand only.

on macbook Trackpad, that woud be different.

lazy circuit's icon

Wow! I couldn't even imagine what I was getting myself into! But it would be interesting to try something new =))

That is, i can’t do without a hi object?

In general, I'm thinking of using a regular standard Mac keyboard

Source Audio's icon
10-Volumes.amxd.zip
zip


this is 10 tracks controll. type midi device

because I don't want to have audio pass through.

it scans all tracks in a set, looks for audio tracks and lists 10 first ordered audio tracks as targets.

If there are less, then only listed tracks get targeted, to avoid

sending automation to non existing tracks, which will produce a lots of errors.

keyboard keys 1 - 0 scroll up, if shift key is pressed, then down.

Hi object selector and polling switch can be stored in set.

Apple keys etc usually get listed 2 or 3 times,

on my USB keyboard I have to select this :

Key output could differ on your system and keyboard.

My apple keyboard has 3 & 7 for shift,

46 - 55 for keys 1 - 0

it actually outputs string of 8 numbers, $5 & $6 are relevant.

My MacBook built in keyboard numeric keys are 48 - 57, shift keys are 4 & 8.

Difference is because hi object listens to hardware key codes

and not language and keyboard layout.

do not use more than 1 instance of the device.

keys are captured even if live is not frontmost app.

I am not using Live, and simply hope that timing of observers and track detectors are ok ...

..................

To change speed of scrolling, modify metro time,

one could also increase inc/dec step size.

Currently only Audio Tracks are listed, by observing

has_audio_input property.

If you want also instrument tracks,

one would have to check track audio output property.

lazy circuit's icon

Thanks a lot for the patch! I'm trying to figure it out

I define the values 1-0 through [key], right? And then I insert them into [Routpass]?
How can I determine the shift values in order to insert them instead of [match 3 nn] and [match 7 nn] ?

And please explain what it is "polling keys" ?

Source Audio's icon

you don't use key but hi object output.

polling means to listen to and output what selected device sends .

here is patch to discover codes from your keyboard.

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

shift key outputs only 2 items, id and status,

num keys output 8 items, you need 5th item as id.

this is my key "1" pressed (blue) and released (green), id is 46

lazy circuit's icon

Hello! I have been away from my computer for a very long time and only now am I reading your answer.


I tried to run the patch. I don’t really understand if I’m doing it right? Please correct me if something is wrong.

I copied and pasted the patch into max. I pressed Menu and my Mac's keyboard was detected.

I click on the numbers 1-0, and I also click on these numbers with the Shift button pressed. But nothing happens. Nothing is displayed in the message.

Please tell me what am I doing wrong?

Source Audio's icon

there will be several keyboards listed.

you need to try all

don't forget to click on poll 50 ...

lazy circuit's icon

i choose every keyboards then pull Poll 50 then push 1-0 buttons and push 1+shift ... -0+shift buttons, but nothing is happened


Source Audio's icon

Maybe hi object is not allowed to capture keystrokes, due to your system restrictions.

First time you try to use hi object, this should popup:

then you grant access to input monitoring to max.



lazy circuit's icon

It is very strange. There is access for keyboard input in Max on a Mac.

I tested it on Key and the values are shown, as you can see in the screenshot. But Hi doesn’t want to show anything



Source Audio's icon

can you post your MacOS version and Max version ?

lazy circuit's icon

MacBook Pro Ventura 13.6.4 (22G513)
Max 8.3.3 (x64)

Source Audio's icon

Your Max 8.3.3 could bee too old.

I will test it on Sonoma and let you know if you need to update Max.

lazy circuit's icon

I updated Max to 8.5.6 and it works!

Thanks for the tip regarding the version!

Now I need to replace the Shift and 1-0 IDs in the main patch, right?


lazy circuit's icon

I registered the ids 1-0 in the routepass. Launched it in Ableton. Only increasing the volume works. If I press Shift+1, the channel volume does not go down.

Where should I account for the Shift button? In [match 3 nn] [match 7 nn]

Source Audio's icon

yes, replace 3 and 7 with your left and right shift button IDs

in case your keyboard has both and you want to use both.

lazy circuit's icon

Great! Just what I need!

Another small question - now you cannot press buttons 1 and 2 at the same time to raise the volume. Only take turns. Is it possible to make the volume go up or down when pressing several keys at the same time?

Source Audio's icon

in theory you could hold up to 5 keys and shift key to change direction.

that is USB HID Limit.

One would have to modify this patch quite a bit to allow multiple keys.

not because of multiple keys, but because of targeted tracks type detection,

observing track volumes etc.

If you really need that, I'll do it when I get some free time.

Source Audio's icon

by the way, would it make sense for you to use shift key as toggle ?

means to toggle scroll up or down instead of temporary switch.

lazy circuit's icon

I didn't think that my idea would be so complicated. Thank you for helping and discovering a lot of new and interesting things.

If you have the desire and time, I will be very grateful to you if we finish this patch.

What other options can there be instead of using the Shift button?

In general, if, for example, I want to decrease the volume of channel 1, then I press Shift + 1 and at the same time increase the volume of channel 2, then I press 2.

It won’t be very convenient - I press shift+1->release shift+1 -> press 2 -> release 2 -> press shift+1->release shift+1 -> press 2 -> release 2.

But I understand that the task is not easy and, in principle, you can get used to it this way.

I hope I explained it clearly =)

Source Audio's icon

shift can be used only general, for all held keys.

to scroll up and down with different keys at same time, you need separate keys

for both directions.

here is shift-toggle variant with up to 5 simult. keys.

10-Vols-X.amxd
amxd

P.S.

HI object captures keystrokes even if Live is not

frontmost app.

means if you write into other apps, sliders might move...

If that is a problem, check :

that can be used to activate keys only when Live is frontmost app.

lazy circuit's icon

Thanks a lot. I will try to use both patches. But it seems that what I already have suits me =)

lazy circuit's icon

Hi!
Please tell me why the speed slows down when the volume increases, when the fader approaches 0 db ?
In 10-Volumes.amxd patch

Source Audio's icon

I explained that allready, and even posted

captured scale - automation 0. ~ 1. to -70 ~ +6db.

You were not much interested, so I removed the long list ...

To explain it in few words again :

Live automation 0. ~ 1. translates into custom db scale

if you want to automate volume using db scale,

then you need to convert observed current value into db,

then scroll using db fractions, and send it again as scaled 0. ~1.

value.

11OLSEN's icon

This seems very complicated for a simple thing. What was the argument against the built-in keyboard mapping in Live?

lazy circuit's icon

SOURCE AUDIO, yes i remember a long list of values. I was able to obtain these values myself, but did not attach any importance to it, you are right.

Thanks for the explanation. I'll try to do as you wrote!

lazy circuit's icon

11OLSEN, On the built-in keyboard you can map only two values - the lowest and the highest. And I need to be able to turn the volume up and down.

11OLSEN's icon

Yes, I understood that. You don't map to the volumes directly, instead map keys to buttons of a m4l device which does the +1db -1db thing.

11OLSEN's icon

Here's something you can test. It includes equations to scale to Live db range, so it might be helpful even if you stay with the [hi] solution.

test.track_volume_buttons.amxd
amxd


lazy circuit's icon

wow! thanx a lot! I'll be happy to check it =)