import javax.sound.midi.*;
public class Musica3 {
int[][] note={{67,2},{64,1},{65,1},{67,2},{64,1},{60,1},{62,1},{60,1},{62,1},{64,1},{60,3}};
public static void main(String[] args){
Musica3 mini=new Musica3();
mini.play( );
}
public void play( ){
try{
Sequencer player=MidiSystem.getSequencer();
player.open();
player.setTempoInBPM(20);
Sequence seq=new Sequence(Sequence.PPQ,4);
Track track=seq.createTrack();
for (int i=0; i<note.length; i++){
track.add(makeEvent(144,1,note[i][0],100,i));
track.add(makeEvent(128,1,note[i][0],100,i+note[i][1]));
System.out.println(note[i][1]);
}
player.setSequence(seq);
player.start();
System.out.println(note[4][0]);
System.out.println(note[4][1]);
}
catch (Exception ex) { ex.printStackTrace();}
}
public static MidiEvent makeEvent(int comd, int chan, int nota, int inizio, int fine){
MidiEvent event=null;
try {
ShortMessage a=new ShortMessage();
a.setMessage(comd,chan,nota,inizio);
event=new MidiEvent(a,fine);
}
catch (Exception e) {e.printStackTrace();}
return event;
}
}
Various Artists - 불후의 명곡 - 전설을 노래하다 (오승근&조항조 편) (Immortal Song : Singing
The Legend (Oh Seung Geun & Cho Hang Jo Special))
-
To download this full album, choose any of the download links available
below.Various Artists - 불후의 명곡 - 전설을 노래하다 (오승근&조항조 편) (Immortal Song :
Singing The ...
8 anni fa
Nessun commento:
Posta un commento