{"id":16345405,"url":"https://github.com/unclechu/midi-trigger","last_synced_at":"2025-08-01T13:37:40.964Z","repository":{"id":25090380,"uuid":"28511267","full_name":"unclechu/MIDI-Trigger","owner":"unclechu","description":"LV2 plugin which generates MIDI notes by detected audio signal peaks.","archived":false,"fork":false,"pushed_at":"2022-07-18T20:59:20.000Z","size":74,"stargazers_count":23,"open_issues_count":1,"forks_count":2,"subscribers_count":7,"default_branch":"master","last_synced_at":"2025-03-18T15:54:50.797Z","etag":null,"topics":["analyzer","audio","audio-dsp","c","lv2","lv2-plugin","midi"],"latest_commit_sha":null,"homepage":"","language":"C","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/unclechu.png","metadata":{"files":{"readme":"README.md","changelog":"CHANGELOG.md","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":"2014-12-26T13:17:44.000Z","updated_at":"2022-12-10T17:13:01.000Z","dependencies_parsed_at":"2022-08-23T15:40:54.913Z","dependency_job_id":null,"html_url":"https://github.com/unclechu/MIDI-Trigger","commit_stats":null,"previous_names":["metachronica/audio-dsp-midi-trigger"],"tags_count":4,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/unclechu%2FMIDI-Trigger","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/unclechu%2FMIDI-Trigger/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/unclechu%2FMIDI-Trigger/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/unclechu%2FMIDI-Trigger/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/unclechu","download_url":"https://codeload.github.com/unclechu/MIDI-Trigger/tar.gz/refs/heads/master","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":245040235,"owners_count":20551297,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2022-07-04T15:15:14.044Z","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":["analyzer","audio","audio-dsp","c","lv2","lv2-plugin","midi"],"created_at":"2024-10-11T00:31:35.489Z","updated_at":"2025-03-23T00:32:43.901Z","avatar_url":"https://github.com/unclechu.png","language":"C","funding_links":[],"categories":[],"sub_categories":[],"readme":"# MIDI-Trigger\n\n[![Nix CI](https://github.com/unclechu/MIDI-Trigger/actions/workflows/nix.yml/badge.svg)](https://github.com/unclechu/MIDI-Trigger/actions/workflows/nix.yml)\n\nLV2 plugin which generates MIDI notes by detected audio signal peaks.\n\nIt can be used to retrigger drums which would be the main purpose of it.\nBut also it can be used for some weird experiments. Just put some track as a\nsound source, connect MIDI output to some synth, automate “MIDI note” value,\nand see what happens.\n\nThe **MIDI-Trigger** plugin has one mono audio input and one MIDI output.\nSo it takes audio signal as an input and provides MIDI output with the triggered\nnotes you can connect to some synth or sampler.\n\nThis plugin works and has already been used in some recorded band albums to\nimprove drum sounds by adding a retriggered drum sample. Though it’s missing a\nGUI at the moment which would make it a bit easier to use. If you follow usage\ninfo instruction it should be no problem to use it.\n\n## Supported OSes\n\n1. GNU/Linux — Tested by me personally on NixOS\n   and builds successfully on Ubuntu in CI using Nix\n\n2. MacOS — I don’t have a machine to test it but in CI it successfully builds\n   using Nix\n\n## Usage info\n\nThe defaults for the knobs are tuned for retriggering drum tracks.\nSo basically you need to pay attention to these 3 values:\n\n1. Threshold — Sensitivity level (the lower the value the more sensitive it is)\n2. MIDI note — Which note to trigger (MIDI number)\n3. Note-off mode — MIDI notes generation strategy/pattern (see below)\n\n**“Note-off mode”** knob available values:\n\n- *1* — Send **NOTE-OFF** immediately before **NOTE-ON**\n- *2* — Send **NOTE-OFF** immediately after **NOTE-ON**\n- *3* — Send **NOTE-OFF** after “Note-off delay” or earlier\n        if it’s interrupted by another **NOTE-ON**\n- *4* — Send **NOTE-OFF** after “Note-off delay”\n        only if it’s not interrupted by another **NOTE-ON**\n- *5* — Don’t send **NOTE-OFF**s\n\n### Using with Ardour\n\nIt’s not a common combination for a plugin to have an audio input and a MIDI\noutput. So by default Ardour doesn’t commutate it properly. Here is a steps you\nneed to follow to make it work:\n\n1. Add an audio/bus track and add “MIDI-Trigger” plugin to it (before fader)\n\n2. Open context menu of the plugin (right mouse click) and open\n   “Pin connections...”\n\n   You should see that the plugin in the center has one red MIDI output port.\n   But it’s not connected anywhere because plugin has only one green audio\n   output port to the outside world.\n\n3. Click “Manual Config” button\n4. Add “MIDI Out” port (click “+” plus button)\n5. Remove “Audio Out” (click “-” minus button)\n\n6. Click and hold on the plugins’s MIDI port and drag it to the outer MIDI\n   output so that it makes a connection\n\n7. Now you can put a sampler or a synth after the plugin which takes MIDI signal\n   as an input\n\n### How to build and run\n\nHere are the requirements:\n\n1. GNU/Make\n2. GCC compiler\n3. LV2 headers\n\nJust run:\n\n``` sh\nmake\n```\n\nThere is now `build/midi-trigger.lv2` directory with the plugin. You can place\nthis plugin directory to somewhere like `/usr/lib/lv2` (depending on your\ndistro). Or you can try it like this (with Ardour as an example):\n\n``` sh\nLV2_PATH=\"$PWD/build:$LV2_PATH\" ardour6\n```\n\nAnd find the plugin by “MIDI-Trigger” name.\n\n#### Using Nix\n\nI recommend to use [Nix] package manager to get a reproducible build.\nThis project includes Nix configuration.\n\nBuild it like this:\n\n``` sh\nnix-build -o result\n```\n\nThere is now `result` symlink to a directory placed in `/nix/store` which\nhas plugin directory by `lib/lv2/midi-trigger.lv2` path inside it.\n\nNow you can start Ardour for instance providing `LV2_PATH` to this plugin:\n\n``` sh\nLV2_PATH=\"$PWD/result/lib/lv2:$LV2_PATH\" ardour6\n```\n\nAnd find the plugin by “MIDI-Trigger” name.\n\n#### Using Clang instead of GCC\n\nYou can compile this program also with Clang like this:\n\n``` sh\nmake CXX=clang\n```\n\nOr using Nix:\n\n``` sh\nnix-build --argstr compiler clang\n```\n\n#### Installing globally on NixOS\n\nHere is an example for your `configuration.nix`:\n\n``` nix\n{ pkgs, ... }:\nlet\n  midi-trigger-src = fetchTarball {\n    url = \"https://github.com/NixOS/nixpkgs/archive/0000000000000000000000000000000000000000.tar.gz\";\n    sha256 = \"0000000000000000000000000000000000000000000000000000\";\n  };\n\n  midi-trigger = pkgs.callPackage midi-trigger-src { src = midi-trigger-src; };\nin\n{\n  environment.systemPackages = [\n    midi-trigger\n  ];\n}\n```\n\nPaste commit hash to the placeholder after `/archive/` and before `.tar.gz` and\nrun once to get calculated SHA256 checksum in the error log. Then paste that\nSHA256 checksum to the `sha256` field and rebuild one more time.\n\n## Development hints\n\n### direnv\n\nIf you are using [direnv][direnv] you can look at\n[.envrc example file](.envrc.example) (just uses Nix,\nhelps to auto-reload `nix-shell`).\n\n## Authors\n\n* [Viacheslav Lotsmanov](https://github.com/unclechu)\n* [Andrew Fatkulin](https://github.com/co-yo-ne-da)\n\n## Contributors\n\n* [Olivier Humbert](https://github.com/trebmuh)\n\n## License\n\n[GPLv3](./LICENSE)\n\n[Nix]: https://github.com/NixOS/nix\n[direnv]: https://direnv.net\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Funclechu%2Fmidi-trigger","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Funclechu%2Fmidi-trigger","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Funclechu%2Fmidi-trigger/lists"}