-
Notifications
You must be signed in to change notification settings - Fork 5
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
this library without the userinterface? #5
Comments
Is it a story that you want to send MIDI signals to sf2synth.js using the Web Midi API? I don't know if it will be helpful, but there is a program that converts MIDI signals sent by Web Midi Link (the MIDI transmission/reception standard used by smfplayer.js and sf2synth.js) to Web MIDI API. |
thank you for that link (and thinking with me).
I'm looking at this js-wrapper of libfluidsynth.js but it does not work in my browser :/
|
sf2synth.js is the receiver. I haven't read the specification properly, but convert the Uint8Array format of MIDIMessageEvent.data to comma-separated hexadecimal numbers like |
thanks for your comment, I will have a look! |
I don't have a real MIDI device anymore, so I don't know if it will work, but I think it would be better to implement it by creating a class derived from wml.js. export default class WebMidiApi extends WebMidiLink {
/**
* Constructor
*/
constructor() {
super();
/** @type {MIDIAccess?} */
this.midi = undefined;
}
/** セットアップ */
async setup(url) {
/** @type {MIDIAccess} */
const midi = new Promise((resolve, reject) => {
this.window.navigator
.requestMIDIAccess(/** @type {MIDIOptions} */ { sysex: true })
.then(
access => {
this.success(access);
resolve(this);
parent.setup(url);
},
err => {
reject(err);
}
);
});
this.midi = midi;
parent.setup(url);
}
/** Web Midi API Ready */
onReady() {
if (this.loadCallback) {
// コールバック実行
this.loadCallback();
}
this.midi.onmidimessage = (/** @type {Uint8Array} */ msg) =>
parent.processMidiMessage(msg);
}
} |
Hi, thank you for all your great audio-work.
I need a sf2 player which supports CC data (basically the sf2 modulators) so I can send webmidi-in or a midi-file to my sf2.
Is there a simple library you recommend for this (without userinterface)?
The text was updated successfully, but these errors were encountered: