Mercurial > hg > movesynth
diff HeresyBigBangDone/application.macosx/NoteEvent.java @ 50:f4c6999ecfe9 tip
added the files on my computer that aren't aiff s> these shoudl be everything for the big bang fair 2011 - heresy, and tim's file's also here
author | Andrew N Robertson <andrew.robertson@eecs.qmul.ac.uk> |
---|---|
date | Sat, 08 Oct 2011 22:12:49 +0100 |
parents | |
children |
line wrap: on
line diff
--- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/HeresyBigBangDone/application.macosx/NoteEvent.java Sat Oct 08 22:12:49 2011 +0100 @@ -0,0 +1,61 @@ + class MidiEvent { // the basic super class for all midi events + + int firstDataByte; + int secondDataByte; + int channel; + +} + +//------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- + + class NoteEvent extends MidiEvent{ // the note event class + + int notePitch = 60; + int[] notePosition = new int[4]; + int[] noteLength = new int[4]; + int noteVelocity; + boolean noteIgnore; + boolean noteOn; + + + public NoteEvent(int notePitch, int channel, int bar, int beat, int fraction, int pulse, boolean noteOff) { + this.notePitch = notePitch; + this.channel = channel; + this.noteVelocity = 80; + if (noteOff) + this.noteVelocity = 0; + boolean noteIgnore = false; + this.noteOn = true; + } + + public NoteEvent(int notePitch, int channel, int bar, int beat, int fraction, int pulse) { + this(notePitch, channel, bar, beat, fraction, pulse, false); + } + + public NoteEvent(int notePitch, int channel, int veloc, int bar, int beat, int fraction, int pulse) { + this.notePitch = notePitch; + this.channel = channel; + this.noteVelocity = veloc; + boolean noteIgnore = false; + this.noteOn = true; + } + + + public NoteEvent(int notePitch, int channel, int bar, int beat, int fraction, int pulse, int lengthBar, int lengthBeat, int lengthFraction, int lengthPulse) { + this.notePitch = notePitch; + this.channel = channel; + this.noteVelocity = 80; + boolean noteIgnore = false; + this.noteOn = true; + notePosition[0] = bar; + notePosition[1] = beat; + notePosition[2] = fraction; + notePosition[3] = pulse; + noteLength[0] = lengthBar; + noteLength[1] = lengthBeat; + noteLength[2] = lengthFraction; + noteLength[3] = lengthPulse; + } + +} +