Haxe Grig

Introduction 🧚🏼‍♂️


trace(MidiIn.getApis());
var midiIn = new MidiIn(grig.midi.Api.Unspecified);
midiIn.setCallback(function (midiMessage:MidiMessage, delta:Float) {
    trace(midiMessage.messageType);
    trace(delta);
});
midiIn.getPorts().handle(function(outcome) {
    switch outcome {
        case Success(ports):
            trace(ports);
            midiIn.openPort(0, 'grig.midi').handle(function(midiOutcome) {
                switch midiOutcome {
                    case Success(_):
                        mainLoop(midiIn);
                    case Failure(error):
                        trace(error);
                }
            });
        case Failure(error):
            trace(error);
    }
});

Get your grig t-shirt!

Grig is a set of small audio packages for haxe (and by extension, the langauges haxe targets)to process and create music and audio.Grig is designed to have as few dependencies and interdependencies as possible, so that you can use as much or as little of thefeatures you need withing bringing in a heavy framework. Haxe's dead code elimination also ensures that unusedfunctionality within a package isn't included in the final output.

For non-hardware code, grig is designed to work on all haxe targets. Audio and MIDI IO externs are also provided for a number ofdifferent environments (see below). This means that it should be possible to run the same audio code on multiple differentenvironments, ranging from standalone compiled applications, to the browser, to plugins.

See the api documentation.

Hardware Capabilities:

EnvironmentMidi IOAudio IO
c++
hashlink(rtmidi)(portaudio)
c++/vst
c++/au
c++/lv2
c++/fmodN/A
js/html5
js/nodejs
java
c#(managed midi)
c#/fmodN/A
lua(luamidi)
python
heapsN/A

grig.midi

grig.audio

Installation

I recommend lix as a way to manage haxe versions and packages. Howevergrig packages can be installed using haxelib as well. Please note that due to the use of git submodules, installing directlyfrom the repo isn't supported for cpp standalone on grig.audio and grig.midi.Instead, to use the latest version from git, clone the repo, then modify the appropriate files under haxe_modules to point tothat directory as detailed in the lix documentation.

lix install haxelib:grig.midi

Copyright © 2019 Osaka Red LLC, redistributable per the terms of the CC Attribution 4.0 license.