Last active
October 21, 2015 13:33
-
-
Save dtinth/f3744956f9dfb43e00eb to your computer and use it in GitHub Desktop.
This file contains hidden or 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
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