Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Mapping MIDI CC values? #119

Open
Arthur-D opened this issue Aug 14, 2022 · 2 comments
Open

Mapping MIDI CC values? #119

Arthur-D opened this issue Aug 14, 2022 · 2 comments

Comments

@Arthur-D
Copy link

Hi, I am wanting to map a fader of a Novation Launch Control XL to control my system volume on my Linux system. One thing is that I am not sure how to map it properly to my system volume, but at the very least I could in theory map the bottom state to keyboard.EV_KEY.KEY_VOLUMEDOWN and the top state to keyboard.EV_KEY.KEY_VOLUMEUP. However, I don't know how to map the various CC values that aseqdump shows. midi.md does not come with any example for it, and trying launch.ch8.cc77.0 and launch.ch8.cc77.127 does not work. Is there any way to do that?

@Gremious
Copy link

Gremious commented Dec 2, 2024

Doesn't seem (?) like they have that, but you can easily do this through their python backend.

Referring to these 2 links should be enough:

#83
https://github.com/cbdevnet/midimonster/blob/master/backends/python.md

But here's also just a config from me:

[backend midi]
name = "Midimonster MIDI (Volume)"
detect = on
; my mixer is called "smc" and this is the "volume.cfg" 
[midi midi_from_smc_volume]
read = 36:1

[python py1]
module = pipewire

[map]
midi_from_smc_volume.ch0.cc46 > py1.pipewire.main
#pipewire.py
import midimonster
import os

def main(value):
    # value is 0...1 so we need to convert it to 0..100
    # making it an int makes it smoother
    value = int(float(value) * 100)
    os.system(f"pactl set-sink-volume 0 {value}%")

    # Or your favorite command e.g.
    # os.system(f'amixer -D pulse sset Master {volume}%')

@Gremious
Copy link

Gremious commented Dec 2, 2024

As a sidenote, i tried it, and you also can map things to KEY_VOLUMEDOWN and what not in some ways, but if you do a slider.. you're going to hear the system "volume up" sound overlayed 50 million times if you have one.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants