This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# --- Very basic Midi-Implementation for JRuby (note on/off, pitchbend, controller, aftertouch), especially for use with ruby-processing, http://wiki.github.com/jashkenas/ruby-processing --- | |
module JavaMidi | |
midi = javax.sound.midi | |
import midi.MidiSystem | |
import midi.MidiDevice | |
import midi.MidiEvent | |
import midi.ShortMessage | |
import midi.Receiver | |
end |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# === MIDI-Notes to solresol-colours in RubyProcessing. Example for the use of JRmidi, very basic Midi-Implementation for JRuby, especially for use with ruby-processing === | |
# --- ruby-processing see: http://wiki.github.com/jashkenas/ruby-processing / solresol is a universal language, where words can be put out as musical notes, colours or other --- | |
# --- solresol see: http://en.wikipedia.org/wiki/Solresol --- | |
# Notes have to come as MIDI-note-events from MIDI-in, and are so we can hear them redirected to a synth as well | |
# ! ==> adopt your MIDI-ports below !!!! | |
MIDI_PORT_IN = 0 # your MIDI-input where notes will be mapped to coulors | |
MIDI_PORT_OUT = 11 # select this port so, that is redirected to MIDI-in by hardware, with JACK, ableton live or something (ports are numbered from 0 to n, no difference if in or out) | |
MIDI_OUT_SYNTH = 9 # the OS-System's synth, port number may differ on your system |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# === MIDI-Notes to solresol-colours in RubyProcessing. Example for the use of JRmidi, very basic Midi-Implementation for JRuby, especially for use with ruby-processing === | |
# --- ruby-processing see: http://wiki.github.com/jashkenas/ruby-processing / solresol is a universal language, where words can be put out as musical notes, colours or other --- | |
# --- solresol see: http://en.wikipedia.org/wiki/Solresol --- | |
# Notes have to come as MIDI-note-events from MIDI-in, and are for demonstration purposes redirected to two other output ports as well, adopt your MIDI-ports below! | |
MIDI_PORT_IN = 0 # your MIDI-input where notes will be mapped to coulors | |
MIDI_PORT_OUT_DAW_IN = 12 # the ports are numberes from 0 to n in the java-sound-API, this is a virtual in port of my "Digital Audio Wortstation", where this output is sent to | |
MIDI_PORT_OUT_SYNTH = 9 # in my configuration this is the synth as provided by the operating-system | |
require "jr_midi" # class JRmidi for basic MIDI I/O in JRuby... |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# --- parameters to be set in ./data/java_args.txt --- | |
# -Xms256m -Xmx256m # Heap at least 256 MB | |
# -Djna.library.path="/ruby-processing/library/gsvideo/library/gstreamer/win" # optional for future video extension... | |
require "jrMidiVsynth22" # class JRmidi for basic MIDI I/O in JRuby, adapt your MIDI-ports here if necessary | |
SETTINGS = "visualSynthSettings14" # contains changable settings for "which function to call" by modifier-keys | |
# === helper functions === (map internal representation of layers to external for "print-out" | |
class Range | |
def inspect_plus_one |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# === Interference: take MIDI-in from two channels, merge to one output - dependent on "set-operation"-method selected from menu... === | |
# Options for calling: :frame_rate => nn sets framerate, :verbose => true|false gives additional printout-information... (see last line of this file!) | |
# --- Options, see Panel-GUI (when application is started) : --------------------------------------------------------------------------------------------------------------- | |
# ° dropdown "velocity_option" used for include or exclude filter range of velocity for operations including this filter-option... | |
# ° slider "in A Channel": Channel for notes of "set A" | |
# ° slider "in B Channel": Channel for notes of "set B" | |
# ° slider "in switch Channel": Channel for notes to switch an operation, only if operation equals "midi_note_selected" | |
# -> Caution: be sure to select 3 different MIDI-Channels for each functionality, or you may get unpreditible results (default is 1,2,3 anyway) | |
# ° slider "velocity lower limit": range-start for opera |