Groups | Search | Server Info | Keyboard shortcuts | Login | Register [http] [https] [nntp] [nntps]
Groups > comp.lang.javascript > #35140 > unrolled thread
| Started by | Jonas Thörnvall <jonas.thornvall@gmail.com> |
|---|---|
| First post | 2018-06-01 00:10 -0700 |
| Last post | 2018-06-01 10:49 -0700 |
| Articles | 9 on this page of 29 — 6 participants |
Back to article view | Back to comp.lang.javascript
Output not defined Jonas Thörnvall <jonas.thornvall@gmail.com> - 2018-06-01 00:10 -0700
Re: Output not defined "Evertjan." <exxjxw.hannivoort@inter.nl.net> - 2018-06-01 12:06 +0200
Re: Output not defined Jonas Thörnvall <jonas.thornvall@gmail.com> - 2018-06-01 03:33 -0700
Re: Output not defined "Evertjan." <exxjxw.hannivoort@inter.nl.net> - 2018-06-01 12:45 +0200
Re: Output not defined Jonas Thörnvall <jonas.thornvall@gmail.com> - 2018-06-01 03:49 -0700
Re: Output not defined "Evertjan." <exxjxw.hannivoort@inter.nl.net> - 2018-06-01 12:57 +0200
Re: Output not defined Ben Bacarisse <ben.usenet@bsb.me.uk> - 2018-06-01 17:54 +0100
Re: Output not defined Thomas 'PointedEars' Lahn <PointedEars@web.de> - 2018-06-01 19:10 +0200
Re: Output not defined Jonas Thörnvall <jonas.thornvall@gmail.com> - 2018-06-01 10:53 -0700
Re: Output not defined Jonas Thörnvall <jonas.thornvall@gmail.com> - 2018-06-01 13:24 -0700
Re: Output not defined Jonas Thörnvall <jonas.thornvall@gmail.com> - 2018-06-02 07:42 -0700
Re: Output not defined Jonas Thörnvall <jonas.thornvall@gmail.com> - 2018-06-02 07:57 -0700
Re: Output not defined Jonas Thörnvall <jonas.thornvall@gmail.com> - 2018-06-02 07:59 -0700
Re: Output not defined "Evertjan." <exxjxw.hannivoort@inter.nl.net> - 2018-06-02 18:05 +0200
Re: Output not defined Jonas Thörnvall <jonas.thornvall@gmail.com> - 2018-06-02 09:19 -0700
Re: Output not defined Jonas Thörnvall <jonas.thornvall@gmail.com> - 2018-06-02 09:28 -0700
Re: Output not defined Jonas Thörnvall <jonas.thornvall@gmail.com> - 2018-06-02 09:36 -0700
Re: Output not defined Jonas Thörnvall <jonas.thornvall@gmail.com> - 2018-06-02 09:49 -0700
Re: Output not defined Jonas Thörnvall <jonas.thornvall@gmail.com> - 2018-06-02 11:06 -0700
Re: Output not defined Jonas Thörnvall <jonas.thornvall@gmail.com> - 2018-06-02 11:18 -0700
Re: Output not defined Jonas Thörnvall <jonas.thornvall@gmail.com> - 2018-06-02 09:43 -0700
Re: Output not defined "Evertjan." <exxjxw.hannivoort@inter.nl.net> - 2018-06-02 22:44 +0200
Re: Output not defined Jonas Thörnvall <jonas.thornvall@gmail.com> - 2018-06-03 04:36 -0700
Re: Output not defined Jonas Thörnvall <jonas.thornvall@gmail.com> - 2018-06-03 04:53 -0700
Re: Output not defined John G Harris <niam@jghnorth.org.uk.invalid> - 2018-06-03 15:06 +0100
Re: Output not defined Jonas Thörnvall <jonas.thornvall@gmail.com> - 2018-06-03 11:01 -0700
Re: Output not defined Jonas Thörnvall <jonas.thornvall@gmail.com> - 2018-06-03 11:09 -0700
Re: Output not defined Jake Jarvis <pig_in_shoes@yahoo.com> - 2018-06-01 15:03 +0200
Re: Output not defined Jonas Thörnvall <jonas.thornvall@gmail.com> - 2018-06-01 10:49 -0700
Page 2 of 2 — ← Prev page 1 [2]
| From | Jonas Thörnvall <jonas.thornvall@gmail.com> |
|---|---|
| Date | 2018-06-02 09:43 -0700 |
| Message-ID | <ef0c8c14-1ac2-4e35-b56f-d93ae25f69aa@googlegroups.com> |
| In reply to | #35159 |
Den lördag 2 juni 2018 kl. 18:06:02 UTC+2 skrev Evertjan.:
> =?UTF-8?Q?Jonas_Th=C3=B6rnvall?= <jonas.thornvall@gmail.com> wrote on 02 Jun
> 2018 in comp.lang.javascript:
>
> > function success (midi) {
> > mid=midi;
>
> [Why not just use midi, mid is not needed???]
>
> You should test mid here!!!!
> If mid is not the object you need, the testing of the rest is nonsense.
>
> console.log( 'What is the type of mid?', typeof mid );
>
> > inputs = mid.inputs.values();
>
> now test for mid.inputs:
>
> console.log( 'What is the type of mid.inputs?', typeof mid.inputs );
>
>
> > portout = mid.outputs.values();
>
> now test for mid.outputs:
>
> console.log( 'What is the type of mid.outputs?', typeof mid.outputs );
>
> > console.log("Undefined value?="+inputs[0]); //outputs undefined
>
> wrong remark!!!
>
> > console.log("Undefined value?="+portout[0]); //outputs undefined
>
>
>
>
>
> --
> Evertjan.
> The Netherlands.
> (Please change the x'es to dots in my emailaddress)
When you started this shitlanguage was not the idea that is should be declarative and not a black box, and now there is so many anal ENTP's in the project that is start to to back to a fucking EMAC synstax?
What the fuck is up with that if you wanted the fucking EMACS syntax you could kept on going with PERL?
And do not come say it has to be like this.
[toc] | [prev] | [next] | [standalone]
| From | "Evertjan." <exxjxw.hannivoort@inter.nl.net> |
|---|---|
| Date | 2018-06-02 22:44 +0200 |
| Message-ID | <XnsA8F5E76144BF7eejj99@194.109.6.166> |
| In reply to | #35163 |
<jonas.thornvall@gmail.com> wrote on 02 Jun 2018 in comp.lang.javascript: > When you started this shitlanguage was not the idea that is should be > declarative and not a black box, and now there is so many anal ENTP's in > the project that is start to to back to a fucking EMAC synstax? > > What the fuck is up with that if you wanted the fucking EMACS syntax you > could kept on going with PERL? > > And do not come say it has to be like this. Seems to me you are drunk. -- 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-06-03 04:36 -0700 |
| Message-ID | <27e2f910-a1b9-4f12-8931-03770050d99f@googlegroups.com> |
| In reply to | #35170 |
Den lördag 2 juni 2018 kl. 22:44:50 UTC+2 skrev Evertjan.: > <jonas.thornvall@gmail.com> wrote on 02 > Jun 2018 in comp.lang.javascript: > > > When you started this shitlanguage was not the idea that is should be > > declarative and not a black box, and now there is so many anal ENTP's in > > the project that is start to to back to a fucking EMAC synstax? > > > > What the fuck is up with that if you wanted the fucking EMACS syntax you > > could kept on going with PERL? > > > > And do not come say it has to be like this. > > Seems to me you are drunk. > > -- > Evertjan. > The Netherlands. > (Please change the x'es to dots in my emailaddress) Seem to me i was correct when drunk.
[toc] | [prev] | [next] | [standalone]
| From | Jonas Thörnvall <jonas.thornvall@gmail.com> |
|---|---|
| Date | 2018-06-03 04:53 -0700 |
| Message-ID | <69da0381-e764-45ae-b90b-1671efaa459d@googlegroups.com> |
| In reply to | #35170 |
Den lördag 2 juni 2018 kl. 22:44:50 UTC+2 skrev Evertjan.: > <jonas.thornvall@gmail.com> wrote on 02 > Jun 2018 in comp.lang.javascript: > > > When you started this shitlanguage was not the idea that is should be > > declarative and not a black box, and now there is so many anal ENTP's in > > the project that is start to to back to a fucking EMAC synstax? > > > > What the fuck is up with that if you wanted the fucking EMACS syntax you > > could kept on going with PERL? > > > > And do not come say it has to be like this. > > Seems to me you are drunk. > > -- > Evertjan. > The Netherlands. > (Please change the x'es to dots in my emailaddress) I mean my question/problem is not incredibly deep, so i guess you know the answer to it. It is a question about the scope of output, and what the syntax is to make the midiaccess thingy global. Because it sure is global in some browsers. But somewhere on the way some ENTP guy decided this needs a little extra parameters... It has to be called in a different manner... You have to instantiate the thing all over.... You probably should read the 10 page manual on howto access the midiobject i wrote.... To make it work you should stand on one leg put a finger in your butthole,"but only after you greased your body with cocoa oil and suck on a lollipop" Now if you extend text above 10 pages you probably come close to how one initiate the midiobject as global accessible. But the procedures are written backwards by the ENTP, to conform to first in last out principles. You have to attach the papers to a monowheel and spinn it backwards at 33 rpm to get the instructions to come out in correct order. Then you can parse them and reverse them using a mirror and paperclips. Now you are almost there you just have to backtrack the sum of the parameter calls and add 4 to comply with ENTP prefered checksum compability.
[toc] | [prev] | [next] | [standalone]
| From | John G Harris <niam@jghnorth.org.uk.invalid> |
|---|---|
| Date | 2018-06-03 15:06 +0100 |
| Message-ID | <5dt7hdl9fvapmmb10jdh743uem07glac3l@4ax.com> |
| In reply to | #35174 |
On Sun, 3 Jun 2018 04:53:09 -0700 (PDT), Jonas Thörnvall <jonas.thornvall@gmail.com> wrote: <snip> >It is a question ... >what the syntax is to make the midiaccess thingy global. <snip> Question 1: Have you checked that there is a global variable declaration, such as var global_thingy; that is outside *every* function ? Queston 2: Have you checked that you do an assignment, such as global_thingy = midiaccess_thingy; somewhere the midiaccess thingy can be accessed ? If you don't tell us the answer to these questions we will have to assume that you really, really don't want your code to work. John
[toc] | [prev] | [next] | [standalone]
| From | Jonas Thörnvall <jonas.thornvall@gmail.com> |
|---|---|
| Date | 2018-06-03 11:01 -0700 |
| Message-ID | <e3ebb67d-17e0-4898-bc18-13cafe30486a@googlegroups.com> |
| In reply to | #35175 |
Den söndag 3 juni 2018 kl. 16:06:16 UTC+2 skrev John G Harris:
> On Sun, 3 Jun 2018 04:53:09 -0700 (PDT), Jonas Thörnvall
> <jonas.thornvall@gmail.com> wrote:
>
> <snip>
> >It is a question
> ...
> >what the syntax is to make the midiaccess thingy global.
> <snip>
>
> Question 1:
> Have you checked that there is a global variable declaration, such as
> var global_thingy;
> that is outside *every* function ?
>
> Queston 2:
> Have you checked that you do an assignment, such as
> global_thingy = midiaccess_thingy;
> somewhere the midiaccess thingy can be accessed ?
>
> If you don't tell us the answer to these questions we will have to
> assume that you really, really don't want your code to work.
>
> John
Yes if my understanding of global variables declared outside functions is correct. The "midi" object is created on success by the web midi api, and then i do "mid=midi". I thought that should be it. mid is declared global see below.
Below is the midiAccess portinitiation "midiportinit.js" file.
var output;var input;var inputs;var outputs;var mid;
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 = mid.inputs.values();
console.log("Undefined value?="+inputs[0]);
// 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;
}
}
function selectPorts(){
portout = mid.outputs.values();
portin = mid.inputs.values();
console.log("Undefined value?="+portin[0]); //outputs undefined
console.log("Undefined value?="+portout[0]); //outputs undefined
for (output = portout.next(); output && !output.done; output = portout.next()) {
var deviceOut = output.value.name;
//console.log(deviceOut);
var optout = document.createElement("option");
optout.text = deviceOut;
document.getElementById("out_portsel").add(optout);
}
for (input = portin.next(); input && !input.done; input = portin.next()) {
var deviceIn = input.value.name;
var optin = document.createElement("option");
optin.text = deviceIn;
document.getElementById("in_portsel").add(optin);
}
}
[toc] | [prev] | [next] | [standalone]
| From | Jonas Thörnvall <jonas.thornvall@gmail.com> |
|---|---|
| Date | 2018-06-03 11:09 -0700 |
| Message-ID | <b4a5227f-5037-419d-a3c5-d8eadc294b08@googlegroups.com> |
| In reply to | #35175 |
Den söndag 3 juni 2018 kl. 16:06:16 UTC+2 skrev John G Harris: > On Sun, 3 Jun 2018 04:53:09 -0700 (PDT), Jonas Thörnvall > <jonas.thornvall@gmail.com> wrote: > > <snip> > >It is a question > ... > >what the syntax is to make the midiaccess thingy global. > <snip> > > Question 1: > Have you checked that there is a global variable declaration, such as > var global_thingy; > that is outside *every* function ? > > Queston 2: > Have you checked that you do an assignment, such as > global_thingy = midiaccess_thingy; > somewhere the midiaccess thingy can be accessed ? > > If you don't tell us the answer to these questions we will have to > assume that you really, really don't want your code to work. > > John And code is here. https://3d16zci4vuzyxt8hxvovrg-on.drv.tw/Website/sequenser.html
[toc] | [prev] | [next] | [standalone]
| From | Jake Jarvis <pig_in_shoes@yahoo.com> |
|---|---|
| Date | 2018-06-01 15:03 +0200 |
| Message-ID | <perg6m$osj$1@dont-email.me> |
| In reply to | #35140 |
Am 01.06.2018 um 09:10 schrieb Jonas Thörnvall:
> I've looked upon this for a week or two, and i just can't figure out why output is not defined. Maybe it is because it works without problem when running browser in XP that make me confused.
>
> https://3d16zci4vuzyxt8hxvovrg-on.drv.tw/Website/midi.html
>
> Any help or even suggestion would be greatly appreciated.
>
UI.js:98 Uncaught TypeError: Cannot read property 'send' of undefined
| output = mid.outputs.get(outportindex);
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
| console.log("outportindex="+outportindex);
| console.log("output"+output);
| settingChange = [sysexC,programC];
| output.send(settingChange); // line 98
what is mid.outputs.size?
[toc] | [prev] | [next] | [standalone]
| From | Jonas Thörnvall <jonas.thornvall@gmail.com> |
|---|---|
| Date | 2018-06-01 10:49 -0700 |
| Message-ID | <26d16cf7-5a73-416b-8315-149cb14bd820@googlegroups.com> |
| In reply to | #35150 |
Den fredag 1 juni 2018 kl. 15:03:23 UTC+2 skrev Jake Jarvis:
> Am 01.06.2018 um 09:10 schrieb Jonas Thörnvall:
> > I've looked upon this for a week or two, and i just can't figure out why output is not defined. Maybe it is because it works without problem when running browser in XP that make me confused.
> >
> > https://3d16zci4vuzyxt8hxvovrg-on.drv.tw/Website/midi.html
> >
> > Any help or even suggestion would be greatly appreciated.
> >
>
> UI.js:98 Uncaught TypeError: Cannot read property 'send' of undefined
>
> | output = mid.outputs.get(outportindex);
> ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
> | console.log("outportindex="+outportindex);
> | console.log("output"+output);
> | settingChange = [sysexC,programC];
> | output.send(settingChange); // line 98
>
> what is mid.outputs.size?
Well output is the port selected in outputport, you grab it with using get and the index, it is part of the midi object that is created on success of requestMIDIAccess. It is not something that i created i just loop in the values "portnames" so when you send a message it require the port for some reason the port is defined in windows XP and it is definitly read in because it is within the portlist. I am not sure what is going on if it try to reach port before port read in but it should not i have a timeout so the ports available before i continue.
tracknr=1;outportindex=0;programC=16;channelC=1;
var track=[];midiMess=[];t0=0;x=0;textout="";midievent=0;
recordmidi=false;playmidi=false;midimessage=false;
echo=false;clock=0;listTr="";mode="Listen";rs=0;
Rstarttime=0;var output;var input;var inputs;var outputs;
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 = mid.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;
}
}
function scriptOnload(){
InitTime= setInterval(init,2400);
}
function selectPorts(){
portout = mid.outputs.values();
portin = mid.inputs.values();
for (output = portout.next(); output && !output.done; output = portout.next()) {
var deviceOut = output.value.name;
//console.log(deviceOut);
var optout = document.createElement("option");
optout.text = deviceOut;
document.getElementById("out_portsel").add(optout);
}
for (input = portin.next(); input && !input.done; input = portin.next()) {
var deviceIn = input.value.name;
var optin = document.createElement("option");
optin.text = deviceIn;
document.getElementById("in_portsel").add(optin);
}
}
[toc] | [prev] | [standalone]
Page 2 of 2 — ← Prev page 1 [2]
Back to top | Article view | comp.lang.javascript
csiph-web