1
나는 미디 넘버, 듀레이션, 그리고 벨로 시티가있는 몇 개의 노트를 가지고있다. 나는 현재 음을 연주하는 신디사이저를 사용하고간단한 MIDI 파일을 출력하는 가장 간단한 방법은 무엇입니까?
:
Synthesizer synthesizer = MidiSystem.getSynthesizer();
synthesizer.open();
MidiChannel[] channels = synthesizer.getChannels();
for(Note n: song)
{
n.playNote(channels[0]);
}
synthesizer.close();
Note.playNote()
public void playNote(MidiChannel c) throws InterruptedException
{
if (type == 'n')
c.noteOn(noteNumber, 60);
Thread.sleep(getLength());
if (type == 'n')
c.noteOff(noteNumber);
}
그러나, 지금은 미디 파일이 저장하고 싶습니다. 이 작업을 수행하는 가장 간단한 방법은 무엇입니까? 다음과 같이
http://www.automatic-pilot.com/midifile.html 이 도움이 될 수 있습니다. – diegoperini