All Projects → arirusso → midi-eye

arirusso / midi-eye

Licence: other
Ruby MIDI input event listener

Programming Languages

ruby
36898 projects - #4 most used programming language

Projects that are alternatives of or similar to midi-eye

smartbcr2k
Sits between your midi controller and your DAW to make your controller smarter
Stars: ✭ 21 (-12.5%)
Mutual labels:  midi, midi-device, midi-controller
BS2-Web
Novation Bass Station II Web interface
Stars: ✭ 34 (+41.67%)
Mutual labels:  midi, midi-device, midi-controller
midi-grid
DIY midi controller project
Stars: ✭ 60 (+150%)
Mutual labels:  hardware, midi, midi-controller
BMC
BMC the Badass MIDI Controller, all-in-one Scalable MIDI Controller library with a companion Desktop/Browser Editor App for Teensy LC, 3.2, 3.5, 3.6, 4.0, 4.1
Stars: ✭ 34 (+41.67%)
Mutual labels:  midi, midi-device, midi-controller
zmidimap
Program for mapping midi signals to shell commands
Stars: ✭ 13 (-45.83%)
Mutual labels:  midi, midi-device, midi-controller
MiDispositivoMIDI V3
Open source Arduino MIDI controller.
Stars: ✭ 49 (+104.17%)
Mutual labels:  midi, midi-device, midi-controller
Arduino-USBMIDI
Allows a microcontroller, with native USB capabilities, to appear as a MIDI device over USB to a connected computer
Stars: ✭ 98 (+308.33%)
Mutual labels:  midi, midi-device, midi-controller
TouchOSC
A collection of examples and modules for TouchOSC MK2
Stars: ✭ 30 (+25%)
Mutual labels:  midi, midi-controller
Wad
Web Audio DAW. Use the Web Audio API for dynamic sound synthesis. It's like jQuery for your ears.
Stars: ✭ 1,540 (+6316.67%)
Mutual labels:  midi, midi-device
libDaisy
Hardware Library for the Daisy Audio Platform
Stars: ✭ 164 (+583.33%)
Mutual labels:  hardware, midi
MinimumViableSynth
A virtual analog synthesizer with lots of knobs and buttons.
Stars: ✭ 22 (-8.33%)
Mutual labels:  hardware, midi
Sol
An open-source MIDI-to-CV Eurorack module that runs CircuitPython
Stars: ✭ 56 (+133.33%)
Mutual labels:  hardware, midi-device
Unimidi
Realtime MIDI IO for Ruby
Stars: ✭ 229 (+854.17%)
Mutual labels:  hardware, midi
ableton-midi-sculptor
Ableton MIDI Sculptor: Tools for MIDI editing in Ableton Live
Stars: ✭ 56 (+133.33%)
Mutual labels:  midi, midi-device
osmid
osmid is a tool to bridge MIDI and OSC. It is currently in use in Sonic Pi
Stars: ✭ 63 (+162.5%)
Mutual labels:  midi, midi-device
Pedalino
Smart wireless MIDI foot controller for guitarists and more.
Stars: ✭ 105 (+337.5%)
Mutual labels:  midi, midi-controller
arduino-midi-footswitch
USB MIDI Pedal built with Arduino
Stars: ✭ 24 (+0%)
Mutual labels:  hardware, midi
arm synth
Wavetable Synth Running on an STM32F 32-bit ARM Cortex M3 microprocessor
Stars: ✭ 23 (-4.17%)
Mutual labels:  midi, midi-device
OpenDeck
Software and hardware platform for simpler building of MIDI controllers with support for DMX.
Stars: ✭ 438 (+1725%)
Mutual labels:  midi, midi-controller
micro-typed-events
The smallest, most convenient typesafe TS event emitter you'll ever need
Stars: ✭ 39 (+62.5%)
Mutual labels:  event-listener, listener

MIDI EYE

MIDI input event listener for Ruby

Install

gem install midi-eye

or using Bundler, add this to your Gemfile

gem "midi-eye"

Usage

require 'midi-eye'

The following is an example that takes any note messages received from a unimidi input, transposes them up one octave and then sends them to an output

First, pick some MIDI IO ports

@input = UniMIDI::Input.gets
@output = UniMIDI::Output.gets

Then create a listener for the input port

transpose = MIDIEye::Listener.new(@input)

You can bind an event to the listener using Listener#listen_for

The listener will try to positively match the parameters you pass in to the properties of the messages it receives.

In this example, we specify that the listener listens for note on/off messages, which are identifiable by their class.

transpose.listen_for(:class => [MIDIMessage::NoteOn, MIDIMessage::NoteOff]) do |event|

  # raise the note value by an octave
  event[:message].note += 12

  # send the altered note message to the output you chose earlier
  @output.puts(event[:message])

end

There is also the option of leaving out the parameters altogether and including using conditional if/unless/case/etc statements in the callback.

You can bind as many events to a listener as you wish by repeatedly calling Listener#listen_for

Once all the events are bound, start the listener

transpose.run

A listener can also be run in a background thread by passing in :background => true.

transpose.run(:background => true)

transpose.join # join the background thread later

Documentation

Author

License

Apache 2.0, See the file LICENSE

Copyright (c) 2011-2017 Ari Russo

Note that the project description data, including the texts, logos, images, and/or trademarks, for each open source project belongs to its rightful owner. If you wish to add or remove any projects, please contact us at [email protected].