-
Notifications
You must be signed in to change notification settings - Fork 4
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
Send and receive note and pedal events to/from connected devices via WebMIDI #112
Commits on Jan 14, 2022
-
Allow for multiple concurrent notifications
There might be a rough edge or two here to be smoothed out later, but this is a solid first pass.
Configuration menu - View commit details
-
Copy full SHA for 679a145 - Browse repository at this point
Copy the full SHA 679a145View commit details -
Configuration menu - View commit details
-
Copy full SHA for dcb8164 - Browse repository at this point
Copy the full SHA dcb8164View commit details -
Configuration menu - View commit details
-
Copy full SHA for 39e4b6a - Browse repository at this point
Copy the full SHA 39e4b6aView commit details -
Configuration menu - View commit details
-
Copy full SHA for 5923acf - Browse repository at this point
Copy the full SHA 5923acfView commit details -
Configuration menu - View commit details
-
Copy full SHA for 12e3510 - Browse repository at this point
Copy the full SHA 12e3510View commit details -
Configuration menu - View commit details
-
Copy full SHA for ae66c4d - Browse repository at this point
Copy the full SHA ae66c4dView commit details -
Do not send simultaneous pedal events to external MIDI devices.
It turns out that hardware MIDI devices are even less happy about this than the stock ToneJS Piano code, and will enter an endless loop of pedal up/down actions if sent consecutive alternative pedal up/down events without any time between them -- as is done in the SamplePlayer to silence all held/sustained notes immediately upon Pause or Rewind. Fortunately the MIDI devices I've tested sound fine on Pause or Rewind when the pedal up/down trick is not used -- in this respect as in many others, they are better performers than the ToneJS Piano.
Configuration menu - View commit details
-
Copy full SHA for 12f7f63 - Browse repository at this point
Copy the full SHA 12f7f63View commit details -
Don't clear notifications on first roll load.
This allows notifications about the availability of external MIDI connections (or lack thereof), the majority of which are generated just as the app is initialized, to remain on screen long enough to be read. Presumably the purpose of the `clearNotification()` call in `resetApp()` is to clear any lingering error messages from previous rolls, so it's OK not to do it when the app first runs. Note that there's still a potential problem whereby the MIDI status notifications can pile up all at once so that it's still difficult to read any of them before they disappear, but this can be handled in a subsequent update.
Configuration menu - View commit details
-
Copy full SHA for aff5b1c - Browse repository at this point
Copy the full SHA aff5b1cView commit details -
Configuration menu - View commit details
-
Copy full SHA for b3ce94b - Browse repository at this point
Copy the full SHA b3ce94bView commit details -
Configuration menu - View commit details
-
Copy full SHA for cf7fcf7 - Browse repository at this point
Copy the full SHA cf7fcf7View commit details -
Configuration menu - View commit details
-
Copy full SHA for 915b4e5 - Browse repository at this point
Copy the full SHA 915b4e5View commit details -
Add persistent config option to enable/disable Web MIDI functionality.
There may be more elegant ways to do some of this. Destroying the <WebMidi/> component when it's not in use seems clean, although there is the minor issue of the `midi.onstatechange` handler sticking around. In any case, the checkbox renders some of the previous notifications unnecessary, and it kind of makes sense not to show the checkbox at all if Web MIDI isn't supported in the browser -- though I kind of liked the "too bad your browser can't do this" popup in the previous commits.
Configuration menu - View commit details
-
Copy full SHA for 40a2b10 - Browse repository at this point
Copy the full SHA 40a2b10View commit details -
<SamplePlayer/> shouldn't generate and <WebMidi/> shouldn't send out-…
…of-bounds note_on velocities
Configuration menu - View commit details
-
Copy full SHA for 986c503 - Browse repository at this point
Copy the full SHA 986c503View commit details -
Configuration menu - View commit details
-
Copy full SHA for c3eb54e - Browse repository at this point
Copy the full SHA c3eb54eView commit details -
Configuration menu - View commit details
-
Copy full SHA for 9ca6f69 - Browse repository at this point
Copy the full SHA 9ca6f69View commit details -
Don't modify velocity to represent softness when sending note events …
…to WebMIDI devices
Configuration menu - View commit details
-
Copy full SHA for 24d5f25 - Browse repository at this point
Copy the full SHA 24d5f25View commit details -
Revert "Add persistent config option to enable/disable Web MIDI funct…
…ionality." This reverts commit 02653fa.
Configuration menu - View commit details
-
Copy full SHA for 4ea5fe5 - Browse repository at this point
Copy the full SHA 4ea5fe5View commit details -
Configuration menu - View commit details
-
Copy full SHA for 1de25d0 - Browse repository at this point
Copy the full SHA 1de25d0View commit details -
Configuration menu - View commit details
-
Copy full SHA for 9ea4845 - Browse repository at this point
Copy the full SHA 9ea4845View commit details -
Remove checks for
$userSettings.midiMessageSeen
This exposes the **actual** issue with the `<Notification/>` component, which is that it's a singleton and is being clobbered. Will fix in due course.
Configuration menu - View commit details
-
Copy full SHA for f9a8512 - Browse repository at this point
Copy the full SHA f9a8512View commit details -
Simple "Enable/Disable WebMIDI" button
This isn't what it should look like, where it should go, or even how it should behave (entirely). Other than that, it's a good commit... :)
Configuration menu - View commit details
-
Copy full SHA for e31eaa6 - Browse repository at this point
Copy the full SHA e31eaa6View commit details -
Handle
$activeNotes
instartNote
andstopNote
functionsIt shouldn't be the job of the `<WebMidi/>` component to manage this. However, this does affect the way the `<Keyboard/>` component (the other client for these functions) works a little -- clicking the keys now removes the `depressed` class if it was previously applied (i.e. if the roll player state is in the middle of (a) note(s)). This is in line with the behaviour when using the keys on a WebMIDI-connected device. If this is considered undesirable (and I think I'd lean that way, if not perhaps all that hard), then both the on-screen keyboard and WebMIDI-connected devices could could be decoupled from `$activeNotes`, but I'd rather do that with a argument to the `startNote()` and `stopNote()` functions (similar to the `fromMidi` argument).
Configuration menu - View commit details
-
Copy full SHA for 73a6e8a - Browse repository at this point
Copy the full SHA 73a6e8aView commit details -
This is some opinionated stylistic refactoring. The main changes introduce more destructuring and switch statements (which are technically faster, but the point here is more about readability). I think I can make the case that all of these changes are in line with modern best practices, but I'm happy to entertain counter arguments :)
Configuration menu - View commit details
-
Copy full SHA for 3465406 - Browse repository at this point
Copy the full SHA 3465406View commit details -
Configuration menu - View commit details
-
Copy full SHA for fb47ff1 - Browse repository at this point
Copy the full SHA fb47ff1View commit details -
Configuration menu - View commit details
-
Copy full SHA for 511400a - Browse repository at this point
Copy the full SHA 511400aView commit details -
Configuration menu - View commit details
-
Copy full SHA for 8330419 - Browse repository at this point
Copy the full SHA 8330419View commit details -
Configuration menu - View commit details
-
Copy full SHA for 39c480d - Browse repository at this point
Copy the full SHA 39c480dView commit details -
Configuration menu - View commit details
-
Copy full SHA for 92ad48c - Browse repository at this point
Copy the full SHA 92ad48cView commit details
Commits on Jan 18, 2022
-
Avoid destruction/re-mounting of components on roll-change
Destroying and re-mounting the right sidebar (in particular) when the roll is changed can cause problems if child components aren't destroyed properly due to outro transitions (see sveltejs/svelte#5268). This has caused a number of bugs with the `<RollViewer/>` component not being recreated properly. One option is to eschew all outro transitions in other parts of the app; but I think a better solution in this specific case is to avoid destroying and recreating this part of the component tree unless absolutely necessary.
Configuration menu - View commit details
-
Copy full SHA for 666e087 - Browse repository at this point
Copy the full SHA 666e087View commit details
Commits on Jan 20, 2022
-
Configuration menu - View commit details
-
Copy full SHA for a35c450 - Browse repository at this point
Copy the full SHA a35c450View commit details
Commits on Jan 24, 2022
-
Configuration menu - View commit details
-
Copy full SHA for 8b635d1 - Browse repository at this point
Copy the full SHA 8b635d1View commit details -
Configuration menu - View commit details
-
Copy full SHA for 57c1273 - Browse repository at this point
Copy the full SHA 57c1273View commit details
Commits on Jan 25, 2022
-
This is a little nicer when enabling/disabling WebMIDI.
Configuration menu - View commit details
-
Copy full SHA for 954bc82 - Browse repository at this point
Copy the full SHA 954bc82View commit details -
Prevent feedback loops from external MIDI pedal devices
Pedal events send to external MIDI devices can be re-emitted back to the app (under at least some circumstances), causing feedback loops. With this commit, external pedal events are ignored unless explicitly enabled, in which case "app-side" pedal events are disabled instead.
Configuration menu - View commit details
-
Copy full SHA for c3872be - Browse repository at this point
Copy the full SHA c3872beView commit details -
Configuration menu - View commit details
-
Copy full SHA for cf6a22b - Browse repository at this point
Copy the full SHA cf6a22bView commit details