Skip to content
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

Implement App.Midi for mapping MIDI inputs and emitting MIDI data as JavaScript Events #74

Open
Marak opened this issue Apr 16, 2022 · 5 comments

Comments

@Marak
Copy link
Owner

Marak commented Apr 16, 2022

To start, we require a simple MIDI Mapper that will emit MIDI data as JS events.

The basic concept is that a buddy can open App.Midi, plug in a MIDI device, and begin playing keys / pressing buttons on the MIDI Device.

App.Midi will then take the incoming MIDI data and emit something like desktop.emit("midi", noteData)

The expectation is that other Apps will be able to subscribe to this event using desktop.on("midi", "piano-plays-notes", fn)

This should be relatively simple to implement. The Event Emitter pattern is already built into desktop.on and desktop.emit.

Marak added a commit that referenced this issue Apr 17, 2022
@Marak
Copy link
Owner Author

Marak commented Apr 17, 2022

Was relatively easy to implement. We now have App.Midi which can be opened from the Profile page or from any text area by typing /midi.

Was able to successfully connect a MIDI device and broadcast MIDI events on desktop.emit.

Next steps will be connecting the existing App.MidiFighter and App.Piano to optionally accept the MIDI data. Feel free to join us in #Alpha room if you are interested in MIDI support.

Screen Shot 2022-04-16 at 11 50 21 PM

@Marak
Copy link
Owner Author

Marak commented Apr 17, 2022

Was able to connect App.Piano input to the desktop.emit("midi-message") event.

This means now if a Buddy connects a MIDI Controller they should be able to play the Piano! Awesome!

The mappings are currently very basic, but we can build on this pattern for other instruments.

@IceGuye
Copy link

IceGuye commented Apr 17, 2022

Hey Marak, this is IceGuye. The midi setup is okay, but the piano does work like what it should be. So, the controller ID should be the note (pitch), the value should be the volume or if it doesn't support velocity/volume, that is fine, you should put 0 to sound off and positive 1 - 127 to sound on. Right now, you put the value as the note, so it doesn't work right.

@Marak
Copy link
Owner Author

Marak commented Apr 17, 2022

Yes, the mappings are just proof of concept for the MIDI bridge @IceGuye

Hoping someone can come in and help push this a bit more forward.

@Marak
Copy link
Owner Author

Marak commented Apr 17, 2022

Thank you for testing this out @IceGuye !

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants