{"id":24186253,"url":"https://github.com/0cc4m/midi-control","last_synced_at":"2026-06-09T15:02:02.376Z","repository":{"id":51581683,"uuid":"364607413","full_name":"0cc4m/midi-control","owner":"0cc4m","description":"Trigger actions on MIDI input.","archived":false,"fork":false,"pushed_at":"2021-05-12T18:36:39.000Z","size":48,"stargazers_count":0,"open_issues_count":0,"forks_count":0,"subscribers_count":2,"default_branch":"main","last_synced_at":"2025-03-03T01:41:47.936Z","etag":null,"topics":["automation","hotkeys","midi","midi-controller","python","python3"],"latest_commit_sha":null,"homepage":"","language":"Python","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"gpl-3.0","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/0cc4m.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":"LICENSE","code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null}},"created_at":"2021-05-05T14:38:03.000Z","updated_at":"2021-05-11T06:43:09.000Z","dependencies_parsed_at":"2022-08-22T07:41:20.683Z","dependency_job_id":null,"html_url":"https://github.com/0cc4m/midi-control","commit_stats":null,"previous_names":[],"tags_count":0,"template":false,"template_full_name":null,"purl":"pkg:github/0cc4m/midi-control","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/0cc4m%2Fmidi-control","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/0cc4m%2Fmidi-control/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/0cc4m%2Fmidi-control/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/0cc4m%2Fmidi-control/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/0cc4m","download_url":"https://codeload.github.com/0cc4m/midi-control/tar.gz/refs/heads/main","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/0cc4m%2Fmidi-control/sbom","scorecard":null,"host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":286080680,"owners_count":34112225,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2026-05-26T15:22:16.424Z","status":"online","status_checked_at":"2026-06-09T02:00:06.510Z","response_time":63,"last_error":null,"robots_txt_status":"success","robots_txt_updated_at":"2025-07-24T06:49:26.215Z","robots_txt_url":"https://github.com/robots.txt","online":true,"can_crawl_api":true,"host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":["automation","hotkeys","midi","midi-controller","python","python3"],"created_at":"2025-01-13T12:34:43.055Z","updated_at":"2026-06-09T15:02:02.344Z","avatar_url":"https://github.com/0cc4m.png","language":"Python","funding_links":[],"categories":[],"sub_categories":[],"readme":"# midi-control\n\nTrigger actions on MIDI input.\n\nThis script was developed for midi controlers from the Steinberg CMC series, but it is probably adaptable to other controllers by adding a new device definition file.\n\n## Installation\n\nUse setuptools:\n``` bash\ngit pull https://github.com/0cc4m/midi-control.git\ncd midi-control\npython setup.py install --user\n```\n\nOr on Arch Linux you can use the supplied PKGBUILD.\n\n## Configuration\n\n`midi-control` reads its configuration from `~/.config/midi-control/`.\nIt expects two files in that directory:\n* device.yml\n* actions.yml\n\n### device.yml\n\nThis file defines all the buttons and controls which are present on the used controller as well as some constansts.\nYour device may already have a definition file, check the `devices` directory of this repository.\n\nThe top level entries of this file are the MIDI ports the device provides. This can be more than one, for example in the case of the Steinberg Quick Controller (`devices/steinberg_qc.yml`).\n(With the exception of the `consts`entry)\nThe port entries define names for controls by key and type.\n\nLet's imagine a midi controller that has one control knob and one button.\nThe knob might send 'control_change' for controller 0x10 and the button 'note_on' for the key 0x40.\nA definiton for this device could look like this:\n\n``` yaml\nSimple Controller MIDI 1:\n  note_on:\n    0x40: button_1\n  control_change:\n    0x10: knob_1\n```\n\n### actions.yml\n\nThis file maps actions to the controls defined in device.yml.\nCurrently the following actions are available:\n* command\n* toggle\n* fader_command\n* dbus\n* dbus_toggle\n\nActions can be triggered by different events:\n* press\n* release\n* cw (clockwise rotation)\n* ccw (counter clockwise rotation)\n* set (value change)\n\nThe `set` event always fires when the associated control sends a message. This is useful for processing raw midi messages.\n\n(What constitutes a press, release, etc. event is defined in the device constants)\n\nTop level entries in this file define for which port the actions are defined.\nAn `actions.yml` for the simple controller might look like this:\n``` yaml\nSimple Controller MIDI 1:\n  button_1:\n    press:\n      type: command\n      command: [\"notify-send\", \"Button 1 was pressed\"]\n    release:\n      type: command\n      command: [\"notify-send\", \"Button 1 was release\"]\n\n```\n\n## Actions\n\nConfigure action:\n``` yaml\n\u003cdevice\u003e:\n  \u003ccontrol\u003e:\n    \u003cevent\u003e:\n      type: \u003caction_type\u003e\n      \u003coption\u003e: \u003cvalue\u003e\n      ...\n      ...\n```\n\nMost actions also accept a `states` option (or `states_on` and `states_off` for toggle commands)\nThis is used to define MIDI messages that should be sent back to the controller when the actions gets executed.\nSome controllers accept midi messages to set the state of an associated LEDs, so this can for example be used to display the state of a toggle command.\n\n### command\n``` yaml\n\u003cevent\u003e:\n  type: command\n  command: [\"notify-send\", \"pressed\"] # Command to be executed\n  states: \n    button_1: on # Turn led of button_1 on\n```\n\n### toggle_command\n``` yaml\n\u003cevent\u003e:\n  type: command\n  command_on: [\"notify-send\", \"toggle on\"]\n  command_on: [\"notify-send\", \"toggle off\"]\n  states_on: \n    button_1: on # Turn led of button_1 on\n  states_off: \n    button_1: off # Turn led of button_1 off \n```\n\n### fader_command\nThis actions takes the third byte of whatever message triggered it and maps to the interval specified by the min and max options.\nIt then replaces any occurence of `$VALUE` in the command with this value.\n\nExample for controlling volume:\n``` yaml\nset:\n  type: fader_command\n  command: [\"pactl\", \"set-sink-volume\", \"@DEFAULT_SINK@\", \"$VALUE%\"]\n  min: 0\n  max: 100\n```\n\n### dbus\nCalls a dbus method.\nArguments can be supllied as a list in `args`.\n``` yaml\n\u003cevent\u003e:\n  type: dbus\n  service: net.sourceforge.mumble.mumble\n  path: /\n  method: setSelfMuted\n  args:\n    - true\n  states: \n    button_1: on # Turn led of button_1 on\n\n```\n\n### dbus_toggle\nLike command_toggle, but with dbus methods.\nArguments can be supplied as a list in `args_on` and `args_off`\n\n``` yaml\n\u003cevent\u003e:\n  type: dbus_toggle\n  service: net.sourceforge.mumble.mumble\n  path: /\n  method: setSelfMuted\n  args_on:\n    - true\n  args_off:\n    - false\n  states_on:\n    write: on\n    states_off:\n    write: off\n```\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2F0cc4m%2Fmidi-control","html_url":"https://awesome.ecosyste.ms/projects/github.com%2F0cc4m%2Fmidi-control","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2F0cc4m%2Fmidi-control/lists"}