About

libscorecode is an interpreter for the ScoreCode language.

How To Use It

The below is a barebones example of creating and setting up an interpreter object. Callbacks only need to be registered for events that one wants to handle.

#include "scorecode.h"

//create the interpreter, first arg is BPM, second is channels
ScoreCode i = ScoreCode(120, 1);

//register some callbacks
//channels start at 0
i.registerNoteOnCallback(0, &somefunction);
i.registerNoteOffCallback(0, &someotherfunction);

//start the interpreter
i.run();

//push a pattern to the interpreter
//first arg is channel, pattern is a string
i.pushPattern(0, "!o.+o.+o.+o.+o.+o.+o.+o.")

//sleep for a few seconds to let it play
sleep(5);

//stop the interpreter
i.stop()

That's pretty much it. The basic idea of this library is that it acts as a controller for a synth or other software, so it's as lightweight as possible.