Ambitious I know, but I the problem I'm having
illustrates the difference between book-learning and writing real
Java programs
According to the Sequence API, I can create a
new MIDI (music) sequence, add a track to it, and
then add midi events to it.
1--in spite of the right import statement, I seem
to have to add "javax.sound.midi.MidiEvent" for
the t.add statement to find the "setTick" midi function.
2--Even though Midi2 is not static, I get the message "non-static method set.Tick(l) cannot
be referenced from a static context"
Help -- code below!
public class Midi2 {
Midi2() {
Sequence seq = null;
try {seq = new Sequence(0.0f, 500);} catch (InvalidMidiDataException e)
{System.exit(0);}
Track t = null;
t = seq.createTrack();
long l = 500;
t.add(javax.sound.midi.MidiEvent.setTick(l));