Adjust the volume in ¼ increments

Since I sat with a keyboard with numerical pad, then it is plus and minus there.
Try to adjust the triggers to other + and - if you do not have the numerical keypad.

Just remember if you change the + and - in the triggers you need to change the corresponding Switch action.

Yes, my keyboard have a numerical keypad. So i don´t understand why the macro that you gave me doesn´t work with me…

If the macro is doing nothing, try the new Assistance window, click on the “Something expected is not happening” link.

I do not know if this is obvious, but when importing a macro in Keyboard Maestro 8, then the macro is disabled.
Is that the case for you?

Eureka!

I have moved the file from KM Forum folder to Global Macro Group and it worked!

Thanks JimmyHarington and peternlewis.

Sorry guys again. Suddenly it worked for a while, but in this moment it doesn´t. The only thing that works with this macro is the Play sound “Hero” but the increase/decrease volume doesn´t.

Thanks again.

The KM Forum Macro Group is disabled.

Use the Assistance window (Help ➤ Assistance, Something expected is not happening) to verify the macro is running (the beep could come from somewhere else for example). Then adjust the Execute AppleScript action to display the results in a window so you can see if there are any errors. Add the line "newVolume" by itself to the bottom of the script so that if there are no errors it will show you the resulting volume.

I have followed every step you told me and i can make it works only when i press the "try" button, but not when i press the hotkeys.

Try a different hot key. Try resetting the hot key. It appears to be Command-Option-Numberpad-+, I presume you have a number pad on your keyboard?

Yesterday the "try" button triggered the action and the sound volume changed, but t

oday what i have is the same volume number when i press the "try" button. I think this is the main problem independently of the hotkey that i assign.

Yep, looks like something is broken somewhere in AppleScript or the system.

It tops out at 66. And it wont go down either - or more accurately, if you adjust the volume manually, it will go down once and then stick there.

Beats me.

Thanks for your help.

Just a shot in the dark…

Since the default shortcut (shift + option + up/down volume) does work with a mac keyboard and not a windows keyboard I’m guessing it has something to do with the commands the windows keyboard is sending.

Do the volume up/down keys work by themselves without the modifier keys? Have you tried all the other modifier combinations (command+shift, command+option, command+control, option+control, control+shift) with the up/down volume keys?

Adjust Volume by ¼ Increments.kmmacros (5.7 KB)

Here is an AppleScript that properly adjusts the volume in ¼ increments. It doesn't get stuck at 66 (or any of the other values) as it is using a list of valid volume values instead.

3 Likes

Wow. Why does that work? Why are some values invalid? That’s, well, that’s very Apple!

Wow yes! The Onan solution worked!
Thanks to everybody for you help!

Yes i tried a lot of key combinations.

Legacy code and rounding.

Over the years, you would adjust volume using different ranges. Integers 0-7, 0-10, and for a short time 0-1000, then floating point 0-1. And now we have 0 through 100 even though there are only 65 possible values (0=mute and 1 through 64). I think there is still some legacy code doing various adjustments and rounding, although I couldn't figure out the logic. 100/64 = 1.5625 but none of the typical rounding functions (up, down, to even, to odd, away from zero, "as taught in school" [yes that is a valid rounding parameter in AppleScript] ) would match to the results.

The problem with Jimmy's incremental script earlier was that the value 67 would "round down" to 66 so every time the script tried to set it to 67, it would end up at 66. There are a few other values that do the same thing.

Even worse is the value of 90 is in the list twice. I think 89 rounds up to 90 but then everything in the 90.0 - 90.9 range rounds down to 90. As you said, "very Apple".

Andres, I'm glad to hear that it is working for you.

5 Likes

8 posts were merged into an existing topic: Is there a way to increase the Apple Music volume by 1% instead of 10%?