Here's a single-page web app that interfaces with the Yamaha FB-01 using Web MIDI API. Note that you'll need to consult the official FB-01 SysEx specification for exact parameter addresses and message formats.
html Copy code
<!DOCTYPE html>
<html>
<head>
<title>Yamaha FB-01 Controller</title>
<style>
:root { font-family: system-ui; line-height: 1.6 }
.container { max-width: 1200px; margin: 20px auto; padding: 20px }
.param-group { background: #f5f5f5; padding: 15px; margin: 10px 0; border-radius: 8px }
.param-item { margin: 10px 0; display: grid; grid-template-columns: 200px 1fr 50px }
input[type="range"] { width: 100% }
button { padding: 10px 20px; background: #007bff; color: white; border: none; border-radius: 4px }
#status { color: #666; margin: 10px 0 }
</style>
</head>
<body>
<div class="container">
<h1>Yamaha FB-01 Controller</h1>
<div id="status">MIDI: Not connected</div>
<button id="connect">Connect MIDI</button>
<button id="loadPreset">Load Current Preset</button>
<div class="param-group">
<h2>Voice Parameters</h2>
<div id="voice-params"></div>
</div>
<div class="param-group">
<h2>Performance Parameters</h2>
<div id="perf-params"></div>
</div>
</div>
<script>
// Parameter definitions (partial example - needs full spec)
const parameters = {
voice: [
{ name: 'DCO Waveform', address: [0x00, 0x00], min: 0, max: 3 },
{ name: 'DC0 Tune', address: [0x00, 0x01], min: 0, max: 127 },
// Add all 50+ parameters here
],
performance: [
{ name: 'Reverb Level', address: [0x02, 0x00], min: 0, max: 127 },
// Add all performance parameters
]
};
let midiOutput;
function createParamElement(param) {
const div = document.createElement('div');
div.className = 'param-item';
div.innerHTML = `
<label>${param.name}</label>
<input type="range" min="${param.min}" max="${param.max}"
data-address="${param.address.join(',')}" value="${param.min}">
<span class="value">${param.min}</span>
`;
return div;
}
function setupParams() {
const voiceContainer = document.getElementById('voice-params');
parameters.voice.forEach(param => {
voiceContainer.appendChild(createParamElement(param));
});
const perfContainer = document.getElementById('perf-params');
parameters.performance.forEach(param => {
perfContainer.appendChild(createParamElement(param));
});
document.querySelectorAll('input[type="range"]').forEach(input => {
input.addEventListener('input', function() {
const [addr1, addr2] = this.dataset.address.split(',').map(Number);
const value = parseInt(this.value);
sendSysEx(0x0A, addr1, addr2, value);
this.nextElementSibling.textContent = value;
});
});
}
async function connectMIDI() {
try {
const access = await navigator.requestMIDIAccess({ sysex: true });
const outputs = Array.from(access.outputs.values());
if (outputs.length) {
midiOutput = outputs[0];
document.getElementById('status').textContent = `Connected: ${midiOutput.name}`;
}
} catch (err) {
console.error('MIDI connection failed:', err);
}
}
function sendSysEx(command, addr1, addr2, value) {
if (!midiOutput) return;
// FB-01 SysEx format (example - verify with actual spec)
const msg = new Uint8Array([
0xF0, // SysEx start
0x43, // Yamaha ID
0x10, // Device number (0)
command,
0x00, // Substatus
addr1,
addr2,
value,
0xF7 // SysEx end
]);
midiOutput.send(msg);
}
function requestPresetDump() {
// Send preset request SysEx (verify actual command)
sendSysEx(0x00, 0x00, 0x00, 0x00);
}
// Handle incoming MIDI messages
navigator.requestMIDIAccess({ sysex: true }).then(access => {
access.inputs.forEach(input => {
input.onmidimessage = (event) => {
if (event.data[0] === 0xF0) {
// Handle preset dump response
parsePresetDump(event.data);
}
};
});
});
function parsePresetDump(data) {
// Parse incoming SysEx and update UI
// Implementation depends on actual response format
}
// Event Listeners
document.getElementById('connect').addEventListener('click', connectMIDI);
document.getElementById('loadPreset').addEventListener('click', requestPresetDump);
// Initialize
window.addEventListener('load', setupParams);
</script>
</body>
</html>