new samples - midi
Posted: Wed Jan 09, 2019 9:58 am
can you add midi samples to new lmms version?
my programm
https://djdnkey.blogspot.com/2018/11/mi ... ator.html
samples
https://djdnkey.blogspot.com/2019/01/mi ... mples.html
my programm
https://djdnkey.blogspot.com/2018/11/mi ... ator.html
samples
https://djdnkey.blogspot.com/2019/01/mi ... mples.html
Code: Select all
public class Player {
private MidiChannel[] channels = null;
private Synthesizer synth = null;
public Player() {
try {
synth = MidiSystem.getSynthesizer();
synth.open();
channels = synth.getChannels();
} catch (MidiUnavailableException ex) {
Logger.getLogger(Player.class.getName()).log(Level.SEVERE, null, ex);
}
}
public void close() {
synth.close();
}
public void playSound(int instrument, int note,int vol) {
channels[0].programChange(instrument);
channels[0].noteOn(note, vol);
try {
Thread.sleep(50 * 10);
} catch (InterruptedException ex) {
Logger.getLogger(Player.class.getName()).log(Level.SEVERE, null, ex);
}
channels[0].noteOff(note);
}
}