Rocksolid Light

Welcome to RetroBBS

mail  files  register  newsreader  groups  login

Message-ID:  

"I am your density." -- George McFly in "Back to the Future"


devel / comp.lang.javascript / Re: Building midi message for a software synth

SubjectAuthor
* Building midi message for a software synthJonas Thörnvall
`* Re: Building midi message for a software synthJonas Thörnvall
 `* Re: Building midi message for a software synthJonas Thörnvall
  `* Re: Building midi message for a software synthJonas Thörnvall
   `* Re: Building midi message for a software synthMostowski Collapse
    `* Re: Building midi message for a software synthJonas Thörnvall
     `* Re: Building midi message for a software synthMostowski Collapse
      `* Re: Building midi message for a software synthMostowski Collapse
       `* Re: Building midi message for a software synthJonas Thörnvall
        `- Re: Building midi message for a software synthJonas Thörnvall

1
Building midi message for a software synth

<419b4226-1b11-48ca-b1eb-4a3cbf9664e2n@googlegroups.com>

  copy mid

https://www.rocksolidbbs.com/devel/article-flat.php?id=17122&group=comp.lang.javascript#17122

  copy link   Newsgroups: comp.lang.javascript
X-Received: by 2002:a05:620a:2148:: with SMTP id m8mr5593993qkm.190.1624540056471;
Thu, 24 Jun 2021 06:07:36 -0700 (PDT)
X-Received: by 2002:aca:de07:: with SMTP id v7mr7206944oig.8.1624540056233;
Thu, 24 Jun 2021 06:07:36 -0700 (PDT)
Path: i2pn2.org!i2pn.org!weretis.net!feeder8.news.weretis.net!proxad.net!feeder1-2.proxad.net!209.85.160.216.MISMATCH!news-out.google.com!nntp.google.com!postnews.google.com!google-groups.googlegroups.com!not-for-mail
Newsgroups: comp.lang.javascript
Date: Thu, 24 Jun 2021 06:07:35 -0700 (PDT)
Injection-Info: google-groups.googlegroups.com; posting-host=84.217.163.187; posting-account=kxPkPAoAAACjJi8w0gL9bnyznPzdw9HW
NNTP-Posting-Host: 84.217.163.187
User-Agent: G2/1.0
MIME-Version: 1.0
Message-ID: <419b4226-1b11-48ca-b1eb-4a3cbf9664e2n@googlegroups.com>
Subject: Building midi message for a software synth
From: jonas.thornvall@gmail.com (Jonas Thörnvall)
Injection-Date: Thu, 24 Jun 2021 13:07:36 +0000
Content-Type: text/plain; charset="UTF-8"
 by: Jonas Thörnvall - Thu, 24 Jun 2021 13:07 UTC

I am building midi messages "interfacing" a software synth. But i am so terrible reading others codes so i am not sure i understand it correct.

Isn't the bank and modulation messages just checking if byte 1 equal 176 and byte 2 equal 1 if so one should call the modulation function and if byte 2 equal 0 one should call the bnk function?

I will try again but i can't get the bnk and modulation messages to work.

switch (message[0] & 0xf0) {
case 0x80: // NoteOff: 8n kk vv
synth.noteOff(channel, message[1], message[2]);
break;
case 0x90: // NoteOn: 9n kk vv
if (message[2] > 0) {
synth.noteOn(channel, message[1], message[2]);
} else {
synth.noteOff(channel, message[1], 0);
}
break;
case 0xB0: // Control Change: Bn cc dd
/** @type {number} */
const value = message[2];
switch (message[1]) {
case 0x00: // Bank Select MSB: Bn 00 dd
synth.bankSelectMsb(channel, value);
break;
case 0x01: // Modulation Depth
synth.modulationDepth(channel, value);
break;
case 0x05: // Portament Time
break;
case 0x06: // Data Entry(MSB): Bn 06 dd
if (this.rpnMode) {
// RPN
switch (this.RpnMsb[channel]) {
case 0:
switch (this.RpnLsb[channel]) {
case 0: // Pitch Bend Sensitivity
synth.pitchBendSensitivity(channel, value);
break;
case 1:
// console.log("fine");
break;
case 2:
// console.log("coarse");
break;
default:
// console.log("default");
break;
}
break;
default:
// console.log("default:", this.RpnMsb[channel], this.RpnLsb[channel]);
break;
}

Re: Building midi message for a software synth

<bfa16d76-b90e-4ab2-a945-02b68b5c51aen@googlegroups.com>

  copy mid

https://www.rocksolidbbs.com/devel/article-flat.php?id=17123&group=comp.lang.javascript#17123

  copy link   Newsgroups: comp.lang.javascript
X-Received: by 2002:ac8:45cc:: with SMTP id e12mr4741611qto.227.1624541728710;
Thu, 24 Jun 2021 06:35:28 -0700 (PDT)
X-Received: by 2002:a4a:ea8d:: with SMTP id r13mr4436662ooh.7.1624541726998;
Thu, 24 Jun 2021 06:35:26 -0700 (PDT)
Path: i2pn2.org!i2pn.org!weretis.net!feeder8.news.weretis.net!proxad.net!feeder1-2.proxad.net!209.85.160.216.MISMATCH!news-out.google.com!nntp.google.com!postnews.google.com!google-groups.googlegroups.com!not-for-mail
Newsgroups: comp.lang.javascript
Date: Thu, 24 Jun 2021 06:35:26 -0700 (PDT)
In-Reply-To: <419b4226-1b11-48ca-b1eb-4a3cbf9664e2n@googlegroups.com>
Injection-Info: google-groups.googlegroups.com; posting-host=84.217.163.187; posting-account=kxPkPAoAAACjJi8w0gL9bnyznPzdw9HW
NNTP-Posting-Host: 84.217.163.187
References: <419b4226-1b11-48ca-b1eb-4a3cbf9664e2n@googlegroups.com>
User-Agent: G2/1.0
MIME-Version: 1.0
Message-ID: <bfa16d76-b90e-4ab2-a945-02b68b5c51aen@googlegroups.com>
Subject: Re: Building midi message for a software synth
From: jonas.thornvall@gmail.com (Jonas Thörnvall)
Injection-Date: Thu, 24 Jun 2021 13:35:28 +0000
Content-Type: text/plain; charset="UTF-8"
Content-Transfer-Encoding: quoted-printable
 by: Jonas Thörnvall - Thu, 24 Jun 2021 13:35 UTC

torsdag 24 juni 2021 kl. 15:07:40 UTC+2 skrev Jonas Thörnvall:
> I am building midi messages "interfacing" a software synth. But i am so terrible reading others codes so i am not sure i understand it correct.
>
> Isn't the bank and modulation messages just checking if byte 1 equal 176 and byte 2 equal 1 if so one should call the modulation function and if byte 2 equal 0 one should call the bnk function?
>
> I will try again but i can't get the bnk and modulation messages to work.
>
> switch (message[0] & 0xf0) {
> case 0x80: // NoteOff: 8n kk vv
> synth.noteOff(channel, message[1], message[2]);
> break;
> case 0x90: // NoteOn: 9n kk vv
> if (message[2] > 0) {
> synth.noteOn(channel, message[1], message[2]);
> } else {
> synth.noteOff(channel, message[1], 0);
> }
> break;
> case 0xB0: // Control Change: Bn cc dd
> /** @type {number} */
> const value = message[2];
> switch (message[1]) {
> case 0x00: // Bank Select MSB: Bn 00 dd
> synth.bankSelectMsb(channel, value);
> break;
> case 0x01: // Modulation Depth
> synth.modulationDepth(channel, value);
> break;
> case 0x05: // Portament Time
> break;
> case 0x06: // Data Entry(MSB): Bn 06 dd
> if (this.rpnMode) {
> // RPN
> switch (this.RpnMsb[channel]) {
> case 0:
> switch (this.RpnLsb[channel]) {
> case 0: // Pitch Bend Sensitivity
> synth.pitchBendSensitivity(channel, value);
> break;
> case 1:
> // console.log("fine");
> break;
> case 2:
> // console.log("coarse");
> break;
> default:
> // console.log("default");
> break;
> }
> break;
> default:
> // console.log("default:", this.RpnMsb[channel], this.RpnLsb[channel]);
> break;
> }

I think there is something very strange i can not quite wrap my head on with web midi link external synth calls, to me it seem what should be sent over net, rather should be a byte length?
The function names are not sent as parameter anyway

So one could just have 3 type of calls/function "3 byte calls", ""2 byte calls" and "sysex calls of variable length?".
The decomposition is done on the receiver side anyway????

Here is my sender, i practically send all CC over noteOn problem is bankchanges and modulation do not work and i do not understand why?

var synth = new Synth();
//To string 16 converts number to hexadecimal value
function Synth() {
this.sy = null;
this.Load = function(url) {
this.sy = window.open(url, "extSynth", "width=700,height=700,scrollbars=yes,resizable=yes");
this.sy.focus();
}
this.NoteOn = function(SFM,note, velo) {
SFM=parseInt(SFM);
note=parseInt(note);
velo=parseInt(velo);
this.SendMessage(this.sy, "midi,"+SFM.toString(16)+"," + note.toString(16) + "," + velo.toString(16));
}
this.NoteOff = function(SFM,note) {
SFM=parseInt(SFM);
note=parseInt(note);
this.SendMessage(this.sy, "midi,"+SFM.toString(16)+","+ note.toString(16) + ",0");
}
this.PGMchange = function(SFchan,SFprg) {
SFprg=parseInt(SFprg);
SFchan=parseInt(SFchan);
this.SendMessage(this.sy, "midi,"+SFchan.toString(16)+","+SFprg.toString(16));
}
//////////Is PGMchange above not same message "type, not content" as noteOff two bytes sent?//////////////////////////////////
/////////////////////////////////////////////////////////////////////////WHY SHOULD THESE FUNCTIONS BE NEEDED///////////////////////////////
///////////////////////////////////////Or are the function calls somehow passed as argument over net???//////////////////////////////////
/////////////////////////////////////If so i should probably name them correct, but i don't think they are?///////////////////////////////////
this.MODchange = function(SFchan,SFval) {
SFchan=parseInt(SFchan);
SFval=parseInt(SFval);
this.SendMessage(this.sy, "midi,"+SFchan.toString(16)+","+SFval.toString(16));
}
this.BNKchange = function(SFchan,SFbnk) {
SFchan=parseInt(SFchan);
SFval=parseInt(SFbnk);
this.SendMessage(this.sy, "midi,"+SFchan.toString(16)+","+SFbnk.toString(16));
}
/////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////
/////////////////////////////////This is another type of message 1byte, probably could named it anything or????////////////////////
this.AllSoundOff = function(offCh) {
offCh=parseInt(offCh);
this.SendMessage(this.sy, "midi,"+offCh.toString(16));
}

this.SendMessage = function(sy, s) {
if(this.sy)
this.sy.postMessage(s, "*");
}
}

Re: Building midi message for a software synth

<2f9df51d-3949-4b6e-8fdb-2c252e93f34cn@googlegroups.com>

  copy mid

https://www.rocksolidbbs.com/devel/article-flat.php?id=17124&group=comp.lang.javascript#17124

  copy link   Newsgroups: comp.lang.javascript
X-Received: by 2002:a37:59c7:: with SMTP id n190mr6532069qkb.146.1624550848810; Thu, 24 Jun 2021 09:07:28 -0700 (PDT)
X-Received: by 2002:a05:6808:15a7:: with SMTP id t39mr4540048oiw.176.1624550848548; Thu, 24 Jun 2021 09:07:28 -0700 (PDT)
Path: i2pn2.org!i2pn.org!paganini.bofh.team!news.dns-netz.com!news.freedyn.net!newsfeed.xs4all.nl!newsfeed7.news.xs4all.nl!tr1.eu1.usenetexpress.com!feeder.usenetexpress.com!tr1.iad1.usenetexpress.com!border1.nntp.dca1.giganews.com!nntp.giganews.com!news-out.google.com!nntp.google.com!postnews.google.com!google-groups.googlegroups.com!not-for-mail
Newsgroups: comp.lang.javascript
Date: Thu, 24 Jun 2021 09:07:28 -0700 (PDT)
In-Reply-To: <bfa16d76-b90e-4ab2-a945-02b68b5c51aen@googlegroups.com>
Injection-Info: google-groups.googlegroups.com; posting-host=84.217.163.187; posting-account=kxPkPAoAAACjJi8w0gL9bnyznPzdw9HW
NNTP-Posting-Host: 84.217.163.187
References: <419b4226-1b11-48ca-b1eb-4a3cbf9664e2n@googlegroups.com> <bfa16d76-b90e-4ab2-a945-02b68b5c51aen@googlegroups.com>
User-Agent: G2/1.0
MIME-Version: 1.0
Message-ID: <2f9df51d-3949-4b6e-8fdb-2c252e93f34cn@googlegroups.com>
Subject: Re: Building midi message for a software synth
From: jonas.thornvall@gmail.com (Jonas Thörnvall)
Injection-Date: Thu, 24 Jun 2021 16:07:28 +0000
Content-Type: text/plain; charset="UTF-8"
Content-Transfer-Encoding: quoted-printable
Lines: 178
 by: Jonas Thörnvall - Thu, 24 Jun 2021 16:07 UTC

torsdag 24 juni 2021 kl. 15:35:33 UTC+2 skrev Jonas Thörnvall:
> torsdag 24 juni 2021 kl. 15:07:40 UTC+2 skrev Jonas Thörnvall:
> > I am building midi messages "interfacing" a software synth. But i am so terrible reading others codes so i am not sure i understand it correct.
> >
> > Isn't the bank and modulation messages just checking if byte 1 equal 176 and byte 2 equal 1 if so one should call the modulation function and if byte 2 equal 0 one should call the bnk function?
> >
> > I will try again but i can't get the bnk and modulation messages to work.
> >
> > switch (message[0] & 0xf0) {
> > case 0x80: // NoteOff: 8n kk vv
> > synth.noteOff(channel, message[1], message[2]);
> > break;
> > case 0x90: // NoteOn: 9n kk vv
> > if (message[2] > 0) {
> > synth.noteOn(channel, message[1], message[2]);
> > } else {
> > synth.noteOff(channel, message[1], 0);
> > }
> > break;
> > case 0xB0: // Control Change: Bn cc dd
> > /** @type {number} */
> > const value = message[2];
> > switch (message[1]) {
> > case 0x00: // Bank Select MSB: Bn 00 dd
> > synth.bankSelectMsb(channel, value);
> > break;
> > case 0x01: // Modulation Depth
> > synth.modulationDepth(channel, value);
> > break;
> > case 0x05: // Portament Time
> > break;
> > case 0x06: // Data Entry(MSB): Bn 06 dd
> > if (this.rpnMode) {
> > // RPN
> > switch (this.RpnMsb[channel]) {
> > case 0:
> > switch (this.RpnLsb[channel]) {
> > case 0: // Pitch Bend Sensitivity
> > synth.pitchBendSensitivity(channel, value);
> > break;
> > case 1:
> > // console.log("fine");
> > break;
> > case 2:
> > // console.log("coarse");
> > break;
> > default:
> > // console.log("default");
> > break;
> > }
> > break;
> > default:
> > // console.log("default:", this.RpnMsb[channel], this.RpnLsb[channel]);
> > break;
> > }
> I think there is something very strange i can not quite wrap my head on with web midi link external synth calls, to me it seem what should be sent over net, rather should be a byte length?
> The function names are not sent as parameter anyway
>
> So one could just have 3 type of calls/function "3 byte calls", ""2 byte calls" and "sysex calls of variable length?".
> The decomposition is done on the receiver side anyway????
>
> Here is my sender, i practically send all CC over noteOn problem is bankchanges and modulation do not work and i do not understand why?
>
> var synth = new Synth();
> //To string 16 converts number to hexadecimal value
> function Synth() {
> this.sy = null;
> this.Load = function(url) {
> this.sy = window.open(url, "extSynth", "width=700,height=700,scrollbars=yes,resizable=yes");
> this.sy.focus();
> }
> this.NoteOn = function(SFM,note, velo) {
> SFM=parseInt(SFM);
> note=parseInt(note);
> velo=parseInt(velo);
> this.SendMessage(this.sy, "midi,"+SFM.toString(16)+"," + note.toString(16) + "," + velo.toString(16));
> }
> this.NoteOff = function(SFM,note) {
> SFM=parseInt(SFM);
> note=parseInt(note);
> this.SendMessage(this.sy, "midi,"+SFM.toString(16)+","+ note.toString(16) + ",0");
> }
> this.PGMchange = function(SFchan,SFprg) {
> SFprg=parseInt(SFprg);
> SFchan=parseInt(SFchan);
> this.SendMessage(this.sy, "midi,"+SFchan.toString(16)+","+SFprg.toString(16));
> }
> //////////Is PGMchange above not same message "type, not content" as noteOff two bytes sent?//////////////////////////////////
> /////////////////////////////////////////////////////////////////////////WHY SHOULD THESE FUNCTIONS BE NEEDED///////////////////////////////
> ///////////////////////////////////////Or are the function calls somehow passed as argument over net???//////////////////////////////////
> /////////////////////////////////////If so i should probably name them correct, but i don't think they are?///////////////////////////////////
> this.MODchange = function(SFchan,SFval) {
> SFchan=parseInt(SFchan);
> SFval=parseInt(SFval);
> this.SendMessage(this.sy, "midi,"+SFchan.toString(16)+","+SFval.toString(16));
> }
> this.BNKchange = function(SFchan,SFbnk) {
> SFchan=parseInt(SFchan);
> SFval=parseInt(SFbnk);
> this.SendMessage(this.sy, "midi,"+SFchan.toString(16)+","+SFbnk.toString(16));
> }
> /////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////
> /////////////////////////////////This is another type of message 1byte, probably could named it anything or????////////////////////
> this.AllSoundOff = function(offCh) {
> offCh=parseInt(offCh);
> this.SendMessage(this.sy, "midi,"+offCh.toString(16));
> }
>
> this.SendMessage = function(sy, s) {
> if(this.sy)
> this.sy.postMessage(s, "*");
> }
> }
If someone want to try send a bankchange message.
Here is how you invoke the synth.
synth.Load('https://logue.dev/smfplayer.js/wml.html');
And here is the actual sender of messages to the synth.
Notes, programs and CCmessages seems to work but can't get CC modulation to respond, and sustain that should be a range 0-127 seems to be implemented as a binary state on and off.

But the most important thing to get working is bankchange, and i can not make it work.

var synth = new Synth();
//To string 16 converts number to hexadecimal value
function Synth() {
this.sy = null;
this.Load = function(url) {
this.sy = window.open(url, "extSynth", "width=700,height=700,scrollbars=yes,resizable=yes");
this.sy.focus();
}
this.NoteOn = function(SFM,note, velo) {
SFM=parseInt(SFM);
note=parseInt(note);
velo=parseInt(velo);
this.SendMessage(this.sy, "midi,"+SFM.toString(16)+"," + note.toString(16) + "," + velo.toString(16));
}
this.NoteOff = function(SFM,note) {
SFM=parseInt(SFM);
note=parseInt(note);
this.SendMessage(this.sy, "midi,"+SFM.toString(16)+","+ note.toString(16) + ",0");
}
this.PGMchange = function(SFchan,SFprg) {
SFprg=parseInt(SFprg);
SFchan=parseInt(SFchan);
this.SendMessage(this.sy, "midi,"+SFchan.toString(16)+","+SFprg.toString(16));
}
this.SendMessage = function(sy, s) {
if(this.sy)
this.sy.postMessage(s, "*");
}
}

Re: Building midi message for a software synth

<7594c976-2202-40c4-8a34-70ad6ff73bcan@googlegroups.com>

  copy mid

https://www.rocksolidbbs.com/devel/article-flat.php?id=17125&group=comp.lang.javascript#17125

  copy link   Newsgroups: comp.lang.javascript
X-Received: by 2002:ad4:4e94:: with SMTP id dy20mr7604754qvb.49.1624568411232;
Thu, 24 Jun 2021 14:00:11 -0700 (PDT)
X-Received: by 2002:a05:6808:144b:: with SMTP id x11mr2952156oiv.50.1624568411007;
Thu, 24 Jun 2021 14:00:11 -0700 (PDT)
Path: i2pn2.org!i2pn.org!weretis.net!feeder8.news.weretis.net!proxad.net!feeder1-2.proxad.net!209.85.160.216.MISMATCH!news-out.google.com!nntp.google.com!postnews.google.com!google-groups.googlegroups.com!not-for-mail
Newsgroups: comp.lang.javascript
Date: Thu, 24 Jun 2021 14:00:10 -0700 (PDT)
In-Reply-To: <2f9df51d-3949-4b6e-8fdb-2c252e93f34cn@googlegroups.com>
Injection-Info: google-groups.googlegroups.com; posting-host=84.217.163.187; posting-account=kxPkPAoAAACjJi8w0gL9bnyznPzdw9HW
NNTP-Posting-Host: 84.217.163.187
References: <419b4226-1b11-48ca-b1eb-4a3cbf9664e2n@googlegroups.com>
<bfa16d76-b90e-4ab2-a945-02b68b5c51aen@googlegroups.com> <2f9df51d-3949-4b6e-8fdb-2c252e93f34cn@googlegroups.com>
User-Agent: G2/1.0
MIME-Version: 1.0
Message-ID: <7594c976-2202-40c4-8a34-70ad6ff73bcan@googlegroups.com>
Subject: Re: Building midi message for a software synth
From: jonas.thornvall@gmail.com (Jonas Thörnvall)
Injection-Date: Thu, 24 Jun 2021 21:00:11 +0000
Content-Type: text/plain; charset="UTF-8"
Content-Transfer-Encoding: quoted-printable
 by: Jonas Thörnvall - Thu, 24 Jun 2021 21:00 UTC

torsdag 24 juni 2021 kl. 18:07:33 UTC+2 skrev Jonas Thörnvall:
> torsdag 24 juni 2021 kl. 15:35:33 UTC+2 skrev Jonas Thörnvall:
> > torsdag 24 juni 2021 kl. 15:07:40 UTC+2 skrev Jonas Thörnvall:
> > > I am building midi messages "interfacing" a software synth. But i am so terrible reading others codes so i am not sure i understand it correct.
> > >
> > > Isn't the bank and modulation messages just checking if byte 1 equal 176 and byte 2 equal 1 if so one should call the modulation function and if byte 2 equal 0 one should call the bnk function?
> > >
> > > I will try again but i can't get the bnk and modulation messages to work.
> > >
> > > switch (message[0] & 0xf0) {
> > > case 0x80: // NoteOff: 8n kk vv
> > > synth.noteOff(channel, message[1], message[2]);
> > > break;
> > > case 0x90: // NoteOn: 9n kk vv
> > > if (message[2] > 0) {
> > > synth.noteOn(channel, message[1], message[2]);
> > > } else {
> > > synth.noteOff(channel, message[1], 0);
> > > }
> > > break;
> > > case 0xB0: // Control Change: Bn cc dd
> > > /** @type {number} */
> > > const value = message[2];
> > > switch (message[1]) {
> > > case 0x00: // Bank Select MSB: Bn 00 dd
> > > synth.bankSelectMsb(channel, value);
> > > break;
> > > case 0x01: // Modulation Depth
> > > synth.modulationDepth(channel, value);
> > > break;
> > > case 0x05: // Portament Time
> > > break;
> > > case 0x06: // Data Entry(MSB): Bn 06 dd
> > > if (this.rpnMode) {
> > > // RPN
> > > switch (this.RpnMsb[channel]) {
> > > case 0:
> > > switch (this.RpnLsb[channel]) {
> > > case 0: // Pitch Bend Sensitivity
> > > synth.pitchBendSensitivity(channel, value);
> > > break;
> > > case 1:
> > > // console.log("fine");
> > > break;
> > > case 2:
> > > // console.log("coarse");
> > > break;
> > > default:
> > > // console.log("default");
> > > break;
> > > }
> > > break;
> > > default:
> > > // console.log("default:", this.RpnMsb[channel], this.RpnLsb[channel]);
> > > break;
> > > }
> > I think there is something very strange i can not quite wrap my head on with web midi link external synth calls, to me it seem what should be sent over net, rather should be a byte length?
> > The function names are not sent as parameter anyway
> >
> > So one could just have 3 type of calls/function "3 byte calls", ""2 byte calls" and "sysex calls of variable length?".
> > The decomposition is done on the receiver side anyway????
> >
> > Here is my sender, i practically send all CC over noteOn problem is bankchanges and modulation do not work and i do not understand why?
> >
> > var synth = new Synth();
> > //To string 16 converts number to hexadecimal value
> > function Synth() {
> > this.sy = null;
> > this.Load = function(url) {
> > this.sy = window.open(url, "extSynth", "width=700,height=700,scrollbars=yes,resizable=yes");
> > this.sy.focus();
> > }
> > this.NoteOn = function(SFM,note, velo) {
> > SFM=parseInt(SFM);
> > note=parseInt(note);
> > velo=parseInt(velo);
> > this.SendMessage(this.sy, "midi,"+SFM.toString(16)+"," + note.toString(16) + "," + velo.toString(16));
> > }
> > this.NoteOff = function(SFM,note) {
> > SFM=parseInt(SFM);
> > note=parseInt(note);
> > this.SendMessage(this.sy, "midi,"+SFM.toString(16)+","+ note.toString(16) + ",0");
> > }
> > this.PGMchange = function(SFchan,SFprg) {
> > SFprg=parseInt(SFprg);
> > SFchan=parseInt(SFchan);
> > this.SendMessage(this.sy, "midi,"+SFchan.toString(16)+","+SFprg.toString(16));
> > }
> > //////////Is PGMchange above not same message "type, not content" as noteOff two bytes sent?//////////////////////////////////
> > /////////////////////////////////////////////////////////////////////////WHY SHOULD THESE FUNCTIONS BE NEEDED///////////////////////////////
> > ///////////////////////////////////////Or are the function calls somehow passed as argument over net???//////////////////////////////////
> > /////////////////////////////////////If so i should probably name them correct, but i don't think they are?///////////////////////////////////
> > this.MODchange = function(SFchan,SFval) {
> > SFchan=parseInt(SFchan);
> > SFval=parseInt(SFval);
> > this.SendMessage(this.sy, "midi,"+SFchan.toString(16)+","+SFval.toString(16));
> > }
> > this.BNKchange = function(SFchan,SFbnk) {
> > SFchan=parseInt(SFchan);
> > SFval=parseInt(SFbnk);
> > this.SendMessage(this.sy, "midi,"+SFchan.toString(16)+","+SFbnk.toString(16));
> > }
> > /////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////
> > /////////////////////////////////This is another type of message 1byte, probably could named it anything or????////////////////////
> > this.AllSoundOff = function(offCh) {
> > offCh=parseInt(offCh);
> > this.SendMessage(this.sy, "midi,"+offCh.toString(16));
> > }
> >
> > this.SendMessage = function(sy, s) {
> > if(this.sy)
> > this.sy.postMessage(s, "*");
> > }
> > }
> If someone want to try send a bankchange message.
> Here is how you invoke the synth.
> synth.Load('https://logue.dev/smfplayer.js/wml.html');
> And here is the actual sender of messages to the synth.
> Notes, programs and CCmessages seems to work but can't get CC modulation to respond, and sustain that should be a range 0-127 seems to be implemented as a binary state on and off.
>
> But the most important thing to get working is bankchange, and i can not make it work.
> var synth = new Synth();
> //To string 16 converts number to hexadecimal value
> function Synth() {
> this.sy = null;
> this.Load = function(url) {
> this.sy = window.open(url, "extSynth", "width=700,height=700,scrollbars=yes,resizable=yes");
> this.sy.focus();
> }
> this.NoteOn = function(SFM,note, velo) {
> SFM=parseInt(SFM);
> note=parseInt(note);
> velo=parseInt(velo);
> this.SendMessage(this.sy, "midi,"+SFM.toString(16)+"," + note.toString(16) + "," + velo.toString(16));
> }
> this.NoteOff = function(SFM,note) {
> SFM=parseInt(SFM);
> note=parseInt(note);
> this.SendMessage(this.sy, "midi,"+SFM.toString(16)+","+ note.toString(16) + ",0");
> }
> this.PGMchange = function(SFchan,SFprg) {
> SFprg=parseInt(SFprg);
> SFchan=parseInt(SFchan);
> this.SendMessage(this.sy, "midi,"+SFchan.toString(16)+","+SFprg.toString(16));
> }
> this.SendMessage = function(sy, s) {
> if(this.sy)
> this.sy.postMessage(s, "*");
> }
> }
Give it a go on my phoneserver so no SSL
https://84.217.163.187:80/

Re: Building midi message for a software synth

<sb4gai$5sa$1@solani.org>

  copy mid

https://www.rocksolidbbs.com/devel/article-flat.php?id=17128&group=comp.lang.javascript#17128

  copy link   Newsgroups: comp.lang.javascript
Path: i2pn2.org!i2pn.org!weretis.net!feeder8.news.weretis.net!feeder5.news.weretis.net!news.solani.org!.POSTED!not-for-mail
From: janburse@fastmail.fm (Mostowski Collapse)
Newsgroups: comp.lang.javascript
Subject: Re: Building midi message for a software synth
Date: Fri, 25 Jun 2021 13:57:06 +0200
Message-ID: <sb4gai$5sa$1@solani.org>
References: <419b4226-1b11-48ca-b1eb-4a3cbf9664e2n@googlegroups.com>
<bfa16d76-b90e-4ab2-a945-02b68b5c51aen@googlegroups.com>
<2f9df51d-3949-4b6e-8fdb-2c252e93f34cn@googlegroups.com>
<7594c976-2202-40c4-8a34-70ad6ff73bcan@googlegroups.com>
Mime-Version: 1.0
Content-Type: text/plain; charset=UTF-8; format=flowed
Content-Transfer-Encoding: 8bit
Injection-Date: Fri, 25 Jun 2021 11:57:06 -0000 (UTC)
Injection-Info: solani.org;
logging-data="6026"; mail-complaints-to="abuse@news.solani.org"
User-Agent: Mozilla/5.0 (Macintosh; Intel Mac OS X 10.16; rv:60.0)
Gecko/20100101 Firefox/60.0 SeaMonkey/2.53.8
Cancel-Lock: sha1:/Icg5E/rFHhjtYcsN1N8SMlLSLk=
X-User-ID: eJwNx8EBwCAIA8CVSk0gjAMq+4/Q3u+43HwHnA4OZzH1aiDU3VetzT4KRf035nNcMGJQDLdzLurtZnZ2h+cHVToVtg==
In-Reply-To: <7594c976-2202-40c4-8a34-70ad6ff73bcan@googlegroups.com>
 by: Mostowski Collapse - Fri, 25 Jun 2021 11:57 UTC

Is there something in it for you?
https://www.w3.org/TR/2021/REC-webaudio-20210617/

Jonas Thörnvall schrieb:
> torsdag 24 juni 2021 kl. 18:07:33 UTC+2 skrev Jonas Thörnvall:
>> torsdag 24 juni 2021 kl. 15:35:33 UTC+2 skrev Jonas Thörnvall:
>>> torsdag 24 juni 2021 kl. 15:07:40 UTC+2 skrev Jonas Thörnvall:
>>>> I am building midi messages "interfacing" a software synth. But i am so terrible reading others codes so i am not sure i understand it correct.
>>>>
>>>> Isn't the bank and modulation messages just checking if byte 1 equal 176 and byte 2 equal 1 if so one should call the modulation function and if byte 2 equal 0 one should call the bnk function?
>>>>
>>>> I will try again but i can't get the bnk and modulation messages to work.
>>>>
>>>> switch (message[0] & 0xf0) {
>>>> case 0x80: // NoteOff: 8n kk vv
>>>> synth.noteOff(channel, message[1], message[2]);
>>>> break;
>>>> case 0x90: // NoteOn: 9n kk vv
>>>> if (message[2] > 0) {
>>>> synth.noteOn(channel, message[1], message[2]);
>>>> } else {
>>>> synth.noteOff(channel, message[1], 0);
>>>> }
>>>> break;
>>>> case 0xB0: // Control Change: Bn cc dd
>>>> /** @type {number} */
>>>> const value = message[2];
>>>> switch (message[1]) {
>>>> case 0x00: // Bank Select MSB: Bn 00 dd
>>>> synth.bankSelectMsb(channel, value);
>>>> break;
>>>> case 0x01: // Modulation Depth
>>>> synth.modulationDepth(channel, value);
>>>> break;
>>>> case 0x05: // Portament Time
>>>> break;
>>>> case 0x06: // Data Entry(MSB): Bn 06 dd
>>>> if (this.rpnMode) {
>>>> // RPN
>>>> switch (this.RpnMsb[channel]) {
>>>> case 0:
>>>> switch (this.RpnLsb[channel]) {
>>>> case 0: // Pitch Bend Sensitivity
>>>> synth.pitchBendSensitivity(channel, value);
>>>> break;
>>>> case 1:
>>>> // console.log("fine");
>>>> break;
>>>> case 2:
>>>> // console.log("coarse");
>>>> break;
>>>> default:
>>>> // console.log("default");
>>>> break;
>>>> }
>>>> break;
>>>> default:
>>>> // console.log("default:", this.RpnMsb[channel], this.RpnLsb[channel]);
>>>> break;
>>>> }
>>> I think there is something very strange i can not quite wrap my head on with web midi link external synth calls, to me it seem what should be sent over net, rather should be a byte length?
>>> The function names are not sent as parameter anyway
>>>
>>> So one could just have 3 type of calls/function "3 byte calls", ""2 byte calls" and "sysex calls of variable length?".
>>> The decomposition is done on the receiver side anyway????
>>>
>>> Here is my sender, i practically send all CC over noteOn problem is bankchanges and modulation do not work and i do not understand why?
>>>
>>> var synth = new Synth();
>>> //To string 16 converts number to hexadecimal value
>>> function Synth() {
>>> this.sy = null;
>>> this.Load = function(url) {
>>> this.sy = window.open(url, "extSynth", "width=700,height=700,scrollbars=yes,resizable=yes");
>>> this.sy.focus();
>>> }
>>> this.NoteOn = function(SFM,note, velo) {
>>> SFM=parseInt(SFM);
>>> note=parseInt(note);
>>> velo=parseInt(velo);
>>> this.SendMessage(this.sy, "midi,"+SFM.toString(16)+"," + note.toString(16) + "," + velo.toString(16));
>>> }
>>> this.NoteOff = function(SFM,note) {
>>> SFM=parseInt(SFM);
>>> note=parseInt(note);
>>> this.SendMessage(this.sy, "midi,"+SFM.toString(16)+","+ note.toString(16) + ",0");
>>> }
>>> this.PGMchange = function(SFchan,SFprg) {
>>> SFprg=parseInt(SFprg);
>>> SFchan=parseInt(SFchan);
>>> this.SendMessage(this.sy, "midi,"+SFchan.toString(16)+","+SFprg.toString(16));
>>> }
>>> //////////Is PGMchange above not same message "type, not content" as noteOff two bytes sent?//////////////////////////////////
>>> /////////////////////////////////////////////////////////////////////////WHY SHOULD THESE FUNCTIONS BE NEEDED///////////////////////////////
>>> ///////////////////////////////////////Or are the function calls somehow passed as argument over net???//////////////////////////////////
>>> /////////////////////////////////////If so i should probably name them correct, but i don't think they are?///////////////////////////////////
>>> this.MODchange = function(SFchan,SFval) {
>>> SFchan=parseInt(SFchan);
>>> SFval=parseInt(SFval);
>>> this.SendMessage(this.sy, "midi,"+SFchan.toString(16)+","+SFval.toString(16));
>>> }
>>> this.BNKchange = function(SFchan,SFbnk) {
>>> SFchan=parseInt(SFchan);
>>> SFval=parseInt(SFbnk);
>>> this.SendMessage(this.sy, "midi,"+SFchan.toString(16)+","+SFbnk.toString(16));
>>> }
>>> /////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////
>>> /////////////////////////////////This is another type of message 1byte, probably could named it anything or????////////////////////
>>> this.AllSoundOff = function(offCh) {
>>> offCh=parseInt(offCh);
>>> this.SendMessage(this.sy, "midi,"+offCh.toString(16));
>>> }
>>>
>>> this.SendMessage = function(sy, s) {
>>> if(this.sy)
>>> this.sy.postMessage(s, "*");
>>> }
>>> }
>> If someone want to try send a bankchange message.
>> Here is how you invoke the synth.
>> synth.Load('https://logue.dev/smfplayer.js/wml.html');
>> And here is the actual sender of messages to the synth.
>> Notes, programs and CCmessages seems to work but can't get CC modulation to respond, and sustain that should be a range 0-127 seems to be implemented as a binary state on and off.
>>
>> But the most important thing to get working is bankchange, and i can not make it work.
>> var synth = new Synth();
>> //To string 16 converts number to hexadecimal value
>> function Synth() {
>> this.sy = null;
>> this.Load = function(url) {
>> this.sy = window.open(url, "extSynth", "width=700,height=700,scrollbars=yes,resizable=yes");
>> this.sy.focus();
>> }
>> this.NoteOn = function(SFM,note, velo) {
>> SFM=parseInt(SFM);
>> note=parseInt(note);
>> velo=parseInt(velo);
>> this.SendMessage(this.sy, "midi,"+SFM.toString(16)+"," + note.toString(16) + "," + velo.toString(16));
>> }
>> this.NoteOff = function(SFM,note) {
>> SFM=parseInt(SFM);
>> note=parseInt(note);
>> this.SendMessage(this.sy, "midi,"+SFM.toString(16)+","+ note.toString(16) + ",0");
>> }
>> this.PGMchange = function(SFchan,SFprg) {
>> SFprg=parseInt(SFprg);
>> SFchan=parseInt(SFchan);
>> this.SendMessage(this.sy, "midi,"+SFchan.toString(16)+","+SFprg.toString(16));
>> }
>> this.SendMessage = function(sy, s) {
>> if(this.sy)
>> this.sy.postMessage(s, "*");
>> }
>> }
> Give it a go on my phoneserver so no SSL
> https://84.217.163.187:80/
>

Re: Building midi message for a software synth

<de9322c6-876f-43eb-a2fe-f51324dcbbd2n@googlegroups.com>

  copy mid

https://www.rocksolidbbs.com/devel/article-flat.php?id=17130&group=comp.lang.javascript#17130

  copy link   Newsgroups: comp.lang.javascript
X-Received: by 2002:a0c:80ec:: with SMTP id 99mr12279985qvb.55.1624644697147; Fri, 25 Jun 2021 11:11:37 -0700 (PDT)
X-Received: by 2002:a05:6830:148d:: with SMTP id s13mr10663922otq.239.1624644696875; Fri, 25 Jun 2021 11:11:36 -0700 (PDT)
Path: i2pn2.org!i2pn.org!weretis.net!feeder8.news.weretis.net!feeder1.feed.usenet.farm!feed.usenet.farm!tr2.eu1.usenetexpress.com!feeder.usenetexpress.com!tr2.iad1.usenetexpress.com!border1.nntp.dca1.giganews.com!nntp.giganews.com!news-out.google.com!nntp.google.com!postnews.google.com!google-groups.googlegroups.com!not-for-mail
Newsgroups: comp.lang.javascript
Date: Fri, 25 Jun 2021 11:11:36 -0700 (PDT)
In-Reply-To: <sb4gai$5sa$1@solani.org>
Injection-Info: google-groups.googlegroups.com; posting-host=84.217.163.187; posting-account=kxPkPAoAAACjJi8w0gL9bnyznPzdw9HW
NNTP-Posting-Host: 84.217.163.187
References: <419b4226-1b11-48ca-b1eb-4a3cbf9664e2n@googlegroups.com> <bfa16d76-b90e-4ab2-a945-02b68b5c51aen@googlegroups.com> <2f9df51d-3949-4b6e-8fdb-2c252e93f34cn@googlegroups.com> <7594c976-2202-40c4-8a34-70ad6ff73bcan@googlegroups.com> <sb4gai$5sa$1@solani.org>
User-Agent: G2/1.0
MIME-Version: 1.0
Message-ID: <de9322c6-876f-43eb-a2fe-f51324dcbbd2n@googlegroups.com>
Subject: Re: Building midi message for a software synth
From: jonas.thornvall@gmail.com (Jonas Thörnvall)
Injection-Date: Fri, 25 Jun 2021 18:11:37 +0000
Content-Type: text/plain; charset="UTF-8"
Content-Transfer-Encoding: quoted-printable
Lines: 191
 by: Jonas Thörnvall - Fri, 25 Jun 2021 18:11 UTC

fredag 25 juni 2021 kl. 13:57:16 UTC+2 skrev Mostowski Collapse:
> Is there something in it for you?
> https://www.w3.org/TR/2021/REC-webaudio-20210617/
>
> Jonas Thörnvall schrieb:
> > torsdag 24 juni 2021 kl. 18:07:33 UTC+2 skrev Jonas Thörnvall:
> >> torsdag 24 juni 2021 kl. 15:35:33 UTC+2 skrev Jonas Thörnvall:
> >>> torsdag 24 juni 2021 kl. 15:07:40 UTC+2 skrev Jonas Thörnvall:
> >>>> I am building midi messages "interfacing" a software synth. But i am so terrible reading others codes so i am not sure i understand it correct.
> >>>>
> >>>> Isn't the bank and modulation messages just checking if byte 1 equal 176 and byte 2 equal 1 if so one should call the modulation function and if byte 2 equal 0 one should call the bnk function?
> >>>>
> >>>> I will try again but i can't get the bnk and modulation messages to work.
> >>>>
> >>>> switch (message[0] & 0xf0) {
> >>>> case 0x80: // NoteOff: 8n kk vv
> >>>> synth.noteOff(channel, message[1], message[2]);
> >>>> break;
> >>>> case 0x90: // NoteOn: 9n kk vv
> >>>> if (message[2] > 0) {
> >>>> synth.noteOn(channel, message[1], message[2]);
> >>>> } else {
> >>>> synth.noteOff(channel, message[1], 0);
> >>>> }
> >>>> break;
> >>>> case 0xB0: // Control Change: Bn cc dd
> >>>> /** @type {number} */
> >>>> const value = message[2];
> >>>> switch (message[1]) {
> >>>> case 0x00: // Bank Select MSB: Bn 00 dd
> >>>> synth.bankSelectMsb(channel, value);
> >>>> break;
> >>>> case 0x01: // Modulation Depth
> >>>> synth.modulationDepth(channel, value);
> >>>> break;
> >>>> case 0x05: // Portament Time
> >>>> break;
> >>>> case 0x06: // Data Entry(MSB): Bn 06 dd
> >>>> if (this.rpnMode) {
> >>>> // RPN
> >>>> switch (this.RpnMsb[channel]) {
> >>>> case 0:
> >>>> switch (this.RpnLsb[channel]) {
> >>>> case 0: // Pitch Bend Sensitivity
> >>>> synth.pitchBendSensitivity(channel, value);
> >>>> break;
> >>>> case 1:
> >>>> // console.log("fine");
> >>>> break;
> >>>> case 2:
> >>>> // console.log("coarse");
> >>>> break;
> >>>> default:
> >>>> // console.log("default");
> >>>> break;
> >>>> }
> >>>> break;
> >>>> default:
> >>>> // console.log("default:", this.RpnMsb[channel], this.RpnLsb[channel]);
> >>>> break;
> >>>> }
> >>> I think there is something very strange i can not quite wrap my head on with web midi link external synth calls, to me it seem what should be sent over net, rather should be a byte length?
> >>> The function names are not sent as parameter anyway
> >>>
> >>> So one could just have 3 type of calls/function "3 byte calls", ""2 byte calls" and "sysex calls of variable length?".
> >>> The decomposition is done on the receiver side anyway????
> >>>
> >>> Here is my sender, i practically send all CC over noteOn problem is bankchanges and modulation do not work and i do not understand why?
> >>>
> >>> var synth = new Synth();
> >>> //To string 16 converts number to hexadecimal value
> >>> function Synth() {
> >>> this.sy = null;
> >>> this.Load = function(url) {
> >>> this.sy = window.open(url, "extSynth", "width=700,height=700,scrollbars=yes,resizable=yes");
> >>> this.sy.focus();
> >>> }
> >>> this.NoteOn = function(SFM,note, velo) {
> >>> SFM=parseInt(SFM);
> >>> note=parseInt(note);
> >>> velo=parseInt(velo);
> >>> this.SendMessage(this.sy, "midi,"+SFM.toString(16)+"," + note.toString(16) + "," + velo.toString(16));
> >>> }
> >>> this.NoteOff = function(SFM,note) {
> >>> SFM=parseInt(SFM);
> >>> note=parseInt(note);
> >>> this.SendMessage(this.sy, "midi,"+SFM.toString(16)+","+ note.toString(16) + ",0");
> >>> }
> >>> this.PGMchange = function(SFchan,SFprg) {
> >>> SFprg=parseInt(SFprg);
> >>> SFchan=parseInt(SFchan);
> >>> this.SendMessage(this.sy, "midi,"+SFchan.toString(16)+","+SFprg.toString(16));
> >>> }
> >>> //////////Is PGMchange above not same message "type, not content" as noteOff two bytes sent?//////////////////////////////////
> >>> /////////////////////////////////////////////////////////////////////////WHY SHOULD THESE FUNCTIONS BE NEEDED///////////////////////////////
> >>> ///////////////////////////////////////Or are the function calls somehow passed as argument over net???//////////////////////////////////
> >>> /////////////////////////////////////If so i should probably name them correct, but i don't think they are?///////////////////////////////////
> >>> this.MODchange = function(SFchan,SFval) {
> >>> SFchan=parseInt(SFchan);
> >>> SFval=parseInt(SFval);
> >>> this.SendMessage(this.sy, "midi,"+SFchan.toString(16)+","+SFval.toString(16));
> >>> }
> >>> this.BNKchange = function(SFchan,SFbnk) {
> >>> SFchan=parseInt(SFchan);
> >>> SFval=parseInt(SFbnk);
> >>> this.SendMessage(this.sy, "midi,"+SFchan.toString(16)+","+SFbnk.toString(16));
> >>> }
> >>> /////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////
> >>> /////////////////////////////////This is another type of message 1byte, probably could named it anything or????////////////////////
> >>> this.AllSoundOff = function(offCh) {
> >>> offCh=parseInt(offCh);
> >>> this.SendMessage(this.sy, "midi,"+offCh.toString(16));
> >>> }
> >>>
> >>> this.SendMessage = function(sy, s) {
> >>> if(this.sy)
> >>> this.sy.postMessage(s, "*");
> >>> }
> >>> }
> >> If someone want to try send a bankchange message.
> >> Here is how you invoke the synth.
> >> synth.Load('https://logue.dev/smfplayer.js/wml.html');
> >> And here is the actual sender of messages to the synth.
> >> Notes, programs and CCmessages seems to work but can't get CC modulation to respond, and sustain that should be a range 0-127 seems to be implemented as a binary state on and off.
> >>
> >> But the most important thing to get working is bankchange, and i can not make it work.
> >> var synth = new Synth();
> >> //To string 16 converts number to hexadecimal value
> >> function Synth() {
> >> this.sy = null;
> >> this.Load = function(url) {
> >> this.sy = window.open(url, "extSynth", "width=700,height=700,scrollbars=yes,resizable=yes");
> >> this.sy.focus();
> >> }
> >> this.NoteOn = function(SFM,note, velo) {
> >> SFM=parseInt(SFM);
> >> note=parseInt(note);
> >> velo=parseInt(velo);
> >> this.SendMessage(this.sy, "midi,"+SFM.toString(16)+"," + note.toString(16) + "," + velo.toString(16));
> >> }
> >> this.NoteOff = function(SFM,note) {
> >> SFM=parseInt(SFM);
> >> note=parseInt(note);
> >> this.SendMessage(this.sy, "midi,"+SFM.toString(16)+","+ note.toString(16) + ",0");
> >> }
> >> this.PGMchange = function(SFchan,SFprg) {
> >> SFprg=parseInt(SFprg);
> >> SFchan=parseInt(SFchan);
> >> this.SendMessage(this.sy, "midi,"+SFchan.toString(16)+","+SFprg.toString(16));
> >> }
> >> this.SendMessage = function(sy, s) {
> >> if(this.sy)
> >> this.sy.postMessage(s, "*");
> >> }
> >> }
> > Give it a go on my phoneserver so no SSL
> > https://84.217.163.187:80/
> >
There probably is but i am not much of a reader of content, i rather look at things done and see "if i can figure out" what going on.


Click here to read the complete article
Re: Building midi message for a software synth

<sb6r26$eh1$1@solani.org>

  copy mid

https://www.rocksolidbbs.com/devel/article-flat.php?id=17132&group=comp.lang.javascript#17132

  copy link   Newsgroups: comp.lang.javascript
Path: i2pn2.org!i2pn.org!weretis.net!feeder8.news.weretis.net!feeder5.news.weretis.net!news.solani.org!.POSTED!not-for-mail
From: janburse@fastmail.fm (Mostowski Collapse)
Newsgroups: comp.lang.javascript
Subject: Re: Building midi message for a software synth
Date: Sat, 26 Jun 2021 11:12:36 +0200
Message-ID: <sb6r26$eh1$1@solani.org>
References: <419b4226-1b11-48ca-b1eb-4a3cbf9664e2n@googlegroups.com>
<bfa16d76-b90e-4ab2-a945-02b68b5c51aen@googlegroups.com>
<2f9df51d-3949-4b6e-8fdb-2c252e93f34cn@googlegroups.com>
<7594c976-2202-40c4-8a34-70ad6ff73bcan@googlegroups.com>
<sb4gai$5sa$1@solani.org>
<de9322c6-876f-43eb-a2fe-f51324dcbbd2n@googlegroups.com>
Mime-Version: 1.0
Content-Type: text/plain; charset=UTF-8; format=flowed
Content-Transfer-Encoding: 8bit
Injection-Date: Sat, 26 Jun 2021 09:12:38 -0000 (UTC)
Injection-Info: solani.org;
logging-data="14881"; mail-complaints-to="abuse@news.solani.org"
User-Agent: Mozilla/5.0 (Macintosh; Intel Mac OS X 10.16; rv:60.0)
Gecko/20100101 Firefox/60.0 SeaMonkey/2.53.8
Cancel-Lock: sha1:++KIWN/hSIX4pjHRl/ct0EHA//8=
In-Reply-To: <de9322c6-876f-43eb-a2fe-f51324dcbbd2n@googlegroups.com>
X-User-ID: eJwNysEBwCAIA8CVVELAcTDK/iO09z43TipAJ7y9kcLR2EMwVvgryFvcWj1wO/scdtRS7DnzFXGIDLt2198/YzAV0Q==
 by: Mostowski Collapse - Sat, 26 Jun 2021 09:12 UTC

From the introduction:

"Audio on the web has been fairly primitive up to this point and until
very recently has had to be delivered through plugins such as Flash and
QuickTime. The introduction of the audio element in HTML5 is very
important, allowing for basic streaming audio playback.

But, it is not powerful enough to handle more complex audio
applications. For sophisticated web-based games or interactive
applications, another solution is required. It is a goal of this
specification to include the capabilities

found in modern game audio engines as well as some of the mixing,
processing, and filtering tasks that are found in modern desktop
audio production applications."
https://www.w3.org/TR/2021/REC-webaudio-20210617/

Jonas Thörnvall schrieb:
> fredag 25 juni 2021 kl. 13:57:16 UTC+2 skrev Mostowski Collapse:
>> Is there something in it for you?
>> https://www.w3.org/TR/2021/REC-webaudio-20210617/
>>
>> Jonas Thörnvall schrieb:
>>> torsdag 24 juni 2021 kl. 18:07:33 UTC+2 skrev Jonas Thörnvall:
>>>> torsdag 24 juni 2021 kl. 15:35:33 UTC+2 skrev Jonas Thörnvall:
>>>>> torsdag 24 juni 2021 kl. 15:07:40 UTC+2 skrev Jonas Thörnvall:
>>>>>> I am building midi messages "interfacing" a software synth. But i am so terrible reading others codes so i am not sure i understand it correct.
>>>>>>
>>>>>> Isn't the bank and modulation messages just checking if byte 1 equal 176 and byte 2 equal 1 if so one should call the modulation function and if byte 2 equal 0 one should call the bnk function?
>>>>>>
>>>>>> I will try again but i can't get the bnk and modulation messages to work.
>>>>>>
>>>>>> switch (message[0] & 0xf0) {
>>>>>> case 0x80: // NoteOff: 8n kk vv
>>>>>> synth.noteOff(channel, message[1], message[2]);
>>>>>> break;
>>>>>> case 0x90: // NoteOn: 9n kk vv
>>>>>> if (message[2] > 0) {
>>>>>> synth.noteOn(channel, message[1], message[2]);
>>>>>> } else {
>>>>>> synth.noteOff(channel, message[1], 0);
>>>>>> }
>>>>>> break;
>>>>>> case 0xB0: // Control Change: Bn cc dd
>>>>>> /** @type {number} */
>>>>>> const value = message[2];
>>>>>> switch (message[1]) {
>>>>>> case 0x00: // Bank Select MSB: Bn 00 dd
>>>>>> synth.bankSelectMsb(channel, value);
>>>>>> break;
>>>>>> case 0x01: // Modulation Depth
>>>>>> synth.modulationDepth(channel, value);
>>>>>> break;
>>>>>> case 0x05: // Portament Time
>>>>>> break;
>>>>>> case 0x06: // Data Entry(MSB): Bn 06 dd
>>>>>> if (this.rpnMode) {
>>>>>> // RPN
>>>>>> switch (this.RpnMsb[channel]) {
>>>>>> case 0:
>>>>>> switch (this.RpnLsb[channel]) {
>>>>>> case 0: // Pitch Bend Sensitivity
>>>>>> synth.pitchBendSensitivity(channel, value);
>>>>>> break;
>>>>>> case 1:
>>>>>> // console.log("fine");
>>>>>> break;
>>>>>> case 2:
>>>>>> // console.log("coarse");
>>>>>> break;
>>>>>> default:
>>>>>> // console.log("default");
>>>>>> break;
>>>>>> }
>>>>>> break;
>>>>>> default:
>>>>>> // console.log("default:", this.RpnMsb[channel], this.RpnLsb[channel]);
>>>>>> break;
>>>>>> }
>>>>> I think there is something very strange i can not quite wrap my head on with web midi link external synth calls, to me it seem what should be sent over net, rather should be a byte length?
>>>>> The function names are not sent as parameter anyway
>>>>>
>>>>> So one could just have 3 type of calls/function "3 byte calls", ""2 byte calls" and "sysex calls of variable length?".
>>>>> The decomposition is done on the receiver side anyway????
>>>>>
>>>>> Here is my sender, i practically send all CC over noteOn problem is bankchanges and modulation do not work and i do not understand why?
>>>>>
>>>>> var synth = new Synth();
>>>>> //To string 16 converts number to hexadecimal value
>>>>> function Synth() {
>>>>> this.sy = null;
>>>>> this.Load = function(url) {
>>>>> this.sy = window.open(url, "extSynth", "width=700,height=700,scrollbars=yes,resizable=yes");
>>>>> this.sy.focus();
>>>>> }
>>>>> this.NoteOn = function(SFM,note, velo) {
>>>>> SFM=parseInt(SFM);
>>>>> note=parseInt(note);
>>>>> velo=parseInt(velo);
>>>>> this.SendMessage(this.sy, "midi,"+SFM.toString(16)+"," + note.toString(16) + "," + velo.toString(16));
>>>>> }
>>>>> this.NoteOff = function(SFM,note) {
>>>>> SFM=parseInt(SFM);
>>>>> note=parseInt(note);
>>>>> this.SendMessage(this.sy, "midi,"+SFM.toString(16)+","+ note.toString(16) + ",0");
>>>>> }
>>>>> this.PGMchange = function(SFchan,SFprg) {
>>>>> SFprg=parseInt(SFprg);
>>>>> SFchan=parseInt(SFchan);
>>>>> this.SendMessage(this.sy, "midi,"+SFchan.toString(16)+","+SFprg.toString(16));
>>>>> }
>>>>> //////////Is PGMchange above not same message "type, not content" as noteOff two bytes sent?//////////////////////////////////
>>>>> /////////////////////////////////////////////////////////////////////////WHY SHOULD THESE FUNCTIONS BE NEEDED///////////////////////////////
>>>>> ///////////////////////////////////////Or are the function calls somehow passed as argument over net???//////////////////////////////////
>>>>> /////////////////////////////////////If so i should probably name them correct, but i don't think they are?///////////////////////////////////
>>>>> this.MODchange = function(SFchan,SFval) {
>>>>> SFchan=parseInt(SFchan);
>>>>> SFval=parseInt(SFval);
>>>>> this.SendMessage(this.sy, "midi,"+SFchan.toString(16)+","+SFval.toString(16));
>>>>> }
>>>>> this.BNKchange = function(SFchan,SFbnk) {
>>>>> SFchan=parseInt(SFchan);
>>>>> SFval=parseInt(SFbnk);
>>>>> this.SendMessage(this.sy, "midi,"+SFchan.toString(16)+","+SFbnk.toString(16));
>>>>> }
>>>>> /////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////
>>>>> /////////////////////////////////This is another type of message 1byte, probably could named it anything or????////////////////////
>>>>> this.AllSoundOff = function(offCh) {
>>>>> offCh=parseInt(offCh);
>>>>> this.SendMessage(this.sy, "midi,"+offCh.toString(16));
>>>>> }
>>>>>
>>>>> this.SendMessage = function(sy, s) {
>>>>> if(this.sy)
>>>>> this.sy.postMessage(s, "*");
>>>>> }
>>>>> }
>>>> If someone want to try send a bankchange message.
>>>> Here is how you invoke the synth.
>>>> synth.Load('https://logue.dev/smfplayer.js/wml.html');
>>>> And here is the actual sender of messages to the synth.
>>>> Notes, programs and CCmessages seems to work but can't get CC modulation to respond, and sustain that should be a range 0-127 seems to be implemented as a binary state on and off.
>>>>
>>>> But the most important thing to get working is bankchange, and i can not make it work.
>>>> var synth = new Synth();
>>>> //To string 16 converts number to hexadecimal value
>>>> function Synth() {
>>>> this.sy = null;
>>>> this.Load = function(url) {
>>>> this.sy = window.open(url, "extSynth", "width=700,height=700,scrollbars=yes,resizable=yes");
>>>> this.sy.focus();
>>>> }
>>>> this.NoteOn = function(SFM,note, velo) {
>>>> SFM=parseInt(SFM);
>>>> note=parseInt(note);
>>>> velo=parseInt(velo);
>>>> this.SendMessage(this.sy, "midi,"+SFM.toString(16)+"," + note.toString(16) + "," + velo.toString(16));
>>>> }
>>>> this.NoteOff = function(SFM,note) {
>>>> SFM=parseInt(SFM);
>>>> note=parseInt(note);
>>>> this.SendMessage(this.sy, "midi,"+SFM.toString(16)+","+ note.toString(16) + ",0");
>>>> }
>>>> this.PGMchange = function(SFchan,SFprg) {
>>>> SFprg=parseInt(SFprg);
>>>> SFchan=parseInt(SFchan);
>>>> this.SendMessage(this.sy, "midi,"+SFchan.toString(16)+","+SFprg.toString(16));
>>>> }
>>>> this.SendMessage = function(sy, s) {
>>>> if(this.sy)
>>>> this.sy.postMessage(s, "*");
>>>> }
>>>> }
>>> Give it a go on my phoneserver so no SSL
>>> https://84.217.163.187:80/
>>>
> There probably is but i am not much of a reader of content, i rather look at things done and see "if i can figure out" what going on.
>


Click here to read the complete article
Re: Building midi message for a software synth

<sb6rfc$eou$1@solani.org>

  copy mid

https://www.rocksolidbbs.com/devel/article-flat.php?id=17133&group=comp.lang.javascript#17133

  copy link   Newsgroups: comp.lang.javascript
Path: i2pn2.org!i2pn.org!weretis.net!feeder8.news.weretis.net!feeder5.news.weretis.net!news.solani.org!.POSTED!not-for-mail
From: janburse@fastmail.fm (Mostowski Collapse)
Newsgroups: comp.lang.javascript
Subject: Re: Building midi message for a software synth
Date: Sat, 26 Jun 2021 11:19:37 +0200
Message-ID: <sb6rfc$eou$1@solani.org>
References: <419b4226-1b11-48ca-b1eb-4a3cbf9664e2n@googlegroups.com>
<bfa16d76-b90e-4ab2-a945-02b68b5c51aen@googlegroups.com>
<2f9df51d-3949-4b6e-8fdb-2c252e93f34cn@googlegroups.com>
<7594c976-2202-40c4-8a34-70ad6ff73bcan@googlegroups.com>
<sb4gai$5sa$1@solani.org>
<de9322c6-876f-43eb-a2fe-f51324dcbbd2n@googlegroups.com>
<sb6r26$eh1$1@solani.org>
Mime-Version: 1.0
Content-Type: text/plain; charset=UTF-8; format=flowed
Content-Transfer-Encoding: 8bit
Injection-Date: Sat, 26 Jun 2021 09:19:40 -0000 (UTC)
Injection-Info: solani.org;
logging-data="15134"; mail-complaints-to="abuse@news.solani.org"
User-Agent: Mozilla/5.0 (Macintosh; Intel Mac OS X 10.16; rv:60.0)
Gecko/20100101 Firefox/60.0 SeaMonkey/2.53.8
Cancel-Lock: sha1:FPEJgrLav8rbDXp4+9/4JGqvymg=
In-Reply-To: <sb6r26$eh1$1@solani.org>
X-User-ID: eJwFwQkBwDAMAkBLSYC0ldNn+JewO6Gz72CrKcsrd50KJgS9mo62+HFGk9YsutPGg1YQI3zyu9TmwTPWDx5bFG8=
 by: Mostowski Collapse - Sat, 26 Jun 2021 09:19 UTC

I tried something very simple with Dogelog:
http://www.dogelog.ch/song.html

Strangely it works in Chrome, but doesn't work in Safari. :-(

Some description how it was done:

Preview: Dogelog plays Mary had a little Lamb. (Jekejeke)
https://gist.github.com/jburse/20fff6f056c1f4421874e41769a9c387#gistcomment-3793350

Next step is to use async/await, so that the delay/2
primitive can be replaced by a sleep/1 primitive.

Working on it...

Mostowski Collapse schrieb:
> From the introduction:
>
> "Audio on the web has been fairly primitive up to this point and until
> very recently has had to be delivered through plugins such as Flash and
> QuickTime. The introduction of the audio element in HTML5 is very
> important, allowing for basic streaming audio playback.
>
> But, it is not powerful enough to handle more complex audio
> applications. For sophisticated web-based games or interactive
> applications, another solution is required. It is a goal of this
> specification to include the capabilities
>
> found in modern game audio engines as well as some of the mixing,
> processing, and filtering tasks that are found in modern desktop
> audio production applications."
> https://www.w3.org/TR/2021/REC-webaudio-20210617/
>
> Jonas Thörnvall schrieb:
>> There probably is but i am not much of a reader of content, i rather
>> look at things done and see "if i can figure out"  what going on.
>>
>

Re: Building midi message for a software synth

<ef2e054a-6675-4d6b-b9c9-42bde27a0c54n@googlegroups.com>

  copy mid

https://www.rocksolidbbs.com/devel/article-flat.php?id=17134&group=comp.lang.javascript#17134

  copy link   Newsgroups: comp.lang.javascript
X-Received: by 2002:ad4:4203:: with SMTP id k3mr8270883qvp.16.1624706413018; Sat, 26 Jun 2021 04:20:13 -0700 (PDT)
X-Received: by 2002:a05:6830:40b4:: with SMTP id x52mr13298048ott.117.1624706412770; Sat, 26 Jun 2021 04:20:12 -0700 (PDT)
Path: i2pn2.org!i2pn.org!paganini.bofh.team!news.dns-netz.com!news.freedyn.net!newsfeed.xs4all.nl!newsfeed7.news.xs4all.nl!tr1.eu1.usenetexpress.com!feeder.usenetexpress.com!tr1.iad1.usenetexpress.com!border1.nntp.dca1.giganews.com!nntp.giganews.com!news-out.google.com!nntp.google.com!postnews.google.com!google-groups.googlegroups.com!not-for-mail
Newsgroups: comp.lang.javascript
Date: Sat, 26 Jun 2021 04:20:12 -0700 (PDT)
In-Reply-To: <sb6rfc$eou$1@solani.org>
Injection-Info: google-groups.googlegroups.com; posting-host=84.217.163.187; posting-account=kxPkPAoAAACjJi8w0gL9bnyznPzdw9HW
NNTP-Posting-Host: 84.217.163.187
References: <419b4226-1b11-48ca-b1eb-4a3cbf9664e2n@googlegroups.com> <bfa16d76-b90e-4ab2-a945-02b68b5c51aen@googlegroups.com> <2f9df51d-3949-4b6e-8fdb-2c252e93f34cn@googlegroups.com> <7594c976-2202-40c4-8a34-70ad6ff73bcan@googlegroups.com> <sb4gai$5sa$1@solani.org> <de9322c6-876f-43eb-a2fe-f51324dcbbd2n@googlegroups.com> <sb6r26$eh1$1@solani.org> <sb6rfc$eou$1@solani.org>
User-Agent: G2/1.0
MIME-Version: 1.0
Message-ID: <ef2e054a-6675-4d6b-b9c9-42bde27a0c54n@googlegroups.com>
Subject: Re: Building midi message for a software synth
From: jonas.thornvall@gmail.com (Jonas Thörnvall)
Injection-Date: Sat, 26 Jun 2021 11:20:13 +0000
Content-Type: text/plain; charset="UTF-8"
Content-Transfer-Encoding: quoted-printable
Lines: 66
 by: Jonas Thörnvall - Sat, 26 Jun 2021 11:20 UTC

lördag 26 juni 2021 kl. 11:19:48 UTC+2 skrev Mostowski Collapse:
> I tried something very simple with Dogelog:
> http://www.dogelog.ch/song.html
>
> Strangely it works in Chrome, but doesn't work in Safari. :-(
>
> Some description how it was done:
>
> Preview: Dogelog plays Mary had a little Lamb. (Jekejeke)
> https://gist.github.com/jburse/20fff6f056c1f4421874e41769a9c387#gistcomment-3793350
>
> Next step is to use async/await, so that the delay/2
> primitive can be replaced by a sleep/1 primitive.
>
> Working on it...
>
> Mostowski Collapse schrieb:
> > From the introduction:
> >
> > "Audio on the web has been fairly primitive up to this point and until
> > very recently has had to be delivered through plugins such as Flash and
> > QuickTime. The introduction of the audio element in HTML5 is very
> > important, allowing for basic streaming audio playback.
> >
> > But, it is not powerful enough to handle more complex audio
> > applications. For sophisticated web-based games or interactive
> > applications, another solution is required. It is a goal of this
> > specification to include the capabilities
> >
> > found in modern game audio engines as well as some of the mixing,
> > processing, and filtering tasks that are found in modern desktop
> > audio production applications."
> > https://www.w3.org/TR/2021/REC-webaudio-20210617/
> >
> > Jonas Thörnvall schrieb:
> >> There probably is but i am not much of a reader of content, i rather
> >> look at things done and see "if i can figure out" what going on.
> >>
> >
A nice little start for Dogelog, but regarding my problems they are on a metalayer "a built on message API" for the web MiDI API, it could even be so simple that the synth do not recognise bnk and modulation changes.
The interface of it use webmidilink that is a simple protocol for send messages.
https://www.g200kg.com/en/docs/webmidilink/spec.html
It seem to me the "synth builder" logue have specified both modulation receive and bank receive, see first post in thread.
The webmidilink protocol specify a sender and receiver approach.

But i simply can't create a bankchange or modulation, and it can be so simple that they really not specified, but i can change programs "sound", set volume, set reverb play notes e t c.
So my question is do i understand what message the receiver wants, maybe i am sending wrong message and that is why i do not hear modulation or manage to change bank for synth.

Regarding Dogelog, i will follow its development, yesterday i had a look at my chess "rule" interface with load and save of chessgames, clock and setup so it is almost there.
And i am thinking maybe Dogelog a suitable platform to build the engine around.

JT

Re: Building midi message for a software synth

<6de18c9b-cb32-4a59-9bc5-8bbc4aa29197n@googlegroups.com>

  copy mid

https://www.rocksolidbbs.com/devel/article-flat.php?id=17135&group=comp.lang.javascript#17135

  copy link   Newsgroups: comp.lang.javascript
X-Received: by 2002:a05:620a:1116:: with SMTP id o22mr1295910qkk.299.1624707219341; Sat, 26 Jun 2021 04:33:39 -0700 (PDT)
X-Received: by 2002:a9d:5e8b:: with SMTP id f11mr13834544otl.274.1624707219104; Sat, 26 Jun 2021 04:33:39 -0700 (PDT)
Path: i2pn2.org!i2pn.org!aioe.org!feeder1.feed.usenet.farm!feed.usenet.farm!tr2.eu1.usenetexpress.com!feeder.usenetexpress.com!tr1.iad1.usenetexpress.com!border1.nntp.dca1.giganews.com!nntp.giganews.com!news-out.google.com!nntp.google.com!postnews.google.com!google-groups.googlegroups.com!not-for-mail
Newsgroups: comp.lang.javascript
Date: Sat, 26 Jun 2021 04:33:38 -0700 (PDT)
In-Reply-To: <ef2e054a-6675-4d6b-b9c9-42bde27a0c54n@googlegroups.com>
Injection-Info: google-groups.googlegroups.com; posting-host=84.217.163.187; posting-account=kxPkPAoAAACjJi8w0gL9bnyznPzdw9HW
NNTP-Posting-Host: 84.217.163.187
References: <419b4226-1b11-48ca-b1eb-4a3cbf9664e2n@googlegroups.com> <bfa16d76-b90e-4ab2-a945-02b68b5c51aen@googlegroups.com> <2f9df51d-3949-4b6e-8fdb-2c252e93f34cn@googlegroups.com> <7594c976-2202-40c4-8a34-70ad6ff73bcan@googlegroups.com> <sb4gai$5sa$1@solani.org> <de9322c6-876f-43eb-a2fe-f51324dcbbd2n@googlegroups.com> <sb6r26$eh1$1@solani.org> <sb6rfc$eou$1@solani.org> <ef2e054a-6675-4d6b-b9c9-42bde27a0c54n@googlegroups.com>
User-Agent: G2/1.0
MIME-Version: 1.0
Message-ID: <6de18c9b-cb32-4a59-9bc5-8bbc4aa29197n@googlegroups.com>
Subject: Re: Building midi message for a software synth
From: jonas.thornvall@gmail.com (Jonas Thörnvall)
Injection-Date: Sat, 26 Jun 2021 11:33:39 +0000
Content-Type: text/plain; charset="UTF-8"
Content-Transfer-Encoding: quoted-printable
Lines: 110
 by: Jonas Thörnvall - Sat, 26 Jun 2021 11:33 UTC

lördag 26 juni 2021 kl. 13:20:18 UTC+2 skrev Jonas Thörnvall:
> lördag 26 juni 2021 kl. 11:19:48 UTC+2 skrev Mostowski Collapse:
> > I tried something very simple with Dogelog:
> > http://www.dogelog.ch/song.html
> >
> > Strangely it works in Chrome, but doesn't work in Safari. :-(
> >
> > Some description how it was done:
> >
> > Preview: Dogelog plays Mary had a little Lamb. (Jekejeke)
> > https://gist.github.com/jburse/20fff6f056c1f4421874e41769a9c387#gistcomment-3793350
> >
> > Next step is to use async/await, so that the delay/2
> > primitive can be replaced by a sleep/1 primitive.
> >
> > Working on it...
> >
> > Mostowski Collapse schrieb:
> > > From the introduction:
> > >
> > > "Audio on the web has been fairly primitive up to this point and until
> > > very recently has had to be delivered through plugins such as Flash and
> > > QuickTime. The introduction of the audio element in HTML5 is very
> > > important, allowing for basic streaming audio playback.
> > >
> > > But, it is not powerful enough to handle more complex audio
> > > applications. For sophisticated web-based games or interactive
> > > applications, another solution is required. It is a goal of this
> > > specification to include the capabilities
> > >
> > > found in modern game audio engines as well as some of the mixing,
> > > processing, and filtering tasks that are found in modern desktop
> > > audio production applications."
> > > https://www.w3.org/TR/2021/REC-webaudio-20210617/
> > >
> > > Jonas Thörnvall schrieb:
> > >> There probably is but i am not much of a reader of content, i rather
> > >> look at things done and see "if i can figure out" what going on.
> > >>
> > >
> A nice little start for Dogelog, but regarding my problems they are on a metalayer "a built on message API" for the web MiDI API, it could even be so simple that the synth do not recognise bnk and modulation changes.
> The interface of it use webmidilink that is a simple protocol for send messages.
> https://www.g200kg.com/en/docs/webmidilink/spec.html
> It seem to me the "synth builder" logue have specified both modulation receive and bank receive, see first post in thread.
> The webmidilink protocol specify a sender and receiver approach.
>
> But i simply can't create a bankchange or modulation, and it can be so simple that they really not specified, but i can change programs "sound", set volume, set reverb play notes e t c.
> So my question is do i understand what message the receiver wants, maybe i am sending wrong message and that is why i do not hear modulation or manage to change bank for synth.
>
> Regarding Dogelog, i will follow its development, yesterday i had a look at my chess "rule" interface with load and save of chessgames, clock and setup so it is almost there.
> And i am thinking maybe Dogelog a suitable platform to build the engine around.
>
> JT
I have problem understanding this, could someone explain "i think this message should be used to send "variable length" sysex messages over the webmidi interface.
this.SendMessage = function(sy, s) {
if(this.sy)
this.sy.postMessage(s, "*");
}

What does s and "*" star denote in message? Looking at the other messages which i do understand it really does not make sense to me?
Is the star to be replaced with the "midimessage string?" you want to send.

Why is sy suddenly sent as a parameter to the function? But then it is the s that holds the message, and what is then the star?????
Well it is utterly confusing to me.

https://www.g200kg.com/en/docs/webmidilink/index.html

function Synth() {
this.sy = null;
this.Load = function(url) {
this.sy = window.open(url, "sy1", "width=900,height=670,scrollbars=yes,resizable=yes");
}
this.NoteOn = function(note, velo) {
this.SendMessage(this.sy, "midi,90," + note.toString(16) + "," + velo.toString(16));
}
this.NoteOff = function(note) {
this.SendMessage(this.sy, "midi,80," + note.toString(16) + ",0");
}
this.AllSoundOff = function() {
this.SendMessage(this.sy, "midi,b0,78,0");
}
this.SendMessage = function(sy, s) {
if(this.sy)
this.sy.postMessage(s, "*");
}
}
var synth = new Synth();

JT


devel / comp.lang.javascript / Re: Building midi message for a software synth

1
server_pubkey.txt

rocksolid light 0.9.81
clearnet tor