Skip to content

Instantly share code, notes, and snippets.

@dtinth
Last active October 21, 2015 13:33
Show Gist options
  • Save dtinth/f3744956f9dfb43e00eb to your computer and use it in GitHub Desktop.
Save dtinth/f3744956f9dfb43e00eb to your computer and use it in GitHub Desktop.
export class MusicalScore {
constructor ({ notes }) {
invariant(Array.isArray(notes), 'notes must be an array')
this._notes = notes
}
get notes () {
return this._notes
}
static fromMIDIFile (midiBuffer) {
let notes = [ ]
// some scary code
return new MusicalScore({ notes })
}
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment