-
-
Notifications
You must be signed in to change notification settings - Fork 276
MIDI Extension #1725
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
MIDI Extension #1725
Conversation
I didn't know where to put the MIDI extension. Please move it if you disagree.
I'll need to remember to handle this PR |
I've ran prettier like a few dozen times with the same version and settings as the repo. If this fails I have no idea why
Something to note: I haven't tested the latest commit, but it basically just condenses some blocks into single blocks with inputs, and it passed all checks, so I'm assuming it works. Code looks perfect, but I can't test it right now. |
@CubesterYT One thing to note: If you're going to test this extension's functionality while you're reviewing it, you need a MIDI compatible digital keyboard and a MIDI API compatible browser (basically everything but Safari works). However, you probably don't need to do this as I've tested it and it works consistently. Take your time. I'll wait and be patient. |
I'm just going to look through the code and make any fixes |
No problem. Take your time |
Hi @Brackets-Coder - nice work so far, and I'm excited someone else wants to get midi into Turbowarp! I've forked your pull request and gotten started in making some changes. In particular I'm looking to add in support for all midi events (CCs, pitchbend, etc.), and possibly MIDI Out as well. Before I make a open a pull request to your fork (a pull request of a pull request 😁 ) I just wanted to make sure: are you open to collaborating and accepting changes? I'm a professional developer, but new to Scratch and how people use it/expect blocks to look and work, so please push back on any of my changes/suggestions, or let me know if you have questions. Let me know if you're down. You can review my progress so far here: https://github.com/lselden/extensions/blob/midi/extensions/MasterMath/midi.js , or review the full changelog: |
@CubesterYT or other testers/reviewers: If on windows you can use the free LoopMIDI and virtualKeys tools to test even if you don't have a hardware MIDI device. I don't have a mac handy but I believe you can use the built-in MIDI Studio feature |
Thanks for asking. I appreciate your excitement and willingness. The code looks great, professional, well-formatted, etc. but I was kind of not expecting such a request. My initial intent for this extension was to be a small and minimalistic MIDI input handling interface, with the possibility of me adding more MIDI events and MIDI output support in a later update. As of right now, I've marked this PR as "finished" and am waiting on it to be merged before I worry about further updates. So we'll see. Not right now though, thanks anyway. I hope you understand. |
Yes. I'm not opposed to this, but for the most part I've been using some physical MIDI input devices I have for testing as they're what are meant to be used by the extension and I'm not quite sure how it will handle software interference with the API, but any testing is better than nothing. |
I'll look into it |
Speaking of Macs - A quick note about that. The Safari desktop browser is the only major browser that doesn't support the Web MIDI API. What's with that? The only reason I need the compatibility detection code is because of Safari and really outdated browsers |
Because of security concerns - SYSEX could (in theory) be used maliciously, and for fingerprinting. This PR doesn't attempt to use sysex (you have to pass |
Totally understand! No complaints here. |
Right now there's a block that returns all active notes. |
What's MIDI? |
MIDI stands for Musical Input Digital Interface. It allows electric instruments (in this case a digital piano keyboard) to communicate with computers and other devices. This extension allows you to use note input from a MIDI device to control your projects. For example, pressing a note on a piano keyboard could play the corresponding note with the music extension, or be used for music visualization. |
@CubesterYT I have granted your wishes. Is it better now? |
I'll look it over again |
If any of the moderators with write access happens to have access to a MIDI keyboard for testing it'd be great if we could get them over here but no rush at all. This is too much of a tiny extension to worry about |
@SharkPool-SP maybe? idk |
Nope. I don't have one |
That's what I would've guessed |
This extension does not require a full 88 key digital piano keyboard, really any MIDI compatible keyboard (even the small octave size ones or the older synthesizers) should work |
Can any moderator test / review this? A MIDI keyboard would be great but emulation software may also work |
Not a moderator, but I'm willing to test it! |
It works awersomely here, however, I have a few suggestions to make. |
That was fast! I wouldn't mind a few suggestions, but it's probably not going to get many updates before it's merged |
I think it would be better if :
I can fork the extension and code it for you. Since I was already working on a MIDI extension I already have most of the code ready, I would just need to adapt it a little. I would have it ready between today and Monday. |
That'd be great. Like the first comment says, I wrote this in four hours very hastily so it's not at all a masterpiece and doesn't have as many features as I'd like. I think I'm just going to hold off on this PR for now though, you and @lselden can make changes if you'd like. I'm too busy with #1732 and #1936 |
Hello! |
I'm afraid I can't help you. "Allow edits by maintainers" is already enabled. try submitting a PR to https://github.com/Brackets-Coder/extensions? |
Okay |
Could you Sync the fork before I fork it? |
A lil suggestion for the banner : |
Sorry, I was away from the computer for a bit. I'll do that now.
|
@Brackets-Coder since it seems you aren't working on this PR anymore I went ahead and opened up a separate PR, which includes MIDI output not just input. I'm sure your testing/feedback would be helpful. @samuellouf if you're interested in trying it out here's the PR I submitted |
Thanks so much. Closing in favor of your better PR, I wrote this too hastily to be of any quality |
Thanks! |
This extension manages MIDI input. While support for MIDI output is possible in the future, I'm not planning on it at the moment. Currently, only MIDI note input is supported. Other MIDI input events return a console log. This means things like pitch bend, damper pedals, etc. will not work. These may also be supported in the future, but not as of now.
Note that MIDI compatibility varies depending on which browser you're using. If the browser doesn't have MIDI API support, it will return an error, show an alert, and the extension won't load. The main cause of this is Safari and significantly outdated versions of browsers.
I've made a sample project, but I won't add it until this gets merged because it uses localhost instead of extensions.turbowarp.org.
Sorry the code is bad I wrote it in like four hours