name
Sequencer
import promidi.*;

Sequencer sequencer;

void setup(){
  sequencer = new Sequencer();

  MidiIO midiIO = MidiIO.getInstance();
  midiIO.printDevices();
  midiIO.closeOutput(1);
  MidiOut test = midiIO.getMidiOut(1,1);

  Track track = new Track("one", test);
  track.setQuantization(Q._1_4);
  track.addEvent(new Note(36, 127,40), 0);
  track.addEvent(new Note(49, 80,40), 1); 
  track.addEvent(new Note(41, 90,40), 2);
  track.addEvent(new Note(46, 127,40), 3);

  Song song = new Song("test", 120);
  song.addTrack(track);
  sequencer.setSong(song);
  sequencer.setLoopStartPoint(0);
  sequencer.setLoopEndPoint(512);
  sequencer.setLoopCount(-1);
}

void mousePressed(){
  if(mouseButton == LEFT) sequencer.start();
  else sequencer.stop();
}

void draw(){
}
description
A sequencer describes a device that records and plays back a sequence of control information for any electronic musical instrument. The proMIDI Sequencer allows you you to record and playback MIDI data.

The minimal time resolution of a sequencer is a tick. The proMIDI sequencer has a rate of 512 ticks per bar.
constructors
Sequencer();
fields
A value indicating that looping should continue indefinitely rather than complete after a specific number of loops.
methods
Returns the endpoint of the loop the sequencer should play
Returns the startpoint of the loop the sequencer should play
Returns the song the sequencer is currently playing
Returns the actual tempo of the sequencer in BPM.
Returns the actual position of the sequencer in the actual song in ticks.
Use this method to see if the sequencer is running.
Tells the sequencer to permanently play the current loop
Tells the sequencer to stop playing the loop
Sets how often the loop of the sequencer has to be played.
Sets the endpoint of the loop the sequencer should play
Sets the startpoint of the loop the sequencer should play
Sets the song the sequencer has to play.
Sets the actual tempo of the sequencer in BPM.
Sets the actual position of the sequencer in ticks.
Starts the sequencer.
Stops the playback of the sequencer.
usage
Web & Application
related