Skip to content

Commit

Permalink
show the name fo the patcher
Browse files Browse the repository at this point in the history
  • Loading branch information
starakaj committed Mar 11, 2022
1 parent 40c6b63 commit b8d7a72
Show file tree
Hide file tree
Showing 2 changed files with 8 additions and 1 deletion.
3 changes: 3 additions & 0 deletions index.html
Original file line number Diff line number Diff line change
Expand Up @@ -28,6 +28,9 @@
<noscript>You need to enable JavaScript to run this app.</noscript>
<svg id="background" width="100%" height="100%"></svg>
<div id="rnbo-root">
<div>
<h2 id="patcher-title">Unnamed patcher</h2>
</div>
<div id="rnbo-clickable-keyboard">
<h2>MIDI Keyboard</h2>
<em id="no-midi-label">No MIDI input</em>
Expand Down
6 changes: 5 additions & 1 deletion js/app.js
Original file line number Diff line number Diff line change
Expand Up @@ -31,6 +31,10 @@ async function setup() {
// Connect the device to the web audio graph
device.node.connect(outputNode);

// (Optional) Extract the name of the patcher from the description
if (patcher.desc.meta && patcher.desc.meta.filename)
document.getElementById("patcher-title").innerText = patcher.desc.meta?.filename;

// (Optional) Automatically create sliders for the device parameters
makeSliders(device);

Expand Down Expand Up @@ -182,7 +186,7 @@ function attachOutports(device) {
device.messageEvent.subscribe((ev) => {
// Message events have a tag as well as a payload
console.log(`${ev.tag}: ${ev.payload}`);
});
});
}

function makeMIDIKeyboard(device) {
Expand Down

0 comments on commit b8d7a72

Please sign in to comment.