Groups | Search | Server Info | Keyboard shortcuts | Login | Register [http] [https] [nntp] [nntps]


Groups > comp.lang.javascript > #40567

Re: making MIDI -- foot in mouth?

From Julio Di Egidio <julio@diegidio.name>
Newsgroups comp.lang.javascript
Subject Re: making MIDI -- foot in mouth?
Date 2021-11-28 12:21 +0100
Organization A noiseless patient Spider
Message-ID <snvood$f2n$1@dont-email.me> (permalink)
References <c0a4ba01-31b5-4486-9164-c3d791a8e277n@googlegroups.com> <5e200a12-0458-475f-912f-a9fc3f5c9427n@googlegroups.com>

Show all headers | View raw


On 28/11/2021 04:59, luserdroog wrote:
> On Saturday, November 27, 2021 at 5:12:02 PM UTC-6, luserdroog wrote:
>> I've been making grandiose comments and hyperboles about
>> structure and abstraction and whatnot without putting up a lot
>> code. And admittedly, I'm not super experienced in javascript
>> per se compared to most of the regs here.

FYI, encapsulating logic in functions and, along the same line, avoiding 
shared state to the full extent possible, while already way better than 
anything Jonas keeps writing, still falls short of any actual code 
structuring proper (and, all the more so of any actual and explicitly 
functional use of JS).  Indeed, code structuring, as the bottom line of 
software design, is not per se primarily nor immediately a matter of the 
specific language.

That said, maybe keep also in mind that you are hardly going to see or 
do any significant structuring of code unless you get and go beyond the 
500 (maybe even the 1000, YMMV) lines of code.

> Well, dang. Foot indeed in mouth. A Midi file doesn't help you with
> the Web Midi API.

Unless I have missed it, you have yet to say what requirement you are 
trying to implement exactly.  Building a midi file in memory to simply 
play it in the browser?  What's difficult with that?  Or rather playing 
midi?

If it is playing midi, I think the approach has to be the exact opposite 
that you guys have shown so far: it's not the notes that should drive 
the loop, it's time itself (your metronome) that should tick at a 
certain frequency, call it your "resolution frequency" (in practice, 
ticking the 32nds or the 64ths, depending on how precise vs fast you 
manage to make it), then at certain ticks, i.e. as and when needed, you 
would send out midi events.

And the first iteration would be building such "metronome" and its loop 
and making it tick with enough accuracy and not accumulating drift (a 
least within some reasonable range of metronomic speeds, aka BPMs)...

Julio

Back to comp.lang.javascript | Previous | Next — Previous in thread | Next in thread | Find similar | Unroll thread


Thread

making MIDI -- foot in mouth? luserdroog <luser.droog@gmail.com> - 2021-11-27 15:11 -0800
  Re: making MIDI -- foot in mouth? luserdroog <luser.droog@gmail.com> - 2021-11-27 19:59 -0800
    Re: making MIDI -- foot in mouth? Julio Di Egidio <julio@diegidio.name> - 2021-11-28 12:21 +0100
      Re: making MIDI -- foot in mouth? Jonas Thörnvall <jonas.thornvall@gmail.com> - 2021-11-28 04:00 -0800
        Re: making MIDI -- foot in mouth? Julio Di Egidio <julio@diegidio.name> - 2021-11-28 04:08 -0800
          Re: making MIDI -- foot in mouth? Jonas Thörnvall <jonas.thornvall@gmail.com> - 2021-11-28 08:29 -0800
            Re: making MIDI -- foot in mouth? Jonas Thörnvall <jonas.thornvall@gmail.com> - 2021-11-28 08:40 -0800
              Re: making MIDI -- foot in mouth? Jonas Thörnvall <jonas.thornvall@gmail.com> - 2021-11-28 08:57 -0800
              Re: making MIDI -- foot in mouth? Jonas Thörnvall <jonas.thornvall@gmail.com> - 2021-11-28 09:03 -0800
          Re: making MIDI -- foot in mouth? Jonas Thörnvall <jonas.thornvall@gmail.com> - 2021-11-28 08:35 -0800
      Re: making MIDI -- foot in mouth? luserdroog <luser.droog@gmail.com> - 2021-11-29 21:53 -0800
        Re: making MIDI -- foot in mouth? Julio Di Egidio <julio@diegidio.name> - 2021-11-30 23:54 -0800
          Re: making MIDI -- foot in mouth? luserdroog <luser.droog@gmail.com> - 2021-12-02 21:16 -0800
    Re: making MIDI -- foot in mouth? luserdroog <luser.droog@gmail.com> - 2021-11-29 23:33 -0800
      Re: making MIDI -- foot in mouth? Jonas Thörnvall <jonas.thornvall@gmail.com> - 2021-11-30 00:46 -0800
        Re: making MIDI -- foot in mouth? Jonas Thörnvall <jonas.thornvall@gmail.com> - 2021-11-30 00:56 -0800
          Re: making MIDI -- foot in mouth? Jonas Thörnvall <jonas.thornvall@gmail.com> - 2021-11-30 01:00 -0800
            Re: making MIDI -- foot in mouth? Jonas Thörnvall <jonas.thornvall@gmail.com> - 2021-11-30 01:15 -0800
              Re: making MIDI -- foot in mouth? Jonas Thörnvall <jonas.thornvall@gmail.com> - 2021-11-30 01:19 -0800

csiph-web