Groups | Search | Server Info | Keyboard shortcuts | Login | Register [http] [https] [nntp] [nntps]
Groups > comp.lang.javascript > #40240 > unrolled thread
| Started by | Jonas Thörnvall <jonas.thornvall@gmail.com> |
|---|---|
| First post | 2021-06-24 06:07 -0700 |
| Last post | 2021-06-26 04:33 -0700 |
| Articles | 10 — 2 participants |
Back to article view | Back to comp.lang.javascript
Building midi message for a software synth Jonas Thörnvall <jonas.thornvall@gmail.com> - 2021-06-24 06:07 -0700
Re: Building midi message for a software synth Jonas Thörnvall <jonas.thornvall@gmail.com> - 2021-06-24 06:35 -0700
Re: Building midi message for a software synth Jonas Thörnvall <jonas.thornvall@gmail.com> - 2021-06-24 09:07 -0700
Re: Building midi message for a software synth Jonas Thörnvall <jonas.thornvall@gmail.com> - 2021-06-24 14:00 -0700
Re: Building midi message for a software synth Mostowski Collapse <janburse@fastmail.fm> - 2021-06-25 13:57 +0200
Re: Building midi message for a software synth Jonas Thörnvall <jonas.thornvall@gmail.com> - 2021-06-25 11:11 -0700
Re: Building midi message for a software synth Mostowski Collapse <janburse@fastmail.fm> - 2021-06-26 11:12 +0200
Re: Building midi message for a software synth Mostowski Collapse <janburse@fastmail.fm> - 2021-06-26 11:19 +0200
Re: Building midi message for a software synth Jonas Thörnvall <jonas.thornvall@gmail.com> - 2021-06-26 04:20 -0700
Re: Building midi message for a software synth Jonas Thörnvall <jonas.thornvall@gmail.com> - 2021-06-26 04:33 -0700
| From | Jonas Thörnvall <jonas.thornvall@gmail.com> |
|---|---|
| Date | 2021-06-24 06:07 -0700 |
| Subject | Building midi message for a software synth |
| Message-ID | <419b4226-1b11-48ca-b1eb-4a3cbf9664e2n@googlegroups.com> |
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;
}
[toc] | [next] | [standalone]
| From | Jonas Thörnvall <jonas.thornvall@gmail.com> |
|---|---|
| Date | 2021-06-24 06:35 -0700 |
| Message-ID | <bfa16d76-b90e-4ab2-a945-02b68b5c51aen@googlegroups.com> |
| In reply to | #40240 |
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, "*");
}
}
[toc] | [prev] | [next] | [standalone]
| From | Jonas Thörnvall <jonas.thornvall@gmail.com> |
|---|---|
| Date | 2021-06-24 09:07 -0700 |
| Message-ID | <2f9df51d-3949-4b6e-8fdb-2c252e93f34cn@googlegroups.com> |
| In reply to | #40241 |
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, "*");
}
}
[toc] | [prev] | [next] | [standalone]
| From | Jonas Thörnvall <jonas.thornvall@gmail.com> |
|---|---|
| Date | 2021-06-24 14:00 -0700 |
| Message-ID | <7594c976-2202-40c4-8a34-70ad6ff73bcan@googlegroups.com> |
| In reply to | #40242 |
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/
[toc] | [prev] | [next] | [standalone]
| From | Mostowski Collapse <janburse@fastmail.fm> |
|---|---|
| Date | 2021-06-25 13:57 +0200 |
| Message-ID | <sb4gai$5sa$1@solani.org> |
| In reply to | #40243 |
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/
>
[toc] | [prev] | [next] | [standalone]
| From | Jonas Thörnvall <jonas.thornvall@gmail.com> |
|---|---|
| Date | 2021-06-25 11:11 -0700 |
| Message-ID | <de9322c6-876f-43eb-a2fe-f51324dcbbd2n@googlegroups.com> |
| In reply to | #40246 |
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.
[toc] | [prev] | [next] | [standalone]
| From | Mostowski Collapse <janburse@fastmail.fm> |
|---|---|
| Date | 2021-06-26 11:12 +0200 |
| Message-ID | <sb6r26$eh1$1@solani.org> |
| In reply to | #40248 |
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.
>
[toc] | [prev] | [next] | [standalone]
| From | Mostowski Collapse <janburse@fastmail.fm> |
|---|---|
| Date | 2021-06-26 11:19 +0200 |
| Message-ID | <sb6rfc$eou$1@solani.org> |
| In reply to | #40250 |
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. >> >
[toc] | [prev] | [next] | [standalone]
| From | Jonas Thörnvall <jonas.thornvall@gmail.com> |
|---|---|
| Date | 2021-06-26 04:20 -0700 |
| Message-ID | <ef2e054a-6675-4d6b-b9c9-42bde27a0c54n@googlegroups.com> |
| In reply to | #40251 |
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
[toc] | [prev] | [next] | [standalone]
| From | Jonas Thörnvall <jonas.thornvall@gmail.com> |
|---|---|
| Date | 2021-06-26 04:33 -0700 |
| Message-ID | <6de18c9b-cb32-4a59-9bc5-8bbc4aa29197n@googlegroups.com> |
| In reply to | #40252 |
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
[toc] | [prev] | [standalone]
Back to top | Article view | comp.lang.javascript
csiph-web