This is very exciting!  Thank you!

 


On 2024-03-25 03:19, Vanessa Freudenberg wrote:

 

Of course I couldn't let this sit there. As of just now, SqueakJS supports actual MIDI ðŸ¥³ At least in Chrome:
 
        https://squeak.js.org/
 
You can run an image, drop in a MIDI file, and play it.
 
I don't have a hardware synth so I tested MIDI output via GarageBand. The Steinway Grand sounds great playing the Moonlight sonata. Here's a video with sound:
 
        https://freudenbergs.de/vanessa/squeakjs/SqueakJS-MIDI.mp4
 
Should work in pretty much any Squeak version (I tried in 6.2, too).
 
I tested MIDI input using the MidiKeys app since I don't have a real keyboard. It's implemented and the data coming into the image looks right, but the MidiSynth class's playback does not sound quite right. 
 
Also, it's not entirely clear what epoch/units the midi clock is supposed to be in – possibly because Squeak changed millisecondClockValue to not start at 0 anymore, whereas older images (or at least the MIDI code in it) expects that.
 
If anyone wants to hack it, my WebMIDI plugin code is in:
 
        https://github.com/codefrau/SqueakJS/blob/main/plugins/MIDIPlugin.js
 
Have fun ðŸ’œ
Vanessa

On Thu, Mar 21, 2024 at 9:44 AM Tobias Pape via Vm-dev <vm-dev@lists.squeakfoundation.org> wrote:
 
Hi

> On 21. Mar 2024, at 17:37, Vanessa Freudenberg <vanessa@codefrau.net> wrote:
>
> A friend is trying to get this to work – is it supposed to work?
>
> > "SimpleMIDIPort primPortCount" evaluates to 0, even when I have a MIDI controller plugged in.
> And "SimpleMIDIPort openDefault" gives me a primitive failed error.

It could™ work, yet, I noticed that the API used is outdated since 10 years, so there's that.
So, it might depend on the macOS used.
I wanted to fix that since forever

Best regards
        -Tobias