Source code: jm/midi/event/VoiceEvt.java
1 /*
2
3 <This Java Class is part of the jMusic API version 1.4, February 2003.>:58 2001
4
5 Copyright (C) 2000 Andrew Sorensen & Andrew Brown
6
7 This program is free software; you can redistribute it and/or modify
8 it under the terms of the GNU General Public License as published by
9 the Free Software Foundation; either version 2 of the License, or any
10 later version.
11
12 This program is distributed in the hope that it will be useful, but
13 WITHOUT ANY WARRANTY; without even the implied warranty of
14 MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
15 GNU General Public License for more details.
16
17 You should have received a copy of the GNU General Public License
18 along with this program; if not, write to the Free Software
19 Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA.
20
21 */
22
23 package jm.midi.event;
24
25 /***********************************************************
26 Description:
27 The interface VoiceEvt is the "parent" to a
28 group of child classes representing MIDI voice event messages.
29 These classes will usually be added to a linked list as type
30 Event. The child classes instance variable id can be used
31 to distinguish easily between the child event types.<BR>
32 <BR>
33 001 - ATouch<BR>
34 002 - ChPres<BR>
35 003 - CChange<BR>
36 004 - NoteOff<BR>
37 005 - NoteOn<BR>
38 006 - PWheel<BR>
39 007 - PChange<BR>
40 <BR>
41 <BR>
42 <i>//This example shows how to add voice events to a list</i><BR>
43 class makeScore<BR>
44 { <BR>
45 <spacer type=horizontal size=20> List violinPart = new List();<BR>
46 <spacer type=horizontal size=20> VoiceEvt voiceEvt = new CChange();<BR>
47 <spacer type=horizontal size=20> violinPart.insertAtBack(voiceEvt);<BR>
48 }<BR>
49 <BR>
50 <i>//This example prints the contents of a voice event list<BR>
51 //using the abstract method print(). </i> <BR>
52 class play_part<BR>
53 {<BR>
54 <spacer type=horizontal size=20> ListNode node = violinPart.getFirstNode();<BR>
55 <spacer type=horizontal size=20> while(node != null)<BR>
56 <spacer type=horizontal size=20> {<BR>
57 <spacer type=horizontal size=40> VoiceEvt voiceEvt = (VoiceEvt) node.getObject();<BR>
58 <spacer type=horizontal size=40> voiceEvt.print();<BR>
59 <spacer type=horizontal size=20> }<BR>
60 }<BR>
61 @author Andrew Sorensen
62 ************************************************************/
63
64 public interface VoiceEvt extends Event
65 {
66 /**Get a voice events MIDI channel*/
67 public abstract short getMidiChannel();
68
69 /**Set a voice events MIDI channel*/
70 public abstract void setMidiChannel(short midiChannel);
71 }