[x3d-public] MIDI suggestions and standard APIs

John Carlson yottzumm at gmail.com
Tue Sep 3 12:04:11 PDT 2024


Well, this now runs, but without any MIDI ports, it's pretty useless. It
works with npm and node, probably not bun.

Typical MIDI plugs into USB?  I've not used it on windows.

The web page kind of works, but without MIDI, there's no music.   There
might be a way to fake some music.

John

>
>
> https://github.com/coderextreme/piano.roll
>
>
> On Sun, Aug 25, 2024 at 12:54 AM John Carlson <yottzumm at gmail.com> wrote:
>
>> Back in the day, I was experimenting with sound in the web, maybe someome
>> can make use of it.
>>
>> Note that you may have to update to avoid vulnerabilities.  I touched
>> package.json and package-lock.json 5  months ago.  Removing
>> package-lock.json and reinstalling may be warranted, I’m not aware of any
>> package specific issues.  Note that coffeescript is used.
>>
>>
>>
>> https://github.com/coderextreme/piano.roll/
>> <https://github.com/coderextreme/piano.roll/blob/master/package.json>
>>
>> Enjoy!
>>
>> If someone “standardizes” this, great!
>>
>> John
>>
>>
>>
>> On Sat, Aug 24, 2024 at 12:40 PM Brutzman, Donald (Don) (CIV) via
>> x3d-public <x3d-public at web3d.org> wrote:
>>
>>> There certainly appears to be plenty of functionality there in
>>> WebMidi.js.  The first things that I would look for: whether it is
>>> compatible and extends the Web standards that are being implemented by all
>>> the Web browsers.
>>>
>>>
>>>    - Web Audio API, W3C Recommendation, 17 June 2021
>>>    - https://www.w3.org/TR/webaudio
>>>    - This specification describes a high-level Web API for processing
>>>    and synthesizing audio in web applications. The primary paradigm is of an
>>>    audio routing graph, where a number of AudioNode objects are connected
>>>    together to define the overall audio rendering. The actual processing will
>>>    primarily take place in the underlying implementation (typically optimized
>>>    Assembly / C / C++ code), but direct script processing and synthesis is
>>>    also supported.
>>>
>>>    - The Introduction section covers the motivation behind this
>>>    specification.
>>>
>>>    - This API is designed to be used in conjunction with other APIs and
>>>    elements on the web platform, notably: XMLHttpRequest [XHR] (using the
>>>    responseType and response attributes). For games and interactive
>>>    applications, it is anticipated to be used with the canvas 2D [2dcontext]
>>>    and WebGL [WEBGL] 3D graphics APIs.
>>>
>>>
>>> and
>>>
>>>
>>>    - Web MIDI API, W3C Working Draft 12 July 2024
>>>    - https://www.w3.org/TR/webmidi
>>>    - Some user agents have music devices, such as synthesizers,
>>>    keyboard and other controllers, and drum machines connected to their host
>>>    computer or device. The widely adopted Musical Instrument Digital Interface
>>>    (MIDI) protocol enables electronic musical instruments, controllers and
>>>    computers to communicate and synchronize with each other. MIDI does not
>>>    transmit audio signals: instead, it sends event messages about musical
>>>    notes, controller signals for parameters such as volume, vibrato and
>>>    panning, cues and clock signals to set the tempo, and system-specific MIDI
>>>    communications (e.g. to remotely store synthesizer-specific patch data).
>>>    This same protocol has become a standard for non-musical uses, such as show
>>>    control, lighting and special effects control.
>>>    - This specification defines an API supporting the MIDI protocol,
>>>    enabling web applications to enumerate and select MIDI input and output
>>>    devices on the client system and send and receive MIDI messages
>>>    <https://www.w3.org/TR/webmidi/#dfn-midi-message>. It is intended to
>>>    enable non-music MIDI applications as well as music ones, by providing
>>>    low-level access to the MIDI devices
>>>    <https://www.w3.org/TR/webmidi/#dfn-midi-device> available on the
>>>    users' systems. The Web MIDI API is not intended to describe music or
>>>    controller inputs semantically; it is designed to expose the mechanics of
>>>    MIDI input and output interfaces, and the practical aspects of sending and
>>>    receiving MIDI messages
>>>    <https://www.w3.org/TR/webmidi/#dfn-midi-message>, without
>>>    identifying what those actions might mean semantically (e.g., in terms of
>>>    "modulate the vibrato by 20Hz" or "play a G#7 chord", other than in terms
>>>    of changing a controller value or sending a set of note-on messages that
>>>    happen to represent a G#7 chord).
>>>    - To some users, "MIDI" has become synonymous with Standard MIDI
>>>    Files and General MIDI. That is not the intent of this API; the use case of
>>>    simply playing back a .SMF file is not within the purview of this
>>>    specification (it could be considered a different format to be supported by
>>>    the HTML audio
>>>    <https://html.spec.whatwg.org/multipage/media.html#audio> element,
>>>    for example). The Web MIDI API is intended to enable direct access to
>>>    devices that respond to MIDI - controllers, external synthesizers or
>>>    lighting systems, for example. The Web MIDI API is also explicitly designed
>>>    to enable a new class of applications on the web that can respond to MIDI
>>>    controller inputs - using external hardware controllers with physical
>>>    buttons, knobs and sliders (as well as musical controllers like keyboard,
>>>    guitar or wind instrument controllers) to control web applications.
>>>    - The Web MIDI API is also expected to be used in conjunction with
>>>    other APIs and elements of the web platform, notably the Web Audio
>>>    API <https://www.w3.org/TR/webmidi/#WebAudio>. This API is also
>>>    intended to be familiar to users of MIDI APIs on other systems, such as
>>>    Apple's CoreMIDI and Microsoft's Windows MIDI API.
>>>
>>> Getting more midi tracks integrated with X3D example models will help us
>>> make meaningful progress.
>>>
>>> As we become adept at both MIDI usage and all of the capabilities in the
>>> X3D4 to integrate scene + event + audio graph, it is becoming hard to
>>> imagine what we *can't *do.  My mental model of the X3D4 Sound
>>> component is that it has everything you might find in the most elaborate
>>> mixer boards, plus 3D spatialization.  Hmmm, what do you call a musician
>>> whose instrument is... the Web?!
>>>
>>>
>>>    - Extensible 3D (X3D) Part 1: Architecture and base components, 16
>>>    Sound component
>>>    -
>>>    https://www.web3d.org/specifications/X3Dv4/ISO-IEC19775-1v4-IS/Part01/components/sound.html
>>>
>>>
>>> Let's find out.  Have fun with X3D sound and spatial audio!  🙂
>>>
>>>
>>> all the best, Don
>>>
>>> --
>>>
>>> Don Brutzman  Naval Postgraduate School, Code USW/Br
>>> brutzman at nps.edu
>>>
>>> Watkins 270,  MOVES Institute, Monterey CA 93943-5000 USA
>>> +1.831.656.2149
>>>
>>> X3D graphics, virtual worlds, navy robotics
>>> https://faculty.nps.edu/brutzman
>>>
>>>
>>> ------------------------------
>>> *From:* x3d-public <x3d-public-bounces at web3d.org> on behalf of Andreas
>>> Plesch via x3d-public <x3d-public at web3d.org>
>>> *Sent:* Friday, August 23, 2024 2:52 PM
>>> *To:* X3D Graphics public mailing list <x3d-public at web3d.org>
>>> *Cc:* Andreas Plesch <andreasplesch at gmail.com>
>>> *Subject:* Re: [x3d-public] MIDI suggestions (GPU Group)
>>>
>>> My impression is that the Web MIDI API only is concerned with enabling
>>> messages from and to MIDI devices. It is then up to the MIDI devices
>>> to do something with the messages.
>>>
>>> Similarly I think it is up to the application to construct messages
>>> for tone merging or tone splitting and to send those appropriately.
>>>
>>> Perhaps the support library has convenience methods:
>>>
>>> https://nam10.safelinks.protection.outlook.com/?url=https%3A%2F%2Fwebmidijs.org%2Fdocs%2Fgetting-started%2Fbasics&data=05%7C02%7Cbrutzman%40nps.edu%7Cc406570762a3405e856908dcc3be0671%7C6d936231a51740ea9199f7578963378e%7C0%7C0%7C638600470507713111%7CUnknown%7CTWFpbGZsb3d8eyJWIjoiMC4wLjAwMDAiLCJQIjoiV2luMzIiLCJBTiI6Ik1haWwiLCJXVCI6Mn0%3D%7C40000%7C%7C%7C&sdata=M5q08Dx2yW95aW%2FTs7Ucksraqi3UptN%2FfRUhrPEVkWk%3D&reserved=0
>>> <https://webmidijs.org/docs/getting-started/basics>
>>>
>>> I do not know MIDI much so these are just impressions,
>>>
>>> -Andreas
>>>
>>> > Date: Fri, 23 Aug 2024 14:40:18 -0600
>>> > From: GPU Group <gpugroup at gmail.com>
>>> > To: "Extensible 3D (X3D) Graphics public discussion"
>>> >         <x3d-public at web3d.org>
>>> > Subject: Re: [x3d-public] MIDI suggestions (GPU Group)
>>> > Message-ID:
>>> >         <CAM2ogRfRMwVV+Ve3hKSZdcXP930xcjvocN=ZCS9Ypjb=
>>> n+vknA at mail.gmail.com>
>>> > Content-Type: text/plain; charset="utf-8"
>>> >
>>> > Very interesting Web MIDI API. I think the next move is up to the html
>>> > web3d browser gurus.
>>> > -Doug
>>> > In native C browser freewrl I made toneSplitter and toneMerger node
>>> types.
>>> > The toneSplitter would filter by octave and had out field for each
>>> note C
>>> > Cs D Ds E F Fs G Gs A As B so if you want to animate something when it
>>> hits
>>> > a certain note, you can catch the note, and in that way MIDI becomes a
>>> > general event sequencing method. I had a player-piano demo scene
>>> > that animated and played a note from a USB hardware midi keyboard. And
>>> > going the other way, a playable-piano scene where I could mouse-click
>>> a key
>>> > on a scene keyboard and it would route it to ToneMerger node and get
>>> to the
>>> > output MIDI port.
>>> > But to get between ports and the rendering thread I used threads and
>>> > message queues.
>>> > Q. for Web MIDI - is there a way to do something like the
>>> > ToneSplitter/ToneMerger without needing threading or extra message
>>> queues?
>>> >
>>> > On Fri, Aug 23, 2024 at 12:13?PM Andreas Plesch via x3d-public <
>>> > x3d-public at web3d.org> wrote:
>>> >
>>> > > I was curious and found there is a Web MIDI API:
>>> > >
>>> https://nam10.safelinks.protection.outlook.com/?url=https%3A%2F%2Fdeveloper.mozilla.org%2Fen-US%2Fdocs%2FWeb%2FAPI%2FWeb_MIDI_API&data=05%7C02%7Cbrutzman%40nps.edu%7Cc406570762a3405e856908dcc3be0671%7C6d936231a51740ea9199f7578963378e%7C0%7C0%7C638600470507724037%7CUnknown%7CTWFpbGZsb3d8eyJWIjoiMC4wLjAwMDAiLCJQIjoiV2luMzIiLCJBTiI6Ik1haWwiLCJXVCI6Mn0%3D%7C40000%7C%7C%7C&sdata=YCB00aCiWZte3VGHzZ8Y%2FmKrujJ8O64CBqy81bd6lLs%3D&reserved=0
>>> <https://developer.mozilla.org/en-US/docs/Web/API/Web_MIDI_API>
>>> > > which is supported on Browsers other than Safari.
>>> > > There is also a support library:
>>> https://nam10.safelinks.protection.outlook.com/?url=https%3A%2F%2Fwebmidijs.org%2F&data=05%7C02%7Cbrutzman%40nps.edu%7Cc406570762a3405e856908dcc3be0671%7C6d936231a51740ea9199f7578963378e%7C0%7C0%7C638600470507729514%7CUnknown%7CTWFpbGZsb3d8eyJWIjoiMC4wLjAwMDAiLCJQIjoiV2luMzIiLCJBTiI6Ik1haWwiLCJXVCI6Mn0%3D%7C40000%7C%7C%7C&sdata=n4AEX4yLouhbok8tDtrKAvdc1gRFtjyEaEGAUxavKRc%3D&reserved=0
>>> <https://webmidijs.org/>
>>> > > This is focused on connected external input devices like a keyboard,
>>> > > not necessarily on playing midi files.
>>> > > There is a midi file player:
>>> https://nam10.safelinks.protection.outlook.com/?url=https%3A%2F%2Fcifkao.github.io%2Fhtml-midi-player%2F&data=05%7C02%7Cbrutzman%40nps.edu%7Cc406570762a3405e856908dcc3be0671%7C6d936231a51740ea9199f7578963378e%7C0%7C0%7C638600470507734493%7CUnknown%7CTWFpbGZsb3d8eyJWIjoiMC4wLjAwMDAiLCJQIjoiV2luMzIiLCJBTiI6Ik1haWwiLCJXVCI6Mn0%3D%7C40000%7C%7C%7C&sdata=2Lwu1ISOUukOMALLSmd9N8Ar776IyiVuFTN0%2Bk8ya0g%3D&reserved=0
>>> <https://cifkao.github.io/html-midi-player/>
>>> > > which uses
>>> https://nam10.safelinks.protection.outlook.com/?url=https%3A%2F%2Fgithub.com%2Fmagenta%2Fmagenta-js%2Ftree%2Fmaster%2Fmusic%2F&data=05%7C02%7Cbrutzman%40nps.edu%7Cc406570762a3405e856908dcc3be0671%7C6d936231a51740ea9199f7578963378e%7C0%7C0%7C638600470507738867%7CUnknown%7CTWFpbGZsb3d8eyJWIjoiMC4wLjAwMDAiLCJQIjoiV2luMzIiLCJBTiI6Ik1haWwiLCJXVCI6Mn0%3D%7C40000%7C%7C%7C&sdata=g%2Bag1C6s%2Ffh1U8xU0E3TpZbliPPXtpcEG2siqfnPu94%3D&reserved=0
>>> <https://github.com/magenta/magenta-js/tree/master/music/>
>>> > > which does its own TensorFlow(!) based tone generation.
>>> > > I also found
>>> > >
>>> https://nam10.safelinks.protection.outlook.com/?url=https%3A%2F%2Fsurikov.github.io%2Fwebaudiofont%2Fexamples%2Fmidiplayer.html&data=05%7C02%7Cbrutzman%40nps.edu%7Cc406570762a3405e856908dcc3be0671%7C6d936231a51740ea9199f7578963378e%7C0%7C0%7C638600470507743182%7CUnknown%7CTWFpbGZsb3d8eyJWIjoiMC4wLjAwMDAiLCJQIjoiV2luMzIiLCJBTiI6Ik1haWwiLCJXVCI6Mn0%3D%7C40000%7C%7C%7C&sdata=uotpwAqqTHqzBa8QPUhqNTQhj%2BVo%2FMbB8JpqLqSfsBI%3D&reserved=0
>>> <https://surikov.github.io/webaudiofont/examples/midiplayer.html>
>>> > > which seems capable.
>>> > > -Andreas
>>> > >
>>> > > On Fri, Aug 23, 2024 at 12:16?PM <x3d-public-request at web3d.org>
>>> wrote:
>>> > > >
>>> > > > Send x3d-public mailing list submissions to
>>> > > >         x3d-public at web3d.org
>>> > > >
>>> > > > To subscribe or unsubscribe via the World Wide Web, visit
>>> > > >         http://web3d.org/mailman/listinfo/x3d-public_web3d.org
>>> > > > or, via email, send a message with subject or body 'help' to
>>> > > >         x3d-public-request at web3d.org
>>> > > >
>>> > > > You can reach the person managing the list at
>>> > > >         x3d-public-owner at web3d.org
>>> > > >
>>> > > > When replying, please edit your Subject line so it is more specific
>>> > > > than "Re: Contents of x3d-public digest..."
>>> > > >
>>> > > >
>>> > > > Today's Topics:
>>> > > >
>>> > > >    1. Re: MIDI suggestions (GPU Group)
>>> > > >
>>> > > >
>>> > > >
>>> ----------------------------------------------------------------------
>>> > > >
>>> > > > Message: 1
>>> > > > Date: Fri, 23 Aug 2024 10:15:13 -0600
>>> > > > From: GPU Group <gpugroup at gmail.com>
>>> > > > To: "Extensible 3D (X3D) Graphics public discussion"
>>> > > >         <x3d-public at web3d.org>
>>> > > > Subject: Re: [x3d-public] MIDI suggestions
>>> > > > Message-ID:
>>> > > >         <CAM2ogRfZ8=+3K+pHdu2DiNLRB=
>>> > > A3WJyzoesn+UYUcPu_PYaHBg at mail.gmail.com>
>>> > > > Content-Type: text/plain; charset="utf-8"
>>> > > >
>>> > > > Don,
>>> > > > I used MIDI Editor but just briefly, didn't master it.
>>> > > > PROTOS > General Sequencing Node - something that sequences
>>> similar to
>>> > > MIDI
>>> > > > that could be done in a PROTO is a general sequencing node, which
>>> could
>>> > > > have the benefits of a text/string field for in-scene hacking and
>>> > > multiple
>>> > > > output fields like the MIDI music octave style node type.
>>> > > > GeneralSequencer {
>>> > > > SFString in/out sequence
>>> > > > SFTime in start
>>> > > > SFBool out o1
>>> > > > SFBool out o2
>>> > > > SFBool out o3
>>> > > > ...
>>> > > > SFBool out o100
>>> > > > }
>>> > > > example
>>> > > > DEF GS1 GeneralSequencer {
>>> > > > # out field number, out field value, time offset from start
>>> > > > sequence "
>>> > > > 1 T 0.0
>>> > > > 1 F 0.25
>>> > > > 1 T 1.0
>>> > > > 2 T 1.0
>>> > > > 3 T 1.0
>>> > > > 4 T 1.0
>>> > > > "
>>> > > > # or time offset from start, out value, list of fields
>>> > > > "
>>> > > > 0.0 T 1,
>>> > > > .25 F 1,
>>> > > > 1.0 T 1 2 3 4,
>>> > > > "
>>> > > > or something like that
>>> > > > }
>>> > > > The general sequencer could be convenient for naval simulations
>>> -with the
>>> > > > string sequence being replaced according to different attack or
>>> > > submersible
>>> > > > robot maneuvers.
>>> > > > And convenient for musical HANIM sequences to synchronize musical
>>> riff
>>> > > play
>>> > > > --using standard sound nodes-- and certain humanoid articulations.
>>> > > > On each frame the Proto code would check if there are any in the
>>> sequence
>>> > > > that have (start + offset) time > current time and haven't been
>>> played,
>>> > > and
>>> > > > play them.
>>> > > >
>>> > > > -Doug
>>> > > >
>>> > > > On Fri, Aug 23, 2024 at 8:54?AM Brutzman, Donald (Don) (CIV) <
>>> > > > brutzman at nps.edu> wrote:
>>> > > >
>>> > > > > OK very good, thanks for information Doug.
>>> > > > >
>>> > > > > Meanwhile, am hoping to improve the MIDI files that we have, and
>>> > > > > potentially add more examples.  Wondering if there is a good
>>> > > open-source
>>> > > > > software tool for MIDI?
>>> > > > >
>>> > > > > I looked again within Audacity, which is an excellent open
>>> source tool.
>>> > > > > It does support MIDI but does not seem to give any information
>>> about
>>> > > what
>>> > > > > type of MIDI file is loaded or exported.  Some vulnerabilities
>>> are
>>> > > noted in
>>> > > > > NIST National Vulnerability Database but they are all on very old
>>> > > versions,
>>> > > > > so it seems trustworthy.  Linked for installation and easy use
>>> within
>>> > > > > X3D-Edit as a helper application.
>>> > > > >
>>> > > > >
>>> > > > >    -
>>> https://nam10.safelinks.protection.outlook.com/?url=https%3A%2F%2Fwww.audacityteam.org%2F&data=05%7C02%7Cbrutzman%40nps.edu%7Cc406570762a3405e856908dcc3be0671%7C6d936231a51740ea9199f7578963378e%7C0%7C0%7C638600470507748819%7CUnknown%7CTWFpbGZsb3d8eyJWIjoiMC4wLjAwMDAiLCJQIjoiV2luMzIiLCJBTiI6Ik1haWwiLCJXVCI6Mn0%3D%7C40000%7C%7C%7C&sdata=5M6ssOKKE0szMFmhnUbnGcn7%2BHYYxIS1cz0AYykD6XY%3D&reserved=0
>>> <https://www.audacityteam.org/>
>>> > > > >    -
>>> > > > >
>>> > >
>>> https://nvd.nist.gov/vuln/search/results?form_type=Basic&results_type=overview&search_type=all&query=Audacity
>>> > > > >
>>> > > > >
>>> > > > > Previous I was using MuseScore every now and then.  However an
>>> upgrade
>>> > > > > earlier this year integrated some kind of p2p streaming activity
>>> (aka
>>> > > Muse
>>> > > > > Hub) that triggered a variety of security warnings, so I stopped
>>> using
>>> > > it.
>>> > > > > However, I now see that they offer a version without Muse Hub,
>>> will try
>>> > > > > again.
>>> > > > >
>>> > > > >
>>> > > > >    -
>>> https://nam10.safelinks.protection.outlook.com/?url=https%3A%2F%2Fmusescore.org%2Fen&data=05%7C02%7Cbrutzman%40nps.edu%7Cc406570762a3405e856908dcc3be0671%7C6d936231a51740ea9199f7578963378e%7C0%7C0%7C638600470507753174%7CUnknown%7CTWFpbGZsb3d8eyJWIjoiMC4wLjAwMDAiLCJQIjoiV2luMzIiLCJBTiI6Ik1haWwiLCJXVCI6Mn0%3D%7C40000%7C%7C%7C&sdata=Fjbn%2BiGY3edjtCI4GBsp9Ma64K8fsRW0VtUeIzTvbws%3D&reserved=0
>>> <https://musescore.org/en>
>>> > > > >    -
>>> > > > >
>>> > >
>>> https://nvd.nist.gov/vuln/search/results?form_type=Basic&results_type=overview&search_type=all&query=musescore
>>> > > > >
>>> > > > >
>>> > > > > The midieditor looks possible but it is free software (hobbyist)
>>> and
>>> > > not
>>> > > > > open source, so less appealing.  Also does not have an https
>>> server,
>>> > > which
>>> > > > > is a red flag.
>>> > > > >
>>> > > > >
>>> > > > >    -
>>> https://nam10.safelinks.protection.outlook.com/?url=http%3A%2F%2Fwww.midieditor.org%2F&data=05%7C02%7Cbrutzman%40nps.edu%7Cc406570762a3405e856908dcc3be0671%7C6d936231a51740ea9199f7578963378e%7C0%7C0%7C638600470507757262%7CUnknown%7CTWFpbGZsb3d8eyJWIjoiMC4wLjAwMDAiLCJQIjoiV2luMzIiLCJBTiI6Ik1haWwiLCJXVCI6Mn0%3D%7C40000%7C%7C%7C&sdata=kee8Yzjv68BbIY9ENK7i0H64P7nvs3DboD7hMO4QJns%3D&reserved=0
>>> <http://www.midieditor.org/>
>>> > > > >
>>> > > > >
>>> > > > > Am hoping to test binary and text-based MIDI (and possibly MIDI
>>> > > version 1
>>> > > > > and 2) using different versions of the example file.
>>> > > > >
>>> > > > >
>>> > > > > Wondering if there are any open-source audio tools you can
>>> recommend
>>> > > that
>>> > > > > support
>>> > > > >
>>> > > > >
>>> > > > >    - Identifying MIDI version within a file,
>>> > > > >    - Exporting between different MIDI formats
>>> > > > >
>>> > > > >
>>> > > > > all the best, Don
>>> > > > >
>>> > > > > --
>>> > > > >
>>> > > > > Don Brutzman  Naval Postgraduate School, Code USW/Br
>>> > > > > brutzman at nps.edu
>>> > > > >
>>> > > > > Watkins 270,  MOVES Institute, Monterey CA 93943-5000 USA
>>> > > > > +1.831.656.2149
>>> > > > >
>>> > > > > X3D graphics, virtual worlds, navy robotics
>>> > > > > https://faculty.nps.edu/brutzman
>>> > > > >
>>> > > > >
>>> > > > > ------------------------------
>>> > > > > *From:* x3d-public <x3d-public-bounces at web3d.org> on behalf of
>>> GPU
>>> > > Group
>>> > > > > via x3d-public <x3d-public at web3d.org>
>>> > > > > *Sent:* Friday, August 23, 2024 7:18 AM
>>> > > > > *Cc:* GPU Group <gpugroup at gmail.com>; Extensible 3D (X3D)
>>> Graphics
>>> > > public
>>> > > > > discussion <x3d-public at web3d.org>
>>> > > > > *Subject:* Re: [x3d-public] MIDI suggestions
>>> > > > >
>>> > > > > Don,
>>> > > > > MIDI via PROTOs > working in C I used threads and queues between
>>> the
>>> > > MIDI
>>> > > > > port and the x3d rendering thread, and I don't know how to do
>>> that with
>>> > > > > PROTOs. But it might be different with Web MIDI API. So one idea
>>> is to
>>> > > wait
>>> > > > > until/in-case one of the web based x3d browsers implements a MIDI
>>> > > component
>>> > > > > using PROTOs, and see how they did that, and then the native
>>> browsers
>>> > > can
>>> > > > > adapt to that.
>>> > > > > -Doug
>>> > > > >
>>> > > > > On Thu, Aug 22, 2024 at 6:35?PM Brutzman, Donald (Don) (CIV) <
>>> > > > > brutzman at nps.edu> wrote:
>>> > > > >
>>> > > > > Understood.  The work you describe regarding MIDI nodes looks
>>> quite
>>> > > > > involved.  Possible component extension if someone did the work
>>> > > involved.
>>> > > > > Implementing as Prototype library using Script nodes might work.
>>> > > Writing
>>> > > > > extensions for X_ITE or X3DOM might work.  In each case that
>>> would be
>>> > > > > proof-of-capability and maybe not a path to wide availability.
>>> > > > >
>>> > > > > I think it is doubtful that MIDI editing would be accepted as a
>>> > > high-value
>>> > > > > use case and recommended practice for X3D 4.1, which might take
>>> an
>>> > > > > undetermined length of time anyway.  Seems like a long, unlikely
>>> and
>>> > > > > unsatisfying path to pursue.  Nevertheless possible.
>>> > > > >
>>> > > > > I looked in Audacity briefly for "saving as" MIDI ASCII but
>>> didn't find
>>> > > > > it.  Perhaps I missed it or another tool is useful.
>>> > > > >
>>> > > > > If we do have a text-base example MIDI file archived, that might
>>> > > encourage
>>> > > > > use of other online editors.  Note how X_ITE is already able to
>>> show
>>> > > XML,
>>> > > > > ClassicVRML and JSON encodings equivalently (see links in
>>> upper-right
>>> > > > > corner).
>>> > > > >
>>> > > > >
>>> > > > >    - X_ITE Playground Editor
>>> > > > >    - X3D Example Archives: X3D4WA, X3D for Web Authors, Chapter
>>> 05
>>> > > > >    Appearance Material Textures, Pixel Texture Snowman
>>> > > > >    -
>>> > > > >
>>> > >
>>> https://nam10.safelinks.protection.outlook.com/?url=https%3A%2F%2Fcreate3000.github.io%2Fx_ite%2Fplayground%2F%3Furl%3Dhttps%3A%2F%2Fwww.web3d.org%2Fx3d%2Fcontent%2Fexamples%2FX3dForWebAuthors%2FChapter05AppearanceMaterialTextures%2FPixelTextureSnowman.x3d&data=05%7C02%7Cbrutzman%40nps.edu%7Cc406570762a3405e856908dcc3be0671%7C6d936231a51740ea9199f7578963378e%7C0%7C0%7C638600470507761389%7CUnknown%7CTWFpbGZsb3d8eyJWIjoiMC4wLjAwMDAiLCJQIjoiV2luMzIiLCJBTiI6Ik1haWwiLCJXVCI6Mn0%3D%7C40000%7C%7C%7C&sdata=L%2BfRORqqmLIWApEHvmOMk%2FAXrE9i3KK0BAyWmgbr2Bw%3D&reserved=0
>>> <https://create3000.github.io/x_ite/playground/?url=https://www.web3d.org/x3d/content/examples/X3dForWebAuthors/Chapter05AppearanceMaterialTextures/PixelTextureSnowman.x3d>
>>> > > > >
>>> > > > >
>>> > > > >
>>> > > > >    - ... but has error:  Couldn't load URL '
>>> > > > >
>>> > >
>>> https://www.web3d.org/x3d/content/examples/X3dForWebAuthors/Chapter05AppearanceMaterialTextures/frosty2.mid'.EncodingError
>>> > > :
>>> > > > >    Failed to execute 'decodeAudioData' on 'BaseAudioContext':
>>> Unable
>>> > > to decode
>>> > > > >    audio data
>>> > > > >
>>> > > > >
>>> > > > >
>>> > > > >    - X3DOM similarly seems to have a problem paying the midi file
>>> > > > >    -
>>> > > > >
>>> > >
>>> https://www.web3d.org/x3d/content/examples/X3dForWebAuthors/Chapter05AppearanceMaterialTextures/PixelTextureSnowmanX3dom.xhtml
>>> > > > >
>>> > > > >
>>> > > > >
>>> > > > >    - Nothing heard using latest FreeWrl
>>> > > > >    - Nothing heard using current Castle Model Viewer
>>> > > > >
>>> > > > >
>>> > > > > Audacity plays the .midi file OK.  Might there be a problem with
>>> the
>>> > > file?
>>> > > > >
>>> > > > > Regarding sound-related implementations, am hoping we get more
>>> examples
>>> > > > > and start showing compelling implementation support for the Web
>>> Audio
>>> > > API
>>> > > > > nodes that are already added to the X3D 4.0 Sound Component.
>>> Huge but
>>> > > > > unrealized potential is already available to us...
>>> > > > >
>>> > > > >
>>> > > > >    -  Spatial Sound in X3DOM with Web Audio API
>>> > > > >    -
>>> https://nam10.safelinks.protection.outlook.com/?url=https%3A%2F%2Fmedialab.hmu.gr%2Fminipages%2Fx3domAudio&data=05%7C02%7Cbrutzman%40nps.edu%7Cc406570762a3405e856908dcc3be0671%7C6d936231a51740ea9199f7578963378e%7C0%7C0%7C638600470507766681%7CUnknown%7CTWFpbGZsb3d8eyJWIjoiMC4wLjAwMDAiLCJQIjoiV2luMzIiLCJBTiI6Ik1haWwiLCJXVCI6Mn0%3D%7C40000%7C%7C%7C&sdata=8LqGHCYYZRBt%2FWc6vIJ9KeGNr2WaCRjuUHp1%2FOtYf3I%3D&reserved=0
>>> <https://medialab.hmu.gr/minipages/x3domAudio>
>>> > > > >
>>> > > > >
>>> > > > >
>>> > > > >    - X3D Example Archives: X3D4AM, X3D for Advanced Modeling,
>>> Audio
>>> > > > >    Spatial Sound
>>> > > > >    -
>>> > > > >
>>> > >
>>> https://www.web3d.org/x3d/content/examples/X3dForAdvancedModeling/AudioSpatialSound/
>>> > > > >
>>> > > > >
>>> > > > > Again thanks for pushing on the limits, hope these potential
>>> paths
>>> > > forward
>>> > > > > can help us focus further progress.
>>> > > > >
>>> > > > >
>>> > > > > all the best, Don
>>> > > > >
>>> > > > > --
>>> > > > >
>>> > > > > Don Brutzman  Naval Postgraduate School, Code USW/Br
>>> > > > > brutzman at nps.edu
>>> > > > >
>>> > > > > Watkins 270,  MOVES Institute, Monterey CA 93943-5000 USA
>>> > > > > +1.831.656.2149
>>> > > > >
>>> > > > > X3D graphics, virtual worlds, navy robotics
>>> > > > > https://faculty.nps.edu/brutzman
>>> > > > >
>>> > > > >
>>> > > > >
>>> > > > > ------------------------------
>>> > > > > *From:* GPU Group <gpugroup at gmail.com>
>>> > > > > *Sent:* Thursday, August 22, 2024 11:20 AM
>>> > > > > *To:* Brutzman, Donald (Don) (CIV) <brutzman at nps.edu>
>>> > > > > *Cc:* Extensible 3D (X3D) Graphics public discussion <
>>> > > x3d-public at web3d.org
>>> > > > > >
>>> > > > > *Subject:* Re: [x3d-public] MIDI suggestions
>>> > > > >  .
>>> > > > > Don,
>>> > > > > The current Sound component doesn't have a way to look at each
>>> MIDI
>>> > > note
>>> > > > > as an event, nor to create MIDI notes with events during scene
>>> > > execution.
>>> > > > > See this proposed separate 43 MIDI Component which allows that.
>>> > > > >
>>> https://nam10.safelinks.protection.outlook.com/?url=https%3A%2F%2Ffreewrl.sourceforge.io%2Ftests%2F43_MIDI%2F&data=05%7C02%7Cbrutzman%40nps.edu%7Cc406570762a3405e856908dcc3be0671%7C6d936231a51740ea9199f7578963378e%7C0%7C0%7C638600470507770898%7CUnknown%7CTWFpbGZsb3d8eyJWIjoiMC4wLjAwMDAiLCJQIjoiV2luMzIiLCJBTiI6Ik1haWwiLCJXVCI6Mn0%3D%7C40000%7C%7C%7C&sdata=esQeTzV6ZY8Yi3adIy7%2B%2FV8BSMxuJYNdp%2BrBMTlTgf0%3D&reserved=0
>>> <https://freewrl.sourceforge.io/tests/43_MIDI/>
>>> > > > > freewrl.sourceforge.io/tests/43_MIDI/NOTES_midi.txt
>>> > > > > -Doug
>>> > > > >
>>> > > > > On Thu, Aug 22, 2024 at 11:16?AM Brutzman, Donald (Don) (CIV) <
>>> > > > > brutzman at nps.edu> wrote:
>>> > > > >
>>> > > > > Doug, thanks for your suggestions.
>>> > > > >
>>> > > > > Regarding MIDI support:
>>> > > > >
>>> > > > >
>>> > > > >    - *X3D 4.0 Architecture, 16 Sound component, 16.4.2 AudioClip*
>>> > > > >    -
>>> > > > >
>>> > >
>>> https://www.web3d.org/specifications/X3Dv4/ISO-IEC19775-1v4-IS/Part01/components/sound.html#AudioClip
>>> > > > >    - The *url* field specifies the URL from which the sound file
>>> is
>>> > > > >    loaded. 16.2.6 Audio encoding formats
>>> > > > >    <
>>> > >
>>> https://www.web3d.org/specifications/X3Dv4/ISO-IEC19775-1v4-IS/Part01/components/sound.html#AudioEncodingFormats>
>>> > > describes
>>> > > > >    required and recommended file format support. 9.2.1 URLs,
>>> URNs and
>>> > > URIs
>>> > > > >    <
>>> > >
>>> https://www.web3d.org/specifications/X3Dv4/ISO-IEC19775-1v4-IS/Part01/components/networking.html#URLs>
>>> > > contains
>>> > > > >    details on the *url* field.
>>> > > > >
>>> > > > >
>>> > > > >
>>> > > > >    - *X3D 4.0 Architecture, 16 Sound component, 16.2.6 Audio
>>> encoding
>>> > > > >    formats*
>>> > > > >    -
>>> > > > >
>>> > >
>>> https://www.web3d.org/specifications/X3Dv4/ISO-IEC19775-1v4-IS/Part01/components/sound.html#AudioEncodingFormats
>>> > > > >
>>> > > > > X3D browsers shall support at least the *wavefile* format in
>>> > > uncompressed
>>> > > > > PCM format (see [WAV]
>>> > > > > <
>>> > >
>>> https://www.web3d.org/specifications/X3Dv4/ISO-IEC19775-1v4-IS/Part01/bibliography.html#WAV
>>> > > >
>>> > > > > ).
>>> > > > > It is recommended that X3D browsers support the MIDI file type 1
>>> sound
>>> > > > > format (see [MIDI 1.0]
>>> > > > > <
>>> > >
>>> https://www.web3d.org/specifications/X3Dv4/ISO-IEC19775-1v4-IS/Part01/references.html#MIDI-1
>>> > > >).
>>> > > > > MIDI files are presumed to use the General MIDI patch set.
>>> > > > > X3D browser support is also recommended for MIDI 2.0 (see [MIDI
>>> 2.0]
>>> > > > > <
>>> > >
>>> https://www.web3d.org/specifications/X3Dv4/ISO-IEC19775-1v4-IS/Part01/references.html#MIDI-2>
>>> > > and
>>> > > > > Web MIDI API (see [W3C-WebMIDI]
>>> > > > > <
>>> > >
>>> https://www.web3d.org/specifications/X3Dv4/ISO-IEC19775-1v4-IS/Part01/references.html#W3C-WebMIDI
>>> > > >
>>> > > > > ).
>>> > > > > It is also recommended that X3D browsers support the following
>>> formats:
>>> > > > >
>>> > > > >    - Format=MP3, container=MP3, compressed (see [I11172-1]
>>> > > > >    <
>>> > >
>>> https://www.web3d.org/specifications/X3Dv4/ISO-IEC19775-1v4-IS/Part01/references.html#I11172_1
>>> > > >
>>> > > > >    ).
>>> > > > >    - Format=AAC, container=MP4 (see [14496-14]
>>> > > > >    <
>>> > >
>>> https://www.web3d.org/specifications/X3Dv4/ISO-IEC19775-1v4-IS/Part01/references.html#14496_14
>>> > > >
>>> > > > >    ).
>>> > > > >
>>> > > > > Example X3Dscene with MIDI content:
>>> > > > >
>>> > > > >    - X3D Example Archives: X3D4WA, X3D for Web Authors, Chapter
>>> 05
>>> > > > >    Appearance Material Textures, Pixel Texture Snowman
>>> > > > >    -
>>> > > > >
>>> > >
>>> https://www.web3d.org/x3d/content/examples/X3dForWebAuthors/Chapter05AppearanceMaterialTextures/PixelTextureSnowmanIndex.html
>>> > > > >    -
>>> > > > >
>>> > >
>>> https://www.web3d.org/x3d/content/examples/X3dForWebAuthors/Chapter05AppearanceMaterialTextures/PixelTextureSnowman.x3d
>>> > > > >    -
>>> > > > >
>>> > >
>>> https://www.web3d.org/x3d/content/examples/X3dForWebAuthors/Chapter05AppearanceMaterialTextures/frosty2.mid
>>> > > > >
>>> > > > >
>>> > > > > Regarding MIDI content in ASCII form, it is certainly not
>>> disallowed in
>>> > > > > the X3D specification.   Might you please send some references
>>> and an
>>> > > > > example?  Perhaps an ASCII plaintext version of frosty2.
>>> > > > >
>>> > > > > Have fun with X3D and MIDI!  8)
>>> > > > >
>>> > > > > all the best, Don
>>> > > > >
>>> > > > > --
>>> > > > >
>>> > > > > Don Brutzman  Naval Postgraduate School, Code USW/Br
>>> > > > > brutzman at nps.edu
>>> > > > >
>>> > > > > Watkins 270,  MOVES Institute, Monterey CA 93943-5000 USA
>>> > > > > +1.831.656.2149
>>> > > > >
>>> > > > > X3D graphics, virtual worlds, navy robotics
>>> > > > > https://faculty.nps.edu/brutzman
>>> > > > >
>>> > > > >
>>> > > > >
>>> > > > > ------------------------------
>>> > > > > *From:* x3d-public <x3d-public-bounces at web3d.org> on behalf of
>>> GPU
>>> > > Group
>>> > > > > via x3d-public <x3d-public at web3d.org>
>>> > > > > *Sent:* Wednesday, August 21, 2024 3:14 PM
>>> > > > > *To:* Extensible 3D (X3D) Graphics public discussion <
>>> > > x3d-public at web3d.org
>>> > > > > >
>>> > > > > *Cc:* GPU Group <gpugroup at gmail.com>
>>> > > > > *Subject:* Re: [x3d-public] Web3D 2024: HAnim Music Animation
>>> > > competition
>>> > > > > - Win cash prizes!
>>> > > > >
>>> > > > > MIDI > at least one web3d browser supports MIDI with nodes that
>>> give
>>> > > > > events, which could be used to synchronize HAnim motions to music
>>> > > tones /
>>> > > > > beats, or vice versa.
>>> > > > > Something missing from prior work: a node that holds MIDI
>>> directly in
>>> > > > > ASCII format, for easy tinkering in X3D scene file.
>>> > > > > -Doug
>>> > > > >
>>> > > > >
>>> > > > -------------- next part --------------
>>> > > > An HTML attachment was scrubbed...
>>> > > > URL: <
>>> > >
>>> http://web3d.org/pipermail/x3d-public_web3d.org/attachments/20240823/e0f1181d/attachment.html
>>> > > >
>>> > > >
>>> > > > ------------------------------
>>> > > >
>>> > > > Subject: Digest Footer
>>> > > >
>>> > > > _______________________________________________
>>> > > > x3d-public mailing list
>>> > > > x3d-public at web3d.org
>>> > > > http://web3d.org/mailman/listinfo/x3d-public_web3d.org
>>> > > >
>>> > > >
>>> > > > ------------------------------
>>> > > >
>>> > > > End of x3d-public Digest, Vol 185, Issue 42
>>> > > > *******************************************
>>> > >
>>> > >
>>> > >
>>> > > --
>>> > > Andreas Plesch
>>> > > Waltham, MA 02453
>>> > >
>>> > > _______________________________________________
>>> > > x3d-public mailing list
>>> > > x3d-public at web3d.org
>>> > > http://web3d.org/mailman/listinfo/x3d-public_web3d.org
>>> > >
>>> > -------------- next part --------------
>>> > An HTML attachment was scrubbed...
>>> > URL: <
>>> http://web3d.org/pipermail/x3d-public_web3d.org/attachments/20240823/a91f73a4/attachment.html
>>> >
>>> >
>>> > ------------------------------
>>> >
>>> > Subject: Digest Footer
>>> >
>>> > _______________________________________________
>>> > x3d-public mailing list
>>> > x3d-public at web3d.org
>>> > http://web3d.org/mailman/listinfo/x3d-public_web3d.org
>>> >
>>> >
>>> > ------------------------------
>>> >
>>> > End of x3d-public Digest, Vol 185, Issue 44
>>> > *******************************************
>>>
>>>
>>>
>>>
>>> --
>>> Andreas Plesch
>>> Waltham, MA 02453
>>>
>>> _______________________________________________
>>> x3d-public mailing list
>>> x3d-public at web3d.org
>>> http://web3d.org/mailman/listinfo/x3d-public_web3d.org
>>> _______________________________________________
>>> x3d-public mailing list
>>> x3d-public at web3d.org
>>> http://web3d.org/mailman/listinfo/x3d-public_web3d.org
>>>
>>
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://web3d.org/pipermail/x3d-public_web3d.org/attachments/20240903/d52a493c/attachment-0001.html>


More information about the x3d-public mailing list