wolfsoul13
New member
- Joined
- Feb 2, 2006
- Messages
- 2
Id like to use javax.sound.midi.* to generate MIDI (at a specific channel, instrument and frequency), something like this:
public static void PlayNote(int channel, int note, int instrum)
{
try {
Synthesizer synth = MidiSystem.getSynthesizer();
synth.open();
final MidiChannel[] mc = synth.getChannels();
Instrument[] instr = synth.getDefaultSoundbank().getInstruments();
synth.loadInstrument(instr[instrum]);
try {
Thread.sleep(100);
} catch (InterruptedException e) {}
mc[channel].noteOn(note,200);
}
} catch (MidiUnavailableException e) {}
}
}
Id like to be able to call this from a C# project.
Can I do that?
public static void PlayNote(int channel, int note, int instrum)
{
try {
Synthesizer synth = MidiSystem.getSynthesizer();
synth.open();
final MidiChannel[] mc = synth.getChannels();
Instrument[] instr = synth.getDefaultSoundbank().getInstruments();
synth.loadInstrument(instr[instrum]);
try {
Thread.sleep(100);
} catch (InterruptedException e) {}
mc[channel].noteOn(note,200);
}
} catch (MidiUnavailableException e) {}
}
}
Id like to be able to call this from a C# project.
Can I do that?