rebecca@26: class MidiEvent { // the basic super class for all midi events rebecca@26: rebecca@26: int firstDataByte; rebecca@26: int secondDataByte; rebecca@26: int channel; rebecca@26: rebecca@26: } rebecca@26: rebecca@26: //------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- rebecca@26: rebecca@26: class NoteEvent extends MidiEvent{ // the note event class rebecca@26: rebecca@26: int notePitch = 60; rebecca@26: int[] notePosition = new int[4]; rebecca@26: int[] noteLength = new int[4]; rebecca@26: int noteVelocity; rebecca@26: boolean noteIgnore; rebecca@26: boolean noteOn; rebecca@26: rebecca@26: rebecca@26: public NoteEvent(int notePitch, int channel, int bar, int beat, int fraction, int pulse, boolean noteOff) { rebecca@26: this.notePitch = notePitch; rebecca@26: this.channel = channel; rebecca@26: this.noteVelocity = 80; rebecca@26: if (noteOff) rebecca@26: this.noteVelocity = 0; rebecca@26: boolean noteIgnore = false; rebecca@26: this.noteOn = true; rebecca@26: } rebecca@26: rebecca@26: public NoteEvent(int notePitch, int channel, int bar, int beat, int fraction, int pulse) { rebecca@26: this(notePitch, channel, bar, beat, fraction, pulse, false); rebecca@26: } rebecca@26: rebecca@26: public NoteEvent(int notePitch, int channel, int veloc, int bar, int beat, int fraction, int pulse) { rebecca@26: this.notePitch = notePitch; rebecca@26: this.channel = channel; rebecca@26: this.noteVelocity = veloc; rebecca@26: boolean noteIgnore = false; rebecca@26: this.noteOn = true; rebecca@26: } rebecca@26: rebecca@26: rebecca@26: public NoteEvent(int notePitch, int channel, int bar, int beat, int fraction, int pulse, int lengthBar, int lengthBeat, int lengthFraction, int lengthPulse) { rebecca@26: this.notePitch = notePitch; rebecca@26: this.channel = channel; rebecca@26: this.noteVelocity = 80; rebecca@26: boolean noteIgnore = false; rebecca@26: this.noteOn = true; rebecca@26: notePosition[0] = bar; rebecca@26: notePosition[1] = beat; rebecca@26: notePosition[2] = fraction; rebecca@26: notePosition[3] = pulse; rebecca@26: noteLength[0] = lengthBar; rebecca@26: noteLength[1] = lengthBeat; rebecca@26: noteLength[2] = lengthFraction; rebecca@26: noteLength[3] = lengthPulse; rebecca@26: } rebecca@26: rebecca@26: } rebecca@26: