Groups | Search | Server Info | Keyboard shortcuts | Login | Register [http] [https] [nntp] [nntps]
Groups > comp.lang.javascript > #35052 > unrolled thread
| Started by | Jonas Thörnvall <jonas.thornvall@gmail.com> |
|---|---|
| First post | 2018-05-21 01:49 -0700 |
| Last post | 2018-05-22 10:11 +0200 |
| Articles | 20 on this page of 46 — 3 participants |
Back to article view | Back to comp.lang.javascript
Script work with windows XP, "opera,chrome" but not in Windows 10 something changed in the midi API? Jonas Thörnvall <jonas.thornvall@gmail.com> - 2018-05-21 01:49 -0700
Re: Script work with windows XP, "opera,chrome" but not in Windows 10 something changed in the midi API? Jonas Thörnvall <jonas.thornvall@gmail.com> - 2018-05-21 02:15 -0700
Re: Script work with windows XP, "opera,chrome" but not in Windows 10 something changed in the midi API? Jonas Thörnvall <jonas.thornvall@gmail.com> - 2018-05-21 02:24 -0700
Re: Script work with windows XP, "opera,chrome" but not in Windows 10 something changed in the midi API? Jonas Thörnvall <jonas.thornvall@gmail.com> - 2018-05-21 02:28 -0700
Re: Script work with windows XP, "opera,chrome" but not in Windows 10 something changed in the midi API? Jonas Thörnvall <jonas.thornvall@gmail.com> - 2018-05-21 02:30 -0700
Re: Script work with windows XP, "opera,chrome" but not in Windows 10 something changed in the midi API? "Evertjan." <exxjxw.hannivoort@inter.nl.net> - 2018-05-21 12:13 +0200
Re: Script work with windows XP, "opera,chrome" but not in Windows 10 something changed in the midi API? Jonas Thörnvall <jonas.thornvall@gmail.com> - 2018-05-21 03:47 -0700
Re: Script work with windows XP, "opera,chrome" but not in Windows 10 something changed in the midi API? Jonas Thörnvall <jonas.thornvall@gmail.com> - 2018-05-21 03:48 -0700
Re: Script work with windows XP, "opera,chrome" but not in Windows 10 something changed in the midi API? Jonas Thörnvall <jonas.thornvall@gmail.com> - 2018-05-21 04:02 -0700
Re: Script work with windows XP, "opera,chrome" but not in Windows 10 something changed in the midi API? Jonas Thörnvall <jonas.thornvall@gmail.com> - 2018-05-21 04:24 -0700
Re: Script work with windows XP, "opera,chrome" but not in Windows 10 something changed in the midi API? Jonas Thörnvall <jonas.thornvall@gmail.com> - 2018-05-21 04:46 -0700
Re: Script work with windows XP, "opera,chrome" but not in Windows 10 something changed in the midi API? Jonas Thörnvall <jonas.thornvall@gmail.com> - 2018-05-21 05:11 -0700
Re: Script work with windows XP, "opera,chrome" but not in Windows 10 something changed in the midi API? Jonas Thörnvall <jonas.thornvall@gmail.com> - 2018-05-21 05:21 -0700
Re: Script work with windows XP, "opera,chrome" but not in Windows 10 something changed in the midi API? Jonas Thörnvall <jonas.thornvall@gmail.com> - 2018-05-21 05:21 -0700
Re: Script work with windows XP, "opera,chrome" but not in Windows 10 something changed in the midi API? Jonas Thörnvall <jonas.thornvall@gmail.com> - 2018-05-21 05:27 -0700
Re: Script work with windows XP, "opera,chrome" but not in Windows 10 something changed in the midi API? Jonas Thörnvall <jonas.thornvall@gmail.com> - 2018-05-21 05:30 -0700
Re: Script work with windows XP, "opera,chrome" but not in Windows 10 something changed in the midi API? Jonas Thörnvall <jonas.thornvall@gmail.com> - 2018-05-21 05:48 -0700
Re: Script work with windows XP, "opera,chrome" but not in Windows 10 something changed in the midi API? Jonas Thörnvall <jonas.thornvall@gmail.com> - 2018-05-21 08:13 -0700
Re: Script work with windows XP, "opera,chrome" but not in Windows 10 something changed in the midi API? John G Harris <niam@jghnorth.org.uk.invalid> - 2018-05-21 18:27 +0100
Re: Script work with windows XP, "opera,chrome" but not in Windows 10 something changed in the midi API? Jonas Thörnvall <jonas.thornvall@gmail.com> - 2018-05-21 12:42 -0700
Re: Script work with windows XP, "opera,chrome" but not in Windows 10 something changed in the midi API? Jonas Thörnvall <jonas.thornvall@gmail.com> - 2018-05-21 12:53 -0700
Re: Script work with windows XP, "opera,chrome" but not in Windows 10 something changed in the midi API? Jonas Thörnvall <jonas.thornvall@gmail.com> - 2018-05-21 12:58 -0700
Re: Script work with windows XP, "opera,chrome" but not in Windows 10 something changed in the midi API? Jonas Thörnvall <jonas.thornvall@gmail.com> - 2018-05-21 13:07 -0700
Re: Script work with windows XP, "opera,chrome" but not in Windows 10 something changed in the midi API? "Evertjan." <exxjxw.hannivoort@inter.nl.net> - 2018-05-21 23:42 +0200
Re: Script work with windows XP, "opera,chrome" but not in Windows 10 something changed in the midi API? Jonas Thörnvall <jonas.thornvall@gmail.com> - 2018-05-21 21:53 -0700
Re: Script work with windows XP, "opera,chrome" but not in Windows 10 something changed in the midi API? "Evertjan." <exxjxw.hannivoort@inter.nl.net> - 2018-05-22 10:11 +0200
Re: Script work with windows XP, "opera,chrome" but not in Windows 10 something changed in the midi API? Jonas Thörnvall <jonas.thornvall@gmail.com> - 2018-05-21 22:02 -0700
Re: Script work with windows XP, "opera,chrome" but not in Windows 10 something changed in the midi API? Jonas Thörnvall <jonas.thornvall@gmail.com> - 2018-05-21 23:09 -0700
Re: Script work with windows XP, "opera,chrome" but not in Windows 10 something changed in the midi API? Jonas Thörnvall <jonas.thornvall@gmail.com> - 2018-05-21 23:50 -0700
Re: Script work with windows XP, "opera,chrome" but not in Windows 10 something changed in the midi API? Jonas Thörnvall <jonas.thornvall@gmail.com> - 2018-05-21 23:57 -0700
Re: Script work with windows XP, "opera,chrome" but not in Windows 10 something changed in the midi API? Jonas Thörnvall <jonas.thornvall@gmail.com> - 2018-05-22 00:03 -0700
Re: Script work with windows XP, "opera,chrome" but not in Windows 10 something changed in the midi API? Jonas Thörnvall <jonas.thornvall@gmail.com> - 2018-05-22 00:28 -0700
Re: Script work with windows XP, "opera,chrome" but not in Windows 10 something changed in the midi API? Jonas Thörnvall <jonas.thornvall@gmail.com> - 2018-05-22 00:43 -0700
Re: Script work with windows XP, "opera,chrome" but not in Windows 10 something changed in the midi API? Jonas Thörnvall <jonas.thornvall@gmail.com> - 2018-05-22 00:57 -0700
Re: Script work with windows XP, "opera,chrome" but not in Windows 10 something changed in the midi API? Jonas Thörnvall <jonas.thornvall@gmail.com> - 2018-05-22 01:05 -0700
Re: Script work with windows XP, "opera,chrome" but not in Windows 10 something changed in the midi API? "Evertjan." <exxjxw.hannivoort@inter.nl.net> - 2018-05-22 10:28 +0200
Re: Script work with windows XP, "opera,chrome" but not in Windows 10 something changed in the midi API? Jonas Thörnvall <jonas.thornvall@gmail.com> - 2018-05-22 02:01 -0700
Re: Script work with windows XP, "opera,chrome" but not in Windows 10 something changed in the midi API? Jonas Thörnvall <jonas.thornvall@gmail.com> - 2018-05-22 02:14 -0700
Re: Script work with windows XP, "opera,chrome" but not in Windows 10 something changed in the midi API? Jonas Thörnvall <jonas.thornvall@gmail.com> - 2018-05-22 02:20 -0700
Re: Script work with windows XP, "opera,chrome" but not in Windows 10 something changed in the midi API? Jonas Thörnvall <jonas.thornvall@gmail.com> - 2018-05-23 00:08 -0700
Re: Script work with windows XP, "opera,chrome" but not in Windows 10 something changed in the midi API? "Evertjan." <exxjxw.hannivoort@inter.nl.net> - 2018-05-22 10:15 +0200
Re: Script work with windows XP, "opera,chrome" but not in Windows 10 something changed in the midi API? "Evertjan." <exxjxw.hannivoort@inter.nl.net> - 2018-05-22 10:14 +0200
Re: Script work with windows XP, "opera,chrome" but not in Windows 10 something changed in the midi API? "Evertjan." <exxjxw.hannivoort@inter.nl.net> - 2018-05-22 10:13 +0200
Re: Script work with windows XP, "opera,chrome" but not in Windows 10 something changed in the midi API? "Evertjan." <exxjxw.hannivoort@inter.nl.net> - 2018-05-22 10:13 +0200
Re: Script work with windows XP, "opera,chrome" but not in Windows 10 something changed in the midi API? "Evertjan." <exxjxw.hannivoort@inter.nl.net> - 2018-05-22 10:12 +0200
Re: Script work with windows XP, "opera,chrome" but not in Windows 10 something changed in the midi API? "Evertjan." <exxjxw.hannivoort@inter.nl.net> - 2018-05-22 10:11 +0200
Page 1 of 3 [1] 2 3 Next page →
| From | Jonas Thörnvall <jonas.thornvall@gmail.com> |
|---|---|
| Date | 2018-05-21 01:49 -0700 |
| Subject | Script work with windows XP, "opera,chrome" but not in Windows 10 something changed in the midi API? |
| Message-ID | <c740cb7b-afa5-40b8-9762-f6d69814ba54@googlegroups.com> |
I get errors when i run the code that slip thru on XP using windows 10, it is probably not the same version of browser and javascript API.
TypeError: Cannot read property 'send' of undefined"
Suddenly it says that the midi output port is not defined when i try to reach it, "there is more code but i just show the active where the fail occure.
After ports are read in output should be defined, it is global? But i get error message when i try to send any type of message by using output.send() to port.
Well it sure is defined when XP running the code, but it would be nice move over to windows 10.
if (navigator.requestMIDIAccess) {
navigator.requestMIDIAccess()
.then(success, failure);
}
function failure () {
console.error('No access to your midi devices.'+ + msg )
}
function success (midi) {
mid=midi;
inputs = midi.inputs.values();
// inputs outputs are Iterators
for (input = inputs.next(); input && !input.done; input = inputs.next()) {
// each time there is a midi message call the onMIDIMessage function
input.value.onmidimessage = onMIDIMessage;
}
InitTime= setInterval(init,1000);
}
function init(){
clearInterval(InitTime);
selectPorts();
sendProgram();
}
function sendProgram(){
//Set program on the track
programC=document.getElementById("prog_sel").value;
sysexC=192+channelC-1;
output = mid.outputs.get(outportindex);
settingChange = [sysexC,programC];
output.send(settingChange);
}
function selectPorts(){
outputs = mid.outputs.values();
inputs = mid.inputs.values();
for (output = outputs.next(); output && !output.done; output = outputs.next()) {
var deviceOut = output.value.name;
console.log(deviceOut);
var optout = document.createElement("option");
optout.text = deviceOut;
document.getElementById("out_portsel").add(optout);
}
//output = mid.outputs.get(outportindex);
for (input = inputs.next(); input && !input.done; input = inputs.next()) {
var deviceIn = input.value.name;
var optin = document.createElement("option");
optin.text = deviceIn;
document.getElementById("in_portsel").add(optin);
}
[toc] | [next] | [standalone]
| From | Jonas Thörnvall <jonas.thornvall@gmail.com> |
|---|---|
| Date | 2018-05-21 02:15 -0700 |
| Message-ID | <87c5b6a8-3c61-4115-9357-f2972fa7c4af@googlegroups.com> |
| In reply to | #35052 |
Den måndag 21 maj 2018 kl. 10:49:30 UTC+2 skrev Jonas Thörnvall:
> I get errors when i run the code that slip thru on XP using windows 10, it is probably not the same version of browser and javascript API.
>
> TypeError: Cannot read property 'send' of undefined"
>
> Suddenly it says that the midi output port is not defined when i try to reach it, "there is more code but i just show the active where the fail occure.
>
> After ports are read in output should be defined, it is global? But i get error message when i try to send any type of message by using output.send() to port.
>
> Well it sure is defined when XP running the code, but it would be nice move over to windows 10.
>
> if (navigator.requestMIDIAccess) {
> navigator.requestMIDIAccess()
> .then(success, failure);
> }
>
> function failure () {
> console.error('No access to your midi devices.'+ + msg )
> }
>
>
> function success (midi) {
> mid=midi;
> inputs = midi.inputs.values();
> // inputs outputs are Iterators
> for (input = inputs.next(); input && !input.done; input = inputs.next()) {
> // each time there is a midi message call the onMIDIMessage function
> input.value.onmidimessage = onMIDIMessage;
> }
> InitTime= setInterval(init,1000);
> }
>
> function init(){
> clearInterval(InitTime);
> selectPorts();
> sendProgram();
> }
>
> function sendProgram(){
> //Set program on the track
> programC=document.getElementById("prog_sel").value;
> sysexC=192+channelC-1;
> output = mid.outputs.get(outportindex);
> settingChange = [sysexC,programC];
> output.send(settingChange);
> }
>
> function selectPorts(){
> outputs = mid.outputs.values();
> inputs = mid.inputs.values();
> for (output = outputs.next(); output && !output.done; output = outputs.next()) {
> var deviceOut = output.value.name;
> console.log(deviceOut);
> var optout = document.createElement("option");
> optout.text = deviceOut;
> document.getElementById("out_portsel").add(optout);
> }
> //output = mid.outputs.get(outportindex);
> for (input = inputs.next(); input && !input.done; input = inputs.next()) {
> var deviceIn = input.value.name;
> var optin = document.createElement("option");
> optin.text = deviceIn;
> document.getElementById("in_portsel").add(optin);
> }
https://3d16zci4vuzyxt8hxvovrg-on.drv.tw/Website/midi.html
Well here is the full code, you may have to reload to get ports initiated, of course you need some midi ports in/out.
As you may see there is an error when i try send messages to port, it isn't there in XP browser.
[toc] | [prev] | [next] | [standalone]
| From | Jonas Thörnvall <jonas.thornvall@gmail.com> |
|---|---|
| Date | 2018-05-21 02:24 -0700 |
| Message-ID | <5f588ffe-2a39-420b-9d84-289afd9d23ec@googlegroups.com> |
| In reply to | #35053 |
Den måndag 21 maj 2018 kl. 11:16:03 UTC+2 skrev Jonas Thörnvall:
> Den måndag 21 maj 2018 kl. 10:49:30 UTC+2 skrev Jonas Thörnvall:
> > I get errors when i run the code that slip thru on XP using windows 10, it is probably not the same version of browser and javascript API.
> >
> > TypeError: Cannot read property 'send' of undefined"
> >
> > Suddenly it says that the midi output port is not defined when i try to reach it, "there is more code but i just show the active where the fail occure.
> >
> > After ports are read in output should be defined, it is global? But i get error message when i try to send any type of message by using output.send() to port.
> >
> > Well it sure is defined when XP running the code, but it would be nice move over to windows 10.
> >
> > if (navigator.requestMIDIAccess) {
> > navigator.requestMIDIAccess()
> > .then(success, failure);
> > }
> >
> > function failure () {
> > console.error('No access to your midi devices.'+ + msg )
> > }
> >
> >
> > function success (midi) {
> > mid=midi;
> > inputs = midi.inputs.values();
> > // inputs outputs are Iterators
> > for (input = inputs.next(); input && !input.done; input = inputs.next()) {
> > // each time there is a midi message call the onMIDIMessage function
> > input.value.onmidimessage = onMIDIMessage;
> > }
> > InitTime= setInterval(init,1000);
> > }
> >
> > function init(){
> > clearInterval(InitTime);
> > selectPorts();
> > sendProgram();
> > }
> >
> > function sendProgram(){
> > //Set program on the track
> > programC=document.getElementById("prog_sel").value;
> > sysexC=192+channelC-1;
> > output = mid.outputs.get(outportindex);
> > settingChange = [sysexC,programC];
> > output.send(settingChange);
> > }
> >
> > function selectPorts(){
> > outputs = mid.outputs.values();
> > inputs = mid.inputs.values();
> > for (output = outputs.next(); output && !output.done; output = outputs.next()) {
> > var deviceOut = output.value.name;
> > console.log(deviceOut);
> > var optout = document.createElement("option");
> > optout.text = deviceOut;
> > document.getElementById("out_portsel").add(optout);
> > }
> > //output = mid.outputs.get(outportindex);
> > for (input = inputs.next(); input && !input.done; input = inputs.next()) {
> > var deviceIn = input.value.name;
> > var optin = document.createElement("option");
> > optin.text = deviceIn;
> > document.getElementById("in_portsel").add(optin);
> > }
>
> https://3d16zci4vuzyxt8hxvovrg-on.drv.tw/Website/midi.html
> Well here is the full code, you may have to reload to get ports initiated, of course you need some midi ports in/out.
>
> As you may see there is an error when i try send messages to port, it isn't there in XP browser.
I realise you guys probably do not have any midi in device, so it may be a bit hard to check.
[toc] | [prev] | [next] | [standalone]
| From | Jonas Thörnvall <jonas.thornvall@gmail.com> |
|---|---|
| Date | 2018-05-21 02:28 -0700 |
| Message-ID | <6862a231-cbdc-486e-8f74-efcbe20441ca@googlegroups.com> |
| In reply to | #35054 |
Den måndag 21 maj 2018 kl. 11:24:52 UTC+2 skrev Jonas Thörnvall:
> Den måndag 21 maj 2018 kl. 11:16:03 UTC+2 skrev Jonas Thörnvall:
> > Den måndag 21 maj 2018 kl. 10:49:30 UTC+2 skrev Jonas Thörnvall:
> > > I get errors when i run the code that slip thru on XP using windows 10, it is probably not the same version of browser and javascript API.
> > >
> > > TypeError: Cannot read property 'send' of undefined"
> > >
> > > Suddenly it says that the midi output port is not defined when i try to reach it, "there is more code but i just show the active where the fail occure.
> > >
> > > After ports are read in output should be defined, it is global? But i get error message when i try to send any type of message by using output.send() to port.
> > >
> > > Well it sure is defined when XP running the code, but it would be nice move over to windows 10.
> > >
> > > if (navigator.requestMIDIAccess) {
> > > navigator.requestMIDIAccess()
> > > .then(success, failure);
> > > }
> > >
> > > function failure () {
> > > console.error('No access to your midi devices.'+ + msg )
> > > }
> > >
> > >
> > > function success (midi) {
> > > mid=midi;
> > > inputs = midi.inputs.values();
> > > // inputs outputs are Iterators
> > > for (input = inputs.next(); input && !input.done; input = inputs.next()) {
> > > // each time there is a midi message call the onMIDIMessage function
> > > input.value.onmidimessage = onMIDIMessage;
> > > }
> > > InitTime= setInterval(init,1000);
> > > }
> > >
> > > function init(){
> > > clearInterval(InitTime);
> > > selectPorts();
> > > sendProgram();
> > > }
> > >
> > > function sendProgram(){
> > > //Set program on the track
> > > programC=document.getElementById("prog_sel").value;
> > > sysexC=192+channelC-1;
> > > output = mid.outputs.get(outportindex);
> > > settingChange = [sysexC,programC];
> > > output.send(settingChange);
> > > }
> > >
> > > function selectPorts(){
> > > outputs = mid.outputs.values();
> > > inputs = mid.inputs.values();
> > > for (output = outputs.next(); output && !output.done; output = outputs.next()) {
> > > var deviceOut = output.value.name;
> > > console.log(deviceOut);
> > > var optout = document.createElement("option");
> > > optout.text = deviceOut;
> > > document.getElementById("out_portsel").add(optout);
> > > }
> > > //output = mid.outputs.get(outportindex);
> > > for (input = inputs.next(); input && !input.done; input = inputs.next()) {
> > > var deviceIn = input.value.name;
> > > var optin = document.createElement("option");
> > > optin.text = deviceIn;
> > > document.getElementById("in_portsel").add(optin);
> > > }
> >
> > https://3d16zci4vuzyxt8hxvovrg-on.drv.tw/Website/midi.html
> > Well here is the full code, you may have to reload to get ports initiated, of course you need some midi ports in/out.
> >
> > As you may see there is an error when i try send messages to port, it isn't there in XP browser.
>
> I realise you guys probably do not have any midi in device, so it may be a bit hard to check.
I am not even sure that windows 10 show up outport Microsoft GS Wavetable synth, but there is a fix you can install Coolsoft midimapper to get Microsoft GS outport selectable.
[toc] | [prev] | [next] | [standalone]
| From | Jonas Thörnvall <jonas.thornvall@gmail.com> |
|---|---|
| Date | 2018-05-21 02:30 -0700 |
| Message-ID | <86651e85-36c2-47f5-bd07-162b1857c057@googlegroups.com> |
| In reply to | #35055 |
Den måndag 21 maj 2018 kl. 11:29:00 UTC+2 skrev Jonas Thörnvall:
> Den måndag 21 maj 2018 kl. 11:24:52 UTC+2 skrev Jonas Thörnvall:
> > Den måndag 21 maj 2018 kl. 11:16:03 UTC+2 skrev Jonas Thörnvall:
> > > Den måndag 21 maj 2018 kl. 10:49:30 UTC+2 skrev Jonas Thörnvall:
> > > > I get errors when i run the code that slip thru on XP using windows 10, it is probably not the same version of browser and javascript API.
> > > >
> > > > TypeError: Cannot read property 'send' of undefined"
> > > >
> > > > Suddenly it says that the midi output port is not defined when i try to reach it, "there is more code but i just show the active where the fail occure.
> > > >
> > > > After ports are read in output should be defined, it is global? But i get error message when i try to send any type of message by using output.send() to port.
> > > >
> > > > Well it sure is defined when XP running the code, but it would be nice move over to windows 10.
> > > >
> > > > if (navigator.requestMIDIAccess) {
> > > > navigator.requestMIDIAccess()
> > > > .then(success, failure);
> > > > }
> > > >
> > > > function failure () {
> > > > console.error('No access to your midi devices.'+ + msg )
> > > > }
> > > >
> > > >
> > > > function success (midi) {
> > > > mid=midi;
> > > > inputs = midi.inputs.values();
> > > > // inputs outputs are Iterators
> > > > for (input = inputs.next(); input && !input.done; input = inputs.next()) {
> > > > // each time there is a midi message call the onMIDIMessage function
> > > > input.value.onmidimessage = onMIDIMessage;
> > > > }
> > > > InitTime= setInterval(init,1000);
> > > > }
> > > >
> > > > function init(){
> > > > clearInterval(InitTime);
> > > > selectPorts();
> > > > sendProgram();
> > > > }
> > > >
> > > > function sendProgram(){
> > > > //Set program on the track
> > > > programC=document.getElementById("prog_sel").value;
> > > > sysexC=192+channelC-1;
> > > > output = mid.outputs.get(outportindex);
> > > > settingChange = [sysexC,programC];
> > > > output.send(settingChange);
> > > > }
> > > >
> > > > function selectPorts(){
> > > > outputs = mid.outputs.values();
> > > > inputs = mid.inputs.values();
> > > > for (output = outputs.next(); output && !output.done; output = outputs.next()) {
> > > > var deviceOut = output.value.name;
> > > > console.log(deviceOut);
> > > > var optout = document.createElement("option");
> > > > optout.text = deviceOut;
> > > > document.getElementById("out_portsel").add(optout);
> > > > }
> > > > //output = mid.outputs.get(outportindex);
> > > > for (input = inputs.next(); input && !input.done; input = inputs.next()) {
> > > > var deviceIn = input.value.name;
> > > > var optin = document.createElement("option");
> > > > optin.text = deviceIn;
> > > > document.getElementById("in_portsel").add(optin);
> > > > }
> > >
> > > https://3d16zci4vuzyxt8hxvovrg-on.drv.tw/Website/midi.html
> > > Well here is the full code, you may have to reload to get ports initiated, of course you need some midi ports in/out.
> > >
> > > As you may see there is an error when i try send messages to port, it isn't there in XP browser.
> >
> > I realise you guys probably do not have any midi in device, so it may be a bit hard to check.
>
> I am not even sure that windows 10 show up outport Microsoft GS Wavetable synth, but there is a fix you can install Coolsoft midimapper to get Microsoft GS outport selectable.
Well my midi interface shows up in both in and out and works....... ON XP
[toc] | [prev] | [next] | [standalone]
| From | "Evertjan." <exxjxw.hannivoort@inter.nl.net> |
|---|---|
| Date | 2018-05-21 12:13 +0200 |
| Message-ID | <XnsA8E97C6C37AA1eejj99@194.109.6.166> |
| In reply to | #35052 |
=?UTF-8?Q?Jonas_Th=C3=B6rnvall?= <jonas.thornvall@gmail.com> wrote on 21
May 2018 in comp.lang.javascript:
> I get errors when i run the code that slip thru on XP using windows 10,
> it is probably not the same version of browser and javascript API.
>
> TypeError: Cannot read property 'send' of undefined"
> function sendProgram(){
> //Set program on the track
> programC=document.getElementById("prog_sel").value;
> sysexC=192+channelC-1;
> output = mid.outputs.get(outportindex);
> settingChange = [sysexC,programC];
> output.send(settingChange);
>}
It means that 'output' is not defined here.
And that is because 'mid' is not defined in this function,
wouldn't you say?
'mid' surely is noty a global value,
as it is defined in another not-parenting function.
==============
Get into the habit of using 'let' and 'const'
in your code using 'use strict',
and hopefully you get earlier warning of such errors.
btw, why do you programme on an XP machine,
when W10 is within your reach?
Do you cut your firewood with a stone ax?
--
Evertjan.
The Netherlands.
(Please change the x'es to dots in my emailaddress)
[toc] | [prev] | [next] | [standalone]
| From | Jonas Thörnvall <jonas.thornvall@gmail.com> |
|---|---|
| Date | 2018-05-21 03:47 -0700 |
| Message-ID | <f1c723f8-0849-42ab-b86b-9d3a759ea007@googlegroups.com> |
| In reply to | #35057 |
Den måndag 21 maj 2018 kl. 12:13:56 UTC+2 skrev Evertjan.:
> =?UTF-8?Q?Jonas_Th=C3=B6rnvall?= <jonas.thornvall@gmail.com> wrote on 21
> May 2018 in comp.lang.javascript:
>
> > I get errors when i run the code that slip thru on XP using windows 10,
> > it is probably not the same version of browser and javascript API.
> >
> > TypeError: Cannot read property 'send' of undefined"
>
> > function sendProgram(){
> > //Set program on the track
> > programC=document.getElementById("prog_sel").value;
> > sysexC=192+channelC-1;
> > output = mid.outputs.get(outportindex);
> > settingChange = [sysexC,programC];
> > output.send(settingChange);
> >}
>
> It means that 'output' is not defined here.
>
> And that is because 'mid' is not defined in this function,
> wouldn't you say?
>
> 'mid' surely is noty a global value,
> as it is defined in another not-parenting function.
>
> ==============
>
> Get into the habit of using 'let' and 'const'
> in your code using 'use strict',
> and hopefully you get earlier warning of such errors.
>
> btw, why do you programme on an XP machine,
> when W10 is within your reach?
>
> Do you cut your firewood with a stone ax?
>
>
> --
> Evertjan.
> The Netherlands.
> (Please change the x'es to dots in my emailaddress)
Well i did see right away starting programming that midi "blackbox" was not global, i guess it is some object that tells there are midi "attached"?
Anyway it is hidden and i am a bit clueless about what it is, but it seem to be the main object. But i did mid=midi; and thought that the object? would be globally accessible.
And it did/do work in XP it makes a global copy of midi object?.
function success (midi) {
mid=midi;
inputs = midi.inputs.values();
// inputs outputs are Iterators
for (input = inputs.next(); input && !input.done; input = inputs.next()) {
// each time there is a midi message call the onMIDIMessage function
input.value.onmidimessage = onMIDIMessage;
}
InitTime= setInterval(init,1000);
}
But i have no idea howto go on if i can not have the midi "object?" accessible from other functions, could someone help me create a global "instance of the object?"
When it comes to variables, objects and their scope in javascript i am clueless. I do understand what a global and local variable is but that is basicly it.
Any thoughts why it did work in XP, and a little help howto move on would be appreciated. Because howto tackle the lack of scope of object is not apparent to me.
[toc] | [prev] | [next] | [standalone]
| From | Jonas Thörnvall <jonas.thornvall@gmail.com> |
|---|---|
| Date | 2018-05-21 03:48 -0700 |
| Message-ID | <eb284b8a-410c-473e-8089-e57e70458a2e@googlegroups.com> |
| In reply to | #35057 |
Den måndag 21 maj 2018 kl. 12:13:56 UTC+2 skrev Evertjan.:
> =?UTF-8?Q?Jonas_Th=C3=B6rnvall?= <jonas.thornvall@gmail.com> wrote on 21
> May 2018 in comp.lang.javascript:
>
> > I get errors when i run the code that slip thru on XP using windows 10,
> > it is probably not the same version of browser and javascript API.
> >
> > TypeError: Cannot read property 'send' of undefined"
>
> > function sendProgram(){
> > //Set program on the track
> > programC=document.getElementById("prog_sel").value;
> > sysexC=192+channelC-1;
> > output = mid.outputs.get(outportindex);
> > settingChange = [sysexC,programC];
> > output.send(settingChange);
> >}
>
> It means that 'output' is not defined here.
>
> And that is because 'mid' is not defined in this function,
> wouldn't you say?
> 'mid' surely is noty a global value,
So how can i define it and make mid global.
> as it is defined in another not-parenting function.
>
> ==============
>
> Get into the habit of using 'let' and 'const'
> in your code using 'use strict',
> and hopefully you get earlier warning of such errors.
>
> btw, why do you programme on an XP machine,
> when W10 is within your reach?
>
> Do you cut your firewood with a stone ax?
>
>
> --
> Evertjan.
> The Netherlands.
> (Please change the x'es to dots in my emailaddress)
[toc] | [prev] | [next] | [standalone]
| From | Jonas Thörnvall <jonas.thornvall@gmail.com> |
|---|---|
| Date | 2018-05-21 04:02 -0700 |
| Message-ID | <c4f8d9f8-a3d0-4a17-b2fd-726445c99164@googlegroups.com> |
| In reply to | #35057 |
Den måndag 21 maj 2018 kl. 12:13:56 UTC+2 skrev Evertjan.:
> =?UTF-8?Q?Jonas_Th=C3=B6rnvall?= <jonas.thornvall@gmail.com> wrote on 21
> May 2018 in comp.lang.javascript:
>
> > I get errors when i run the code that slip thru on XP using windows 10,
> > it is probably not the same version of browser and javascript API.
> >
> > TypeError: Cannot read property 'send' of undefined"
>
> > function sendProgram(){
> > //Set program on the track
> > programC=document.getElementById("prog_sel").value;
> > sysexC=192+channelC-1;
> > output = mid.outputs.get(outportindex);
> > settingChange = [sysexC,programC];
> > output.send(settingChange);
> >}
>
> It means that 'output' is not defined here.
>
> And that is because 'mid' is not defined in this function,
> wouldn't you say?
>
> 'mid' surely is noty a global value,
> as it is defined in another not-parenting function.
>
> ==============
>
> Get into the habit of using 'let' and 'const'
> in your code using 'use strict',
> and hopefully you get earlier warning of such errors.
>
> btw, why do you programme on an XP machine,
> when W10 is within your reach?
>
> Do you cut your firewood with a stone ax?
>
>
> --
> Evertjan.
> The Netherlands.
> (Please change the x'es to dots in my emailaddress)
No i have soundcards and programs that i use with synths on an old XP so i started program there because my hardware midi module "listening port" was there and it is nice because it also list audigy "PCI" wavetable synths as output ports.
But now i moved a USB keyboard and the midi music module hardware to the Windows 10 machine. I should of course started out programming on the windows 10 machine, i realise that.
How it basicly work is that you in my case select the midikeyboard "UMX490" as both input and output port, and then the UMX forward "midi thru" signal to the hardware midi module an old Roland Soundcanvas.
You could probably emulate a midikeyboard (inport) using character_keyboard or do some fancy canvasdrawing and map regions on mouseclick to a message mapping that is sent to the outport. But it will have to wait.
[toc] | [prev] | [next] | [standalone]
| From | Jonas Thörnvall <jonas.thornvall@gmail.com> |
|---|---|
| Date | 2018-05-21 04:24 -0700 |
| Message-ID | <b86980b5-3681-414c-87c7-3c8a23ef105a@googlegroups.com> |
| In reply to | #35057 |
Den måndag 21 maj 2018 kl. 12:13:56 UTC+2 skrev Evertjan.:
> =?UTF-8?Q?Jonas_Th=C3=B6rnvall?= <jonas.thornvall@gmail.com> wrote on 21
> May 2018 in comp.lang.javascript:
>
> > I get errors when i run the code that slip thru on XP using windows 10,
> > it is probably not the same version of browser and javascript API.
> >
> > TypeError: Cannot read property 'send' of undefined"
>
> > function sendProgram(){
> > //Set program on the track
> > programC=document.getElementById("prog_sel").value;
> > sysexC=192+channelC-1;
> > output = mid.outputs.get(outportindex);
> > settingChange = [sysexC,programC];
> > output.send(settingChange);
> >}
>
> It means that 'output' is not defined here.
>
> And that is because 'mid' is not defined in this function,
> wouldn't you say?
>
> 'mid' surely is noty a global value,
> as it is defined in another not-parenting function.
By the way what do you mean by not parenting function?
I try to understand could i use window.mid?
https://developer.mozilla.org/en-US/docs/Glossary/Global_object
>
> ==============
>
> Get into the habit of using 'let' and 'const'
> in your code using 'use strict',
> and hopefully you get earlier warning of such errors.
>
> btw, why do you programme on an XP machine,
> when W10 is within your reach?
>
> Do you cut your firewood with a stone ax?
>
>
> --
> Evertjan.
> The Netherlands.
> (Please change the x'es to dots in my emailaddress)
[toc] | [prev] | [next] | [standalone]
| From | Jonas Thörnvall <jonas.thornvall@gmail.com> |
|---|---|
| Date | 2018-05-21 04:46 -0700 |
| Message-ID | <9f7495e2-528f-47c2-86d4-fda88b87bfc9@googlegroups.com> |
| In reply to | #35061 |
Den måndag 21 maj 2018 kl. 13:24:29 UTC+2 skrev Jonas Thörnvall:
> Den måndag 21 maj 2018 kl. 12:13:56 UTC+2 skrev Evertjan.:
> > =?UTF-8?Q?Jonas_Th=C3=B6rnvall?= <jonas.thornvall@gmail.com> wrote on 21
> > May 2018 in comp.lang.javascript:
> >
> > > I get errors when i run the code that slip thru on XP using windows 10,
> > > it is probably not the same version of browser and javascript API.
> > >
> > > TypeError: Cannot read property 'send' of undefined"
> >
> > > function sendProgram(){
> > > //Set program on the track
> > > programC=document.getElementById("prog_sel").value;
> > > sysexC=192+channelC-1;
> > > output = mid.outputs.get(outportindex);
> > > settingChange = [sysexC,programC];
> > > output.send(settingChange);
> > >}
> >
> > It means that 'output' is not defined here.
> >
> > And that is because 'mid' is not defined in this function,
> > wouldn't you say?
> >
> > 'mid' surely is noty a global value,
> > as it is defined in another not-parenting function.
>
> By the way what do you mean by not parenting function?
>
> I try to understand could i use window.mid?
>
> https://developer.mozilla.org/en-US/docs/Glossary/Global_object
>
>
>
> >
> > ==============
> >
> > Get into the habit of using 'let' and 'const'
> > in your code using 'use strict',
> > and hopefully you get earlier warning of such errors.
> >
> > btw, why do you programme on an XP machine,
> > when W10 is within your reach?
> >
> > Do you cut your firewood with a stone ax?
> >
> >
> > --
> > Evertjan.
> > The Netherlands.
> > (Please change the x'es to dots in my emailaddress)
In short if anyone can show me howto access the midi object that i copied into mid from other functions, it would be nice.
[toc] | [prev] | [next] | [standalone]
| From | Jonas Thörnvall <jonas.thornvall@gmail.com> |
|---|---|
| Date | 2018-05-21 05:11 -0700 |
| Message-ID | <412057a0-04a2-4bff-aecd-0b5ce38fd86b@googlegroups.com> |
| In reply to | #35062 |
Den måndag 21 maj 2018 kl. 13:46:28 UTC+2 skrev Jonas Thörnvall:
> Den måndag 21 maj 2018 kl. 13:24:29 UTC+2 skrev Jonas Thörnvall:
> > Den måndag 21 maj 2018 kl. 12:13:56 UTC+2 skrev Evertjan.:
> > > =?UTF-8?Q?Jonas_Th=C3=B6rnvall?= <jonas.thornvall@gmail.com> wrote on 21
> > > May 2018 in comp.lang.javascript:
> > >
> > > > I get errors when i run the code that slip thru on XP using windows 10,
> > > > it is probably not the same version of browser and javascript API.
> > > >
> > > > TypeError: Cannot read property 'send' of undefined"
> > >
> > > > function sendProgram(){
> > > > //Set program on the track
> > > > programC=document.getElementById("prog_sel").value;
> > > > sysexC=192+channelC-1;
> > > > output = mid.outputs.get(outportindex);
> > > > settingChange = [sysexC,programC];
> > > > output.send(settingChange);
> > > >}
> > >
> > > It means that 'output' is not defined here.
> > >
> > > And that is because 'mid' is not defined in this function,
> > > wouldn't you say?
> > >
> > > 'mid' surely is noty a global value,
> > > as it is defined in another not-parenting function.
> >
> > By the way what do you mean by not parenting function?
> >
> > I try to understand could i use window.mid?
> >
> > https://developer.mozilla.org/en-US/docs/Glossary/Global_object
> >
> >
> >
> > >
> > > ==============
> > >
> > > Get into the habit of using 'let' and 'const'
> > > in your code using 'use strict',
> > > and hopefully you get earlier warning of such errors.
> > >
> > > btw, why do you programme on an XP machine,
> > > when W10 is within your reach?
> > >
> > > Do you cut your firewood with a stone ax?
> > >
> > >
> > > --
> > > Evertjan.
> > > The Netherlands.
> > > (Please change the x'es to dots in my emailaddress)
>
> In short if anyone can show me howto access the midi object that i copied into mid from other functions, it would be nice.
I think i can see where this is going do i really have
A(midi){B(midi){C(midi){D(midi)}}}}
If so who come up with that to be better then a global variable?
[toc] | [prev] | [next] | [standalone]
| From | Jonas Thörnvall <jonas.thornvall@gmail.com> |
|---|---|
| Date | 2018-05-21 05:21 -0700 |
| Message-ID | <b3b3548e-5448-4967-b70e-4cd4a757d6af@googlegroups.com> |
| In reply to | #35063 |
Den måndag 21 maj 2018 kl. 14:11:30 UTC+2 skrev Jonas Thörnvall:
> Den måndag 21 maj 2018 kl. 13:46:28 UTC+2 skrev Jonas Thörnvall:
> > Den måndag 21 maj 2018 kl. 13:24:29 UTC+2 skrev Jonas Thörnvall:
> > > Den måndag 21 maj 2018 kl. 12:13:56 UTC+2 skrev Evertjan.:
> > > > =?UTF-8?Q?Jonas_Th=C3=B6rnvall?= <jonas.thornvall@gmail.com> wrote on 21
> > > > May 2018 in comp.lang.javascript:
> > > >
> > > > > I get errors when i run the code that slip thru on XP using windows 10,
> > > > > it is probably not the same version of browser and javascript API.
> > > > >
> > > > > TypeError: Cannot read property 'send' of undefined"
> > > >
> > > > > function sendProgram(){
> > > > > //Set program on the track
> > > > > programC=document.getElementById("prog_sel").value;
> > > > > sysexC=192+channelC-1;
> > > > > output = mid.outputs.get(outportindex);
> > > > > settingChange = [sysexC,programC];
> > > > > output.send(settingChange);
> > > > >}
> > > >
> > > > It means that 'output' is not defined here.
> > > >
> > > > And that is because 'mid' is not defined in this function,
> > > > wouldn't you say?
> > > >
> > > > 'mid' surely is noty a global value,
> > > > as it is defined in another not-parenting function.
> > >
> > > By the way what do you mean by not parenting function?
> > >
> > > I try to understand could i use window.mid?
> > >
> > > https://developer.mozilla.org/en-US/docs/Glossary/Global_object
> > >
> > >
> > >
> > > >
> > > > ==============
> > > >
> > > > Get into the habit of using 'let' and 'const'
> > > > in your code using 'use strict',
> > > > and hopefully you get earlier warning of such errors.
> > > >
> > > > btw, why do you programme on an XP machine,
> > > > when W10 is within your reach?
> > > >
> > > > Do you cut your firewood with a stone ax?
> > > >
> > > >
> > > > --
> > > > Evertjan.
> > > > The Netherlands.
> > > > (Please change the x'es to dots in my emailaddress)
> >
> > In short if anyone can show me howto access the midi object that i copied into mid from other functions, it would be nice.
>
> I think i can see where this is going do i really have
> A(midi){B(midi){C(midi){D(midi)}}}}
>
> If so who come up with that to be better then a global variable?
No that strategy did not work either, should it?
How can i reach either my copied mid or the original midi object from other functions, further down in the function hierarchy see above?
[toc] | [prev] | [next] | [standalone]
| From | Jonas Thörnvall <jonas.thornvall@gmail.com> |
|---|---|
| Date | 2018-05-21 05:21 -0700 |
| Message-ID | <0f4ab2aa-42c8-4384-bcaf-5a26f18df4bd@googlegroups.com> |
| In reply to | #35064 |
Den måndag 21 maj 2018 kl. 14:21:26 UTC+2 skrev Jonas Thörnvall:
> Den måndag 21 maj 2018 kl. 14:11:30 UTC+2 skrev Jonas Thörnvall:
> > Den måndag 21 maj 2018 kl. 13:46:28 UTC+2 skrev Jonas Thörnvall:
> > > Den måndag 21 maj 2018 kl. 13:24:29 UTC+2 skrev Jonas Thörnvall:
> > > > Den måndag 21 maj 2018 kl. 12:13:56 UTC+2 skrev Evertjan.:
> > > > > =?UTF-8?Q?Jonas_Th=C3=B6rnvall?= <jonas.thornvall@gmail.com> wrote on 21
> > > > > May 2018 in comp.lang.javascript:
> > > > >
> > > > > > I get errors when i run the code that slip thru on XP using windows 10,
> > > > > > it is probably not the same version of browser and javascript API.
> > > > > >
> > > > > > TypeError: Cannot read property 'send' of undefined"
> > > > >
> > > > > > function sendProgram(){
> > > > > > //Set program on the track
> > > > > > programC=document.getElementById("prog_sel").value;
> > > > > > sysexC=192+channelC-1;
> > > > > > output = mid.outputs.get(outportindex);
> > > > > > settingChange = [sysexC,programC];
> > > > > > output.send(settingChange);
> > > > > >}
> > > > >
> > > > > It means that 'output' is not defined here.
> > > > >
> > > > > And that is because 'mid' is not defined in this function,
> > > > > wouldn't you say?
> > > > >
> > > > > 'mid' surely is noty a global value,
> > > > > as it is defined in another not-parenting function.
> > > >
> > > > By the way what do you mean by not parenting function?
> > > >
> > > > I try to understand could i use window.mid?
> > > >
> > > > https://developer.mozilla.org/en-US/docs/Glossary/Global_object
> > > >
> > > >
> > > >
> > > > >
> > > > > ==============
> > > > >
> > > > > Get into the habit of using 'let' and 'const'
> > > > > in your code using 'use strict',
> > > > > and hopefully you get earlier warning of such errors.
> > > > >
> > > > > btw, why do you programme on an XP machine,
> > > > > when W10 is within your reach?
> > > > >
> > > > > Do you cut your firewood with a stone ax?
> > > > >
> > > > >
> > > > > --
> > > > > Evertjan.
> > > > > The Netherlands.
> > > > > (Please change the x'es to dots in my emailaddress)
> > >
> > > In short if anyone can show me howto access the midi object that i copied into mid from other functions, it would be nice.
> >
> > I think i can see where this is going do i really have
> > A(midi){B(midi){C(midi){D(midi)}}}}
> >
> > If so who come up with that to be better then a global variable?
>
> No that strategy did not work either, should it?
> How can i reach either my copied mid or the original midi object from other functions, further down in the function hierarchy see above?
Why does it work in XP?
[toc] | [prev] | [next] | [standalone]
| From | Jonas Thörnvall <jonas.thornvall@gmail.com> |
|---|---|
| Date | 2018-05-21 05:27 -0700 |
| Message-ID | <a2076dd9-c025-45fe-82d7-053bb66f07e6@googlegroups.com> |
| In reply to | #35065 |
Den måndag 21 maj 2018 kl. 14:22:04 UTC+2 skrev Jonas Thörnvall:
> Den måndag 21 maj 2018 kl. 14:21:26 UTC+2 skrev Jonas Thörnvall:
> > Den måndag 21 maj 2018 kl. 14:11:30 UTC+2 skrev Jonas Thörnvall:
> > > Den måndag 21 maj 2018 kl. 13:46:28 UTC+2 skrev Jonas Thörnvall:
> > > > Den måndag 21 maj 2018 kl. 13:24:29 UTC+2 skrev Jonas Thörnvall:
> > > > > Den måndag 21 maj 2018 kl. 12:13:56 UTC+2 skrev Evertjan.:
> > > > > > =?UTF-8?Q?Jonas_Th=C3=B6rnvall?= <jonas.thornvall@gmail.com> wrote on 21
> > > > > > May 2018 in comp.lang.javascript:
> > > > > >
> > > > > > > I get errors when i run the code that slip thru on XP using windows 10,
> > > > > > > it is probably not the same version of browser and javascript API.
> > > > > > >
> > > > > > > TypeError: Cannot read property 'send' of undefined"
> > > > > >
> > > > > > > function sendProgram(){
> > > > > > > //Set program on the track
> > > > > > > programC=document.getElementById("prog_sel").value;
> > > > > > > sysexC=192+channelC-1;
> > > > > > > output = mid.outputs.get(outportindex);
> > > > > > > settingChange = [sysexC,programC];
> > > > > > > output.send(settingChange);
> > > > > > >}
> > > > > >
> > > > > > It means that 'output' is not defined here.
> > > > > >
> > > > > > And that is because 'mid' is not defined in this function,
> > > > > > wouldn't you say?
> > > > > >
> > > > > > 'mid' surely is noty a global value,
> > > > > > as it is defined in another not-parenting function.
> > > > >
> > > > > By the way what do you mean by not parenting function?
> > > > >
> > > > > I try to understand could i use window.mid?
> > > > >
> > > > > https://developer.mozilla.org/en-US/docs/Glossary/Global_object
> > > > >
> > > > >
> > > > >
> > > > > >
> > > > > > ==============
> > > > > >
> > > > > > Get into the habit of using 'let' and 'const'
> > > > > > in your code using 'use strict',
> > > > > > and hopefully you get earlier warning of such errors.
> > > > > >
> > > > > > btw, why do you programme on an XP machine,
> > > > > > when W10 is within your reach?
> > > > > >
> > > > > > Do you cut your firewood with a stone ax?
> > > > > >
> > > > > >
> > > > > > --
> > > > > > Evertjan.
> > > > > > The Netherlands.
> > > > > > (Please change the x'es to dots in my emailaddress)
> > > >
> > > > In short if anyone can show me howto access the midi object that i copied into mid from other functions, it would be nice.
> > >
> > > I think i can see where this is going do i really have
> > > A(midi){B(midi){C(midi){D(midi)}}}}
> > >
> > > If so who come up with that to be better then a global variable?
> >
> > No that strategy did not work either, should it?
> > How can i reach either my copied mid or the original midi object from other functions, further down in the function hierarchy see above?
>
> Why does it work in XP?
Should really parameters scope be an obstacle in programming LoL, it seem a nobrainer to have something in the language that let you define a global use of object.
Like take midi "well whatever that is" and make a global copy.
global mid=midi;
[toc] | [prev] | [next] | [standalone]
| From | Jonas Thörnvall <jonas.thornvall@gmail.com> |
|---|---|
| Date | 2018-05-21 05:30 -0700 |
| Message-ID | <eb2514e4-6dd6-4ab7-80c0-df7777b84d8f@googlegroups.com> |
| In reply to | #35066 |
Den måndag 21 maj 2018 kl. 14:27:39 UTC+2 skrev Jonas Thörnvall:
> Den måndag 21 maj 2018 kl. 14:22:04 UTC+2 skrev Jonas Thörnvall:
> > Den måndag 21 maj 2018 kl. 14:21:26 UTC+2 skrev Jonas Thörnvall:
> > > Den måndag 21 maj 2018 kl. 14:11:30 UTC+2 skrev Jonas Thörnvall:
> > > > Den måndag 21 maj 2018 kl. 13:46:28 UTC+2 skrev Jonas Thörnvall:
> > > > > Den måndag 21 maj 2018 kl. 13:24:29 UTC+2 skrev Jonas Thörnvall:
> > > > > > Den måndag 21 maj 2018 kl. 12:13:56 UTC+2 skrev Evertjan.:
> > > > > > > =?UTF-8?Q?Jonas_Th=C3=B6rnvall?= <jonas.thornvall@gmail.com> wrote on 21
> > > > > > > May 2018 in comp.lang.javascript:
> > > > > > >
> > > > > > > > I get errors when i run the code that slip thru on XP using windows 10,
> > > > > > > > it is probably not the same version of browser and javascript API.
> > > > > > > >
> > > > > > > > TypeError: Cannot read property 'send' of undefined"
> > > > > > >
> > > > > > > > function sendProgram(){
> > > > > > > > //Set program on the track
> > > > > > > > programC=document.getElementById("prog_sel").value;
> > > > > > > > sysexC=192+channelC-1;
> > > > > > > > output = mid.outputs.get(outportindex);
> > > > > > > > settingChange = [sysexC,programC];
> > > > > > > > output.send(settingChange);
> > > > > > > >}
> > > > > > >
> > > > > > > It means that 'output' is not defined here.
> > > > > > >
> > > > > > > And that is because 'mid' is not defined in this function,
> > > > > > > wouldn't you say?
> > > > > > >
> > > > > > > 'mid' surely is noty a global value,
> > > > > > > as it is defined in another not-parenting function.
> > > > > >
> > > > > > By the way what do you mean by not parenting function?
> > > > > >
> > > > > > I try to understand could i use window.mid?
> > > > > >
> > > > > > https://developer.mozilla.org/en-US/docs/Glossary/Global_object
> > > > > >
> > > > > >
> > > > > >
> > > > > > >
> > > > > > > ==============
> > > > > > >
> > > > > > > Get into the habit of using 'let' and 'const'
> > > > > > > in your code using 'use strict',
> > > > > > > and hopefully you get earlier warning of such errors.
> > > > > > >
> > > > > > > btw, why do you programme on an XP machine,
> > > > > > > when W10 is within your reach?
> > > > > > >
> > > > > > > Do you cut your firewood with a stone ax?
> > > > > > >
> > > > > > >
> > > > > > > --
> > > > > > > Evertjan.
> > > > > > > The Netherlands.
> > > > > > > (Please change the x'es to dots in my emailaddress)
> > > > >
> > > > > In short if anyone can show me howto access the midi object that i copied into mid from other functions, it would be nice.
> > > >
> > > > I think i can see where this is going do i really have
> > > > A(midi){B(midi){C(midi){D(midi)}}}}
> > > >
> > > > If so who come up with that to be better then a global variable?
> > >
> > > No that strategy did not work either, should it?
> > > How can i reach either my copied mid or the original midi object from other functions, further down in the function hierarchy see above?
> >
> > Why does it work in XP?
>
> Should really parameters scope be an obstacle in programming LoL, it seem a nobrainer to have something in the language that let you define a global use of object.
>
> Like take midi "well whatever that is" and make a global copy.
>
> global mid=midi;
Honestly, throw me a bone here how can i reach midi from other functions?
[toc] | [prev] | [next] | [standalone]
| From | Jonas Thörnvall <jonas.thornvall@gmail.com> |
|---|---|
| Date | 2018-05-21 05:48 -0700 |
| Message-ID | <cd35a9a4-d078-467b-8588-c210a9d2bf75@googlegroups.com> |
| In reply to | #35067 |
Den måndag 21 maj 2018 kl. 14:30:09 UTC+2 skrev Jonas Thörnvall:
> Den måndag 21 maj 2018 kl. 14:27:39 UTC+2 skrev Jonas Thörnvall:
> > Den måndag 21 maj 2018 kl. 14:22:04 UTC+2 skrev Jonas Thörnvall:
> > > Den måndag 21 maj 2018 kl. 14:21:26 UTC+2 skrev Jonas Thörnvall:
> > > > Den måndag 21 maj 2018 kl. 14:11:30 UTC+2 skrev Jonas Thörnvall:
> > > > > Den måndag 21 maj 2018 kl. 13:46:28 UTC+2 skrev Jonas Thörnvall:
> > > > > > Den måndag 21 maj 2018 kl. 13:24:29 UTC+2 skrev Jonas Thörnvall:
> > > > > > > Den måndag 21 maj 2018 kl. 12:13:56 UTC+2 skrev Evertjan.:
> > > > > > > > =?UTF-8?Q?Jonas_Th=C3=B6rnvall?= <jonas.thornvall@gmail.com> wrote on 21
> > > > > > > > May 2018 in comp.lang.javascript:
> > > > > > > >
> > > > > > > > > I get errors when i run the code that slip thru on XP using windows 10,
> > > > > > > > > it is probably not the same version of browser and javascript API.
> > > > > > > > >
> > > > > > > > > TypeError: Cannot read property 'send' of undefined"
> > > > > > > >
> > > > > > > > > function sendProgram(){
> > > > > > > > > //Set program on the track
> > > > > > > > > programC=document.getElementById("prog_sel").value;
> > > > > > > > > sysexC=192+channelC-1;
> > > > > > > > > output = mid.outputs.get(outportindex);
> > > > > > > > > settingChange = [sysexC,programC];
> > > > > > > > > output.send(settingChange);
> > > > > > > > >}
> > > > > > > >
> > > > > > > > It means that 'output' is not defined here.
> > > > > > > >
> > > > > > > > And that is because 'mid' is not defined in this function,
> > > > > > > > wouldn't you say?
> > > > > > > >
> > > > > > > > 'mid' surely is noty a global value,
> > > > > > > > as it is defined in another not-parenting function.
> > > > > > >
> > > > > > > By the way what do you mean by not parenting function?
> > > > > > >
> > > > > > > I try to understand could i use window.mid?
> > > > > > >
> > > > > > > https://developer.mozilla.org/en-US/docs/Glossary/Global_object
> > > > > > >
> > > > > > >
> > > > > > >
> > > > > > > >
> > > > > > > > ==============
> > > > > > > >
> > > > > > > > Get into the habit of using 'let' and 'const'
> > > > > > > > in your code using 'use strict',
> > > > > > > > and hopefully you get earlier warning of such errors.
> > > > > > > >
> > > > > > > > btw, why do you programme on an XP machine,
> > > > > > > > when W10 is within your reach?
> > > > > > > >
> > > > > > > > Do you cut your firewood with a stone ax?
> > > > > > > >
> > > > > > > >
> > > > > > > > --
> > > > > > > > Evertjan.
> > > > > > > > The Netherlands.
> > > > > > > > (Please change the x'es to dots in my emailaddress)
> > > > > >
> > > > > > In short if anyone can show me howto access the midi object that i copied into mid from other functions, it would be nice.
> > > > >
> > > > > I think i can see where this is going do i really have
> > > > > A(midi){B(midi){C(midi){D(midi)}}}}
> > > > >
> > > > > If so who come up with that to be better then a global variable?
> > > >
> > > > No that strategy did not work either, should it?
> > > > How can i reach either my copied mid or the original midi object from other functions, further down in the function hierarchy see above?
> > >
> > > Why does it work in XP?
> >
> > Should really parameters scope be an obstacle in programming LoL, it seem a nobrainer to have something in the language that let you define a global use of object.
> >
> > Like take midi "well whatever that is" and make a global copy.
> >
> > global mid=midi;
>
> Honestly, throw me a bone here how can i reach midi from other functions?
The lack of support for transition, make me think this will be an exclusive windows script for just XP owners. LoL
[toc] | [prev] | [next] | [standalone]
| From | Jonas Thörnvall <jonas.thornvall@gmail.com> |
|---|---|
| Date | 2018-05-21 08:13 -0700 |
| Message-ID | <89e77fe4-c0e4-4689-a095-2caefd594838@googlegroups.com> |
| In reply to | #35068 |
Den måndag 21 maj 2018 kl. 14:48:23 UTC+2 skrev Jonas Thörnvall:
> Den måndag 21 maj 2018 kl. 14:30:09 UTC+2 skrev Jonas Thörnvall:
> > Den måndag 21 maj 2018 kl. 14:27:39 UTC+2 skrev Jonas Thörnvall:
> > > Den måndag 21 maj 2018 kl. 14:22:04 UTC+2 skrev Jonas Thörnvall:
> > > > Den måndag 21 maj 2018 kl. 14:21:26 UTC+2 skrev Jonas Thörnvall:
> > > > > Den måndag 21 maj 2018 kl. 14:11:30 UTC+2 skrev Jonas Thörnvall:
> > > > > > Den måndag 21 maj 2018 kl. 13:46:28 UTC+2 skrev Jonas Thörnvall:
> > > > > > > Den måndag 21 maj 2018 kl. 13:24:29 UTC+2 skrev Jonas Thörnvall:
> > > > > > > > Den måndag 21 maj 2018 kl. 12:13:56 UTC+2 skrev Evertjan.:
> > > > > > > > > =?UTF-8?Q?Jonas_Th=C3=B6rnvall?= <jonas.thornvall@gmail.com> wrote on 21
> > > > > > > > > May 2018 in comp.lang.javascript:
> > > > > > > > >
> > > > > > > > > > I get errors when i run the code that slip thru on XP using windows 10,
> > > > > > > > > > it is probably not the same version of browser and javascript API.
> > > > > > > > > >
> > > > > > > > > > TypeError: Cannot read property 'send' of undefined"
> > > > > > > > >
> > > > > > > > > > function sendProgram(){
> > > > > > > > > > //Set program on the track
> > > > > > > > > > programC=document.getElementById("prog_sel").value;
> > > > > > > > > > sysexC=192+channelC-1;
> > > > > > > > > > output = mid.outputs.get(outportindex);
> > > > > > > > > > settingChange = [sysexC,programC];
> > > > > > > > > > output.send(settingChange);
> > > > > > > > > >}
> > > > > > > > >
> > > > > > > > > It means that 'output' is not defined here.
> > > > > > > > >
> > > > > > > > > And that is because 'mid' is not defined in this function,
> > > > > > > > > wouldn't you say?
> > > > > > > > >
> > > > > > > > > 'mid' surely is noty a global value,
> > > > > > > > > as it is defined in another not-parenting function.
> > > > > > > >
> > > > > > > > By the way what do you mean by not parenting function?
> > > > > > > >
> > > > > > > > I try to understand could i use window.mid?
> > > > > > > >
> > > > > > > > https://developer.mozilla.org/en-US/docs/Glossary/Global_object
> > > > > > > >
> > > > > > > >
> > > > > > > >
> > > > > > > > >
> > > > > > > > > ==============
> > > > > > > > >
> > > > > > > > > Get into the habit of using 'let' and 'const'
> > > > > > > > > in your code using 'use strict',
> > > > > > > > > and hopefully you get earlier warning of such errors.
> > > > > > > > >
> > > > > > > > > btw, why do you programme on an XP machine,
> > > > > > > > > when W10 is within your reach?
> > > > > > > > >
> > > > > > > > > Do you cut your firewood with a stone ax?
> > > > > > > > >
> > > > > > > > >
> > > > > > > > > --
> > > > > > > > > Evertjan.
> > > > > > > > > The Netherlands.
> > > > > > > > > (Please change the x'es to dots in my emailaddress)
> > > > > > >
> > > > > > > In short if anyone can show me howto access the midi object that i copied into mid from other functions, it would be nice.
> > > > > >
> > > > > > I think i can see where this is going do i really have
> > > > > > A(midi){B(midi){C(midi){D(midi)}}}}
> > > > > >
> > > > > > If so who come up with that to be better then a global variable?
> > > > >
> > > > > No that strategy did not work either, should it?
> > > > > How can i reach either my copied mid or the original midi object from other functions, further down in the function hierarchy see above?
> > > >
> > > > Why does it work in XP?
> > >
> > > Should really parameters scope be an obstacle in programming LoL, it seem a nobrainer to have something in the language that let you define a global use of object.
> > >
> > > Like take midi "well whatever that is" and make a global copy.
> > >
> > > global mid=midi;
> >
> > Honestly, throw me a bone here how can i reach midi from other functions?
>
> The lack of support for transition, make me think this will be an exclusive windows script for just XP owners. LoL
Here is the link again to the Html and .js files
https://3d16zci4vuzyxt8hxvovrg-on.drv.tw/Website/midi.html
[toc] | [prev] | [next] | [standalone]
| From | John G Harris <niam@jghnorth.org.uk.invalid> |
|---|---|
| Date | 2018-05-21 18:27 +0100 |
| Message-ID | <lb06gdp5u6mt3d8t17ntgffrp9hegrn1n9@4ax.com> |
| In reply to | #35066 |
On Mon, 21 May 2018 05:27:34 -0700 (PDT), Jonas Thörnvall <jonas.thornvall@gmail.com> wrote: <snip> >Like take midi "well whatever that is" and make a global copy. > >global mid=midi; It is not a copy. It is the same object which you can now access via a different name in a different scope. John
[toc] | [prev] | [next] | [standalone]
| From | Jonas Thörnvall <jonas.thornvall@gmail.com> |
|---|---|
| Date | 2018-05-21 12:42 -0700 |
| Message-ID | <2eef2bbd-45e3-41e9-9d3b-f715c540a304@googlegroups.com> |
| In reply to | #35070 |
Den måndag 21 maj 2018 kl. 19:27:32 UTC+2 skrev John G Harris: > On Mon, 21 May 2018 05:27:34 -0700 (PDT), Jonas Thörnvall > <jonas.thornvall@gmail.com> wrote: > > <snip> > >Like take midi "well whatever that is" and make a global copy. > > > >global mid=midi; > > It is not a copy. It is the same object which you can now access via a > different name in a different scope. > > John Yes but it doesn't work, does it? It somehow inherit some property that make it local. The real problem is i have no idea what midi on success object really is, i only see it is local to the success function. So for the 99th time how can i make it, or make a copy global, if not possible to make global how can i access it from a "sub function". So please John tell me how i change the scope of midi, or make a global copy like mid that is reachable from a subfunction.
[toc] | [prev] | [next] | [standalone]
Page 1 of 3 [1] 2 3 Next page →
Back to top | Article view | comp.lang.javascript
csiph-web