comparison HeresyBigBangDone/application.macosx/source/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
comparison
equal deleted inserted replaced
49:0eeda0223db3 50:f4c6999ecfe9
1 class MidiEvent { // the basic super class for all midi events
2
3 int firstDataByte;
4 int secondDataByte;
5 int channel;
6
7 }
8
9 //-------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------
10
11 class NoteEvent extends MidiEvent{ // the note event class
12
13 int notePitch = 60;
14 int[] notePosition = new int[4];
15 int[] noteLength = new int[4];
16 int noteVelocity;
17 boolean noteIgnore;
18 boolean noteOn;
19
20
21 public NoteEvent(int notePitch, int channel, int bar, int beat, int fraction, int pulse, boolean noteOff) {
22 this.notePitch = notePitch;
23 this.channel = channel;
24 this.noteVelocity = 80;
25 if (noteOff)
26 this.noteVelocity = 0;
27 boolean noteIgnore = false;
28 this.noteOn = true;
29 }
30
31 public NoteEvent(int notePitch, int channel, int bar, int beat, int fraction, int pulse) {
32 this(notePitch, channel, bar, beat, fraction, pulse, false);
33 }
34
35 public NoteEvent(int notePitch, int channel, int veloc, int bar, int beat, int fraction, int pulse) {
36 this.notePitch = notePitch;
37 this.channel = channel;
38 this.noteVelocity = veloc;
39 boolean noteIgnore = false;
40 this.noteOn = true;
41 }
42
43
44 public NoteEvent(int notePitch, int channel, int bar, int beat, int fraction, int pulse, int lengthBar, int lengthBeat, int lengthFraction, int lengthPulse) {
45 this.notePitch = notePitch;
46 this.channel = channel;
47 this.noteVelocity = 80;
48 boolean noteIgnore = false;
49 this.noteOn = true;
50 notePosition[0] = bar;
51 notePosition[1] = beat;
52 notePosition[2] = fraction;
53 notePosition[3] = pulse;
54 noteLength[0] = lengthBar;
55 noteLength[1] = lengthBeat;
56 noteLength[2] = lengthFraction;
57 noteLength[3] = lengthPulse;
58 }
59
60 }
61