source: trunk/src/org/apollo/meldex/Melody.java

Last change on this file was 315, checked in by bjn8, 16 years ago

Apollo spin-off added

File size: 1.4 KB
Line 
1package org.apollo.meldex;
2
3
4/**
5 * This class represents a monophonic melody: an ordered list of melody events. This class is
6 * basically just a wrapper around an array of MelodyEvents (an array is used instead of a
7 * Vector for efficiency reasons). This class is serializable since it must be able to be
8 * written to the matching query collection files.
9 */
10
11public class Melody extends StandardisedMelody
12{
13
14 private static final long serialVersionUID = -8903591998036012467L;
15
16 /** Pitch type: absolute pitch. */
17 public static final int ABSOLUTE_PITCH = 1;
18 /** Pitch type: relative pitch (interval/contour). */
19 public static final int RELATIVE_PITCH = 2;
20
21 /** The pitch type (absolute/relative) of this melody. */
22 private int pitchType;
23
24
25 /**
26 * Creates a new Melody with the specified pitch type and the given melody events.
27 *
28 * @param pitchType The pitch type (absolute/relative) of the melody.
29 * @param events The melody events that form the melody.
30 */
31 public Melody(int pitchType, MelodyEvent[] events)
32 {
33 super(events);
34 this.pitchType = pitchType;
35 }
36
37
38 /**
39 * Returns the pitch type (absolute/relative) of this melody.
40 *
41 * @return the pitch type (absolute/relative) of this melody.
42 */
43 public int getPitchType()
44 {
45 return pitchType;
46 }
47}
Note: See TracBrowser for help on using the repository browser.