scop
Library for the scopitone workshop
Usage
- install with
npm install scop --save
- check the demo sample:
var Scop = Scop Notes = Notes // new instance of the arduino controler scop = '/dev/ttyACM0'; // bpm and sequence to be playedvar bpm = 180;var seq = id: NotesA id: NotesA id: NotesA id: NotesB id: NotesC id: NotesB duration: Notesblanche id: NotesA duration: Notesblanche id: NotesC id: NotesB id: NotesB id: NotesA; // only start playing when the serial port is openscop;
API
Scop()
A class that instanciate a serial port communication with the arduino. When the serial port is opened, it sends a 'ready' event.
Scop.play(sequence:Array, bpm:Number)
Play sequentially the motors. The sequence provided is an array of numbers. Each of this numbers corresponds to a combination of motors to play during the measure. If you put a 0 (or scop.none) on the array it means no motor will be played during the measure. When the sequence is finished, an event is sent.
Notes
Motor combinations representing notes and chords. And note durations