Git Product home page Git Product logo

midi-trigger's Introduction

MIDI-Trigger

Nix CI

LV2 plugin which generates MIDI notes by detected audio signal peaks.

It can be used to retrigger drums which would be the main purpose of it. But also it can be used for some weird experiments. Just put some track as a sound source, connect MIDI output to some synth, automate “MIDI note” value, and see what happens.

The MIDI-Trigger plugin has one mono audio input and one MIDI output. So it takes audio signal as an input and provides MIDI output with the triggered notes you can connect to some synth or sampler.

This plugin works and has already been used in some recorded band albums to improve drum sounds by adding a retriggered drum sample. Though it’s missing a GUI at the moment which would make it a bit easier to use. If you follow usage info instruction it should be no problem to use it.

Supported OSes

  1. GNU/Linux — Tested by me personally on NixOS and builds successfully on Ubuntu in CI using Nix

  2. MacOS — I don’t have a machine to test it but in CI it successfully builds using Nix

Usage info

The defaults for the knobs are tuned for retriggering drum tracks. So basically you need to pay attention to these 3 values:

  1. Threshold — Sensitivity level (the lower the value the more sensitive it is)
  2. MIDI note — Which note to trigger (MIDI number)
  3. Note-off mode — MIDI notes generation strategy/pattern (see below)

“Note-off mode” knob available values:

  • 1 — Send NOTE-OFF immediately before NOTE-ON
  • 2 — Send NOTE-OFF immediately after NOTE-ON
  • 3 — Send NOTE-OFF after “Note-off delay” or earlier if it’s interrupted by another NOTE-ON
  • 4 — Send NOTE-OFF after “Note-off delay” only if it’s not interrupted by another NOTE-ON
  • 5 — Don’t send NOTE-OFFs

Using with Ardour

It’s not a common combination for a plugin to have an audio input and a MIDI output. So by default Ardour doesn’t commutate it properly. Here is a steps you need to follow to make it work:

  1. Add an audio/bus track and add “MIDI-Trigger” plugin to it (before fader)

  2. Open context menu of the plugin (right mouse click) and open “Pin connections...”

    You should see that the plugin in the center has one red MIDI output port. But it’s not connected anywhere because plugin has only one green audio output port to the outside world.

  3. Click “Manual Config” button

  4. Add “MIDI Out” port (click “+” plus button)

  5. Remove “Audio Out” (click “-” minus button)

  6. Click and hold on the plugins’s MIDI port and drag it to the outer MIDI output so that it makes a connection

  7. Now you can put a sampler or a synth after the plugin which takes MIDI signal as an input

How to build and run

Here are the requirements:

  1. GNU/Make
  2. GCC compiler
  3. LV2 headers

Just run:

make

There is now build/midi-trigger.lv2 directory with the plugin. You can place this plugin directory to somewhere like /usr/lib/lv2 (depending on your distro). Or you can try it like this (with Ardour as an example):

LV2_PATH="$PWD/build:$LV2_PATH" ardour6

And find the plugin by “MIDI-Trigger” name.

Using Nix

I recommend to use Nix package manager to get a reproducible build. This project includes Nix configuration.

Build it like this:

nix-build -o result

There is now result symlink to a directory placed in /nix/store which has plugin directory by lib/lv2/midi-trigger.lv2 path inside it.

Now you can start Ardour for instance providing LV2_PATH to this plugin:

LV2_PATH="$PWD/result/lib/lv2:$LV2_PATH" ardour6

And find the plugin by “MIDI-Trigger” name.

Using Clang instead of GCC

You can compile this program also with Clang like this:

make CXX=clang

Or using Nix:

nix-build --argstr compiler clang

Installing globally on NixOS

Here is an example for your configuration.nix:

{ pkgs, ... }:
let
  midi-trigger-src = fetchTarball {
    url = "https://github.com/NixOS/nixpkgs/archive/0000000000000000000000000000000000000000.tar.gz";
    sha256 = "0000000000000000000000000000000000000000000000000000";
  };

  midi-trigger = pkgs.callPackage midi-trigger-src { src = midi-trigger-src; };
in
{
  environment.systemPackages = [
    midi-trigger
  ];
}

Paste commit hash to the placeholder after /archive/ and before .tar.gz and run once to get calculated SHA256 checksum in the error log. Then paste that SHA256 checksum to the sha256 field and rebuild one more time.

Development hints

direnv

If you are using direnv you can look at .envrc example file (just uses Nix, helps to auto-reload nix-shell).

Authors

Contributors

License

GPLv3

midi-trigger's People

Contributors

trebmuh avatar unclechu avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Forkers

eq4 ponyloop

midi-trigger's Issues

Installation on Ubuntu Studio 23.04

Hi, "make" command gives this result on my Ubuntu :

In file included from src/uris.c:9:
src/uris.h:12:10: fatal error: lv2/lv2plug.in/ns/ext/atom/atom.h: Aucun fichier ou dossier de ce type
12 | #include "lv2/lv2plug.in/ns/ext/atom/atom.h"
| ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~

And no .lv2 is created... maybe I should run make anywhere else ? Thx

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.