<div dir="auto">I’ll have to check if our electric piano has midi.</div><div dir="auto"><br></div><div dir="auto">John</div><div><br><div class="gmail_quote"><div dir="ltr" class="gmail_attr">On Thu, May 25, 2023 at 8:59 AM GPU Group <<a href="mailto:gpugroup@gmail.com">gpugroup@gmail.com</a>> wrote:<br></div><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex"><div dir="ltr"><div dir="ltr"><div dir="ltr"><div dir="ltr"><div>Could / should there be a MIDI component in web3d specs?</div><div><br></div><div dir="ltr">i've been playing with MIDI for another hobby, and have a MIDI keyboard, which makes no sound by itself when plugged into a USB port on windows desktop computer. I have to download a MIDI PLAYER program and run it, and the one i downloaded says Made with Unity on startup. It doesn't reliably 'find' the MIDI keyboard, so I found some native code library and test sample scenes, and made a little program, and it finds the keyboard reliably, and I do a bit of processing on the volume - to slow a press and I couldn't hear the sound, so I do a test and put a minimum volume.<div>The program doesn't make sounds by itself. There's a midiin and midiout object, and the midiout finds a few devices and asks which one. I choose MS Synth - something built into the microsoft windows operating system. And that makes sound which comes out the operating system speakers when I forward the 'messages' to midiout.</div><div>A few things to note:</div><div>- analogous to new Sound nodes which have source, processing and destination nodes, except simpler source = midiin, destination = midiout, and the connections/routing is done in a message callback handler with procedural code, and can have source with url and .midi file format</div><div>- analogous to mouse/keyboard record / playback we use for desktop testing, with double time delta from last event saved with each event recorded, and on playback sleep(delta_time) between playing back events.</div><div>- processing could be analogous to an event utility node with a few dozen eventOut fields, with notes being SFBool TRUE when pressed and FALSE when released -- a bit like a programmable logic controller, except with a serial stream of timed events.</div><div>There's a webMIDI API, although not all browsers have it.</div><div>- instead of relying on operating system synth, in theory MIDI sounds could be made by an array of about 10 OscillatorSource nodes, 10 being a polyphony like having all 10 fingers on a piano at the same time.</div><div>-Doug</div><div><p class="MsoNormal"><a href="https://github.com/jcelerier/libremidi" target="_blank">https://github.com/jcelerier/libremidi</a>
<span></span></p>
<p class="MsoNormal">- native lib for desktop win, osx, linux based on RtMidi + ModernMidi <span></span></p><p class="MsoNormal">- includes midiin, midiout, and midi 1 file read / write</p><p class="MsoNormal"><a href="https://developer.mozilla.org/en-US/docs/Web/API/Web_MIDI_API" target="_blank">https://developer.mozilla.org/en-US/docs/Web/API/Web_MIDI_API</a><br></p><div>- WebMIDI</div></div><div><a href="https://www.midi.org/specifications-old/item/table-1-summary-of-midi-message" target="_blank">https://www.midi.org/specifications-old/item/table-1-summary-of-midi-message</a><br></div><div>- <span style="font-family:Verdana,sans-serif;font-size:10pt">MIDI
1.0 messages</span></div><div><p class="MsoNormal"><a href="https://en.wikipedia.org/wiki/MIDI" target="_blank">https://en.wikipedia.org/wiki/MIDI </a> <br></p><p class="MsoNormal"><a href="https://www.cs.cmu.edu/~music/cmsip/readings/Standard-MIDI-file-format-updated.pdf" target="_blank">https://www.cs.cmu.edu/~music/cmsip/readings/Standard-MIDI-file-format-updated.pdf</a> <br></p><p class="MsoNormal">- MIDI 1 file format</p><p class="MsoNormal"><br></p><p class="MsoNormal"><span></span></p></div><div><span style="font-family:Verdana,sans-serif;font-size:10pt"><br></span></div><div><br></div></div></div></div></div></div>
_______________________________________________<br>
x3d-public mailing list<br>
<a href="mailto:x3d-public@web3d.org" target="_blank">x3d-public@web3d.org</a><br>
<a href="http://web3d.org/mailman/listinfo/x3d-public_web3d.org" rel="noreferrer" target="_blank">http://web3d.org/mailman/listinfo/x3d-public_web3d.org</a><br>
</blockquote></div></div>