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


Groups > comp.lang.javascript > #35052 > unrolled thread

Script work with windows XP, "opera,chrome" but not in Windows 10 something changed in the midi API?

Started byJonas Thörnvall <jonas.thornvall@gmail.com>
First post2018-05-21 01:49 -0700
Last post2018-05-22 10:11 +0200
Articles 20 on this page of 46 — 3 participants

Back to article view | Back to comp.lang.javascript


Contents

  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 2 of 3 — ← Prev page 1 [2] 3  Next page →


#35072

FromJonas Thörnvall <jonas.thornvall@gmail.com>
Date2018-05-21 12:53 -0700
Message-ID<d1ae1b33-1af4-4824-9ba6-a66e0d59ce89@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

What is also interesting is how come mid=midi; create a global reachable object in windows XP's latest updated browsers, but create a local in windows 10?

https://3d16zci4vuzyxt8hxvovrg-on.drv.tw/Website/midi.html 


[toc] | [prev] | [next] | [standalone]


#35073

FromJonas Thörnvall <jonas.thornvall@gmail.com>
Date2018-05-21 12:58 -0700
Message-ID<d061aa60-fd9f-4be0-aef2-14d0ce0b240b@googlegroups.com>
In reply to#35072
Den måndag 21 maj 2018 kl. 21:53:08 UTC+2 skrev Jonas Thörnvall:
> 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
> 
> What is also interesting is how come mid=midi; create a global reachable object in windows XP's latest updated browsers, but create a local in windows 10?
> 
> https://3d16zci4vuzyxt8hxvovrg-on.drv.tw/Website/midi.html

If it is obvious so please tell me, because i do not even know what the midi object on success are i just see it has ports and a message "property?" and try to use it accordingly to the few examples i find. 

To me it is a blackbox, and how come a copy of midi "mid" is global reachable in one OS and not in another i just do not understand?

So if it obvious howto get mid and outputs ports reachable global, just show me.

[toc] | [prev] | [next] | [standalone]


#35074

FromJonas Thörnvall <jonas.thornvall@gmail.com>
Date2018-05-21 13:07 -0700
Message-ID<4787eb57-159d-4e41-9fb9-0b7ce59e60ad@googlegroups.com>
In reply to#35073
Den måndag 21 maj 2018 kl. 21:58:58 UTC+2 skrev Jonas Thörnvall:
> Den måndag 21 maj 2018 kl. 21:53:08 UTC+2 skrev Jonas Thörnvall:
> > 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
> > 
> > What is also interesting is how come mid=midi; create a global reachable object in windows XP's latest updated browsers, but create a local in windows 10?
> > 
> > https://3d16zci4vuzyxt8hxvovrg-on.drv.tw/Website/midi.html
> 
> If it is obvious so please tell me, because i do not even know what the midi object on success are i just see it has ports and a message "property?" and try to use it accordingly to the few examples i find. 
> 
> To me it is a blackbox, and how come a copy of midi "mid" is global reachable in one OS and not in another i just do not understand?
> 
> So if it obvious howto get mid and outputs ports reachable global, just show me.

As you may have seen windows 10 gives *error message when* i try to send messages to mid output. Because apparently the mid object is not reachable global, and i do not know howto tackle it.

Uncaught TypeError: Cannot read property 'outputs' of undefined
    at sendProgram (UI.js:77)
    at setTrack (UI.js:43)
    at init (mainmidi.js:55)

[toc] | [prev] | [next] | [standalone]


#35075

From"Evertjan." <exxjxw.hannivoort@inter.nl.net>
Date2018-05-21 23:42 +0200
Message-ID<XnsA8E9F11CCEB35eejj99@194.109.6.166>
In reply to#35074
=?UTF-8?Q?Jonas_Th=C3=B6rnvall?= <jonas.thornvall@gmail.com> wrote on 21
May 2018 in comp.lang.javascript: 

> As you may have seen windows 10 gives *error message when* i try to send
> messages to mid output. Because apparently the mid object is not
> reachable global, and i do not know howto tackle it. 

If you declare a variable name in the global scope,
with

let mid;

or 

var mid;

you can later assign your [non global yet] object to it:

mid =  midi;

===============================

This all very basic stuff, meseems,
and easily debuggable, 
perhaps by temporarily assigning it to a fake object.

Split up code into debuggable modules.

Please start thinking modular and debuggy,
do not ask us to review code that you do not understand yourself.


-- 
Evertjan.
The Netherlands.
(Please change the x'es to dots in my emailaddress)

[toc] | [prev] | [next] | [standalone]


#35076

FromJonas Thörnvall <jonas.thornvall@gmail.com>
Date2018-05-21 21:53 -0700
Message-ID<893fb9cb-ed75-454f-a06a-e9ad01df2ba7@googlegroups.com>
In reply to#35075
Den måndag 21 maj 2018 kl. 23:42:17 UTC+2 skrev Evertjan.:
> =?UTF-8?Q?Jonas_Th=C3=B6rnvall?= <jonas.thornvall@gmail.com> wrote on 21
> May 2018 in comp.lang.javascript: 
> 
> > As you may have seen windows 10 gives *error message when* i try to send
> > messages to mid output. Because apparently the mid object is not
> > reachable global, and i do not know howto tackle it. 
> 
> If you declare a variable name in the global scope,
> with
> 
> let mid;
> 
> or 
> 
> var mid;
> 
> you can later assign your [non global yet] object to it:
> 
> mid =  midi;
> 
> ===============================
> 
> This all very basic stuff, meseems,
> and easily debuggable, 
> perhaps by temporarily assigning it to a fake object.
> 
> Split up code into debuggable modules.
> 
> Please start thinking modular and debuggy,
> do not ask us to review code that you do not understand yourself.
> 
> 
> -- 
> Evertjan.
> The Netherlands.
> (Please change the x'es to dots in my emailaddress)

Well Janevert i followed your suggestion, and declared var midi; var mid; varoutputs; as global variables in mainmidi.js it had no effect what so ever.

See:
https://3d16zci4vuzyxt8hxvovrg-on.drv.tw/Website/midi.html

[toc] | [prev] | [next] | [standalone]


#35086

From"Evertjan." <exxjxw.hannivoort@inter.nl.net>
Date2018-05-22 10:11 +0200
Message-ID<XnsA8EA67980BBC8eejj99@194.109.6.166>
In reply to#35076
<jonas.thornvall@gmail.com> wrote on 22
May 2018 in comp.lang.javascript: 

>> Evertjan.
>> The Netherlands.
> 
> Well Janevert 

I consider this impolite, that is NOT my name!

> i followed your suggestion, and declared var midi; var
> mid; varoutputs; as global variables in mainmidi.js it had no effect
> what so ever. 

That is NOT my advice, my primary advice was GO DEBUGGING,
so look at every logical position in your script,
what the content of midi is,
for instance by inserting multiple:

console.log(midi);

or by using breakpoints.

THEN you will see why and where and when midi is not an object.

AND THEN you will be able to understand and correct your code.

> See:
> https://3d16zci4vuzyxt8hxvovrg-on.drv.tw/Website/midi.html

I will not.

-- 
Evertjan.
The Netherlands.
(Please change the x'es to dots in my emailaddress)

[toc] | [prev] | [next] | [standalone]


#35077

FromJonas Thörnvall <jonas.thornvall@gmail.com>
Date2018-05-21 22:02 -0700
Message-ID<fa0fe321-5135-40eb-a487-0ac33dd7e0d5@googlegroups.com>
In reply to#35075
Den måndag 21 maj 2018 kl. 23:42:17 UTC+2 skrev Evertjan.:
> =?UTF-8?Q?Jonas_Th=C3=B6rnvall?= <jonas.thornvall@gmail.com> wrote on 21
> May 2018 in comp.lang.javascript: 
> 
> > As you may have seen windows 10 gives *error message when* i try to send
> > messages to mid output. Because apparently the mid object is not
> > reachable global, and i do not know howto tackle it. 
> 
> If you declare a variable name in the global scope,
> with
> 
> let mid;
> 
> or 
> 
> var mid;
> 
> you can later assign your [non global yet] object to it:
> 
> mid =  midi;
> 
> ===============================
> 
> This all very basic stuff, meseems,
> and easily debuggable, 
> perhaps by temporarily assigning it to a fake object.
> 
> Split up code into debuggable modules.
> 
> Please start thinking modular and debuggy,
> do not ask us to review code that you do not understand yourself.
> 
> 
> -- 
> Evertjan.
> The Netherlands.
> (Please change the x'es to dots in my emailaddress)

But the code do work in windows XP, Janevert i can not see why it do not in Windows 10. That the on midi success object "midi" object is a bit elusive is more about its documentation very scarse. The problem with it seem rather general just as you say, so my question is why does it not work. 

Now i declared var midi,var mid,var outputs as global *outside any function*** in mainmidi.js but the error message persist.

UI.js:77 Uncaught TypeError: Cannot read property 'outputs' of undefined
    at sendProgram (UI.js:77)
    at setTrack (UI.js:43)
    at init (mainmidi.js:58)

[toc] | [prev] | [next] | [standalone]


#35078

FromJonas Thörnvall <jonas.thornvall@gmail.com>
Date2018-05-21 23:09 -0700
Message-ID<6fda3323-0b5f-4086-b720-f8e4da1a03de@googlegroups.com>
In reply to#35077
Den tisdag 22 maj 2018 kl. 07:02:29 UTC+2 skrev Jonas Thörnvall:
> Den måndag 21 maj 2018 kl. 23:42:17 UTC+2 skrev Evertjan.:
> > =?UTF-8?Q?Jonas_Th=C3=B6rnvall?= <jonas.thornvall@gmail.com> wrote on 21
> > May 2018 in comp.lang.javascript: 
> > 
> > > As you may have seen windows 10 gives *error message when* i try to send
> > > messages to mid output. Because apparently the mid object is not
> > > reachable global, and i do not know howto tackle it. 
> > 
> > If you declare a variable name in the global scope,
> > with
> > 
> > let mid;
> > 
> > or 
> > 
> > var mid;
> > 
> > you can later assign your [non global yet] object to it:
> > 
> > mid =  midi;
> > 
> > ===============================
> > 
> > This all very basic stuff, meseems,
> > and easily debuggable, 
> > perhaps by temporarily assigning it to a fake object.
> > 
> > Split up code into debuggable modules.
> > 
> > Please start thinking modular and debuggy,
> > do not ask us to review code that you do not understand yourself.
> > 
> > 
> > -- 
> > Evertjan.
> > The Netherlands.
> > (Please change the x'es to dots in my emailaddress)
> 
> But the code do work in windows XP, Janevert i can not see why it do not in Windows 10. That the on midi success object "midi" object is a bit elusive is more about its documentation very scarse. The problem with it seem rather general just as you say, so my question is why does it not work. 
> 
> Now i declared var midi,var mid,var outputs as global *outside any function*** in mainmidi.js but the error message persist.
> 
> UI.js:77 Uncaught TypeError: Cannot read property 'outputs' of undefined
>     at sendProgram (UI.js:77)
>     at setTrack (UI.js:43)
>     at init (mainmidi.js:58)

Sorry about Janevert, Evertjan it is just the syndrom of when something eventually stick, it is stuck whether it is right or wrong.

[toc] | [prev] | [next] | [standalone]


#35079

FromJonas Thörnvall <jonas.thornvall@gmail.com>
Date2018-05-21 23:50 -0700
Message-ID<176ec780-459b-4a46-907f-989b20ce783e@googlegroups.com>
In reply to#35078
Den tisdag 22 maj 2018 kl. 08:09:37 UTC+2 skrev Jonas Thörnvall:
> Den tisdag 22 maj 2018 kl. 07:02:29 UTC+2 skrev Jonas Thörnvall:
> > Den måndag 21 maj 2018 kl. 23:42:17 UTC+2 skrev Evertjan.:
> > > =?UTF-8?Q?Jonas_Th=C3=B6rnvall?= <jonas.thornvall@gmail.com> wrote on 21
> > > May 2018 in comp.lang.javascript: 
> > > 
> > > > As you may have seen windows 10 gives *error message when* i try to send
> > > > messages to mid output. Because apparently the mid object is not
> > > > reachable global, and i do not know howto tackle it. 
> > > 
> > > If you declare a variable name in the global scope,
> > > with
> > > 
> > > let mid;
> > > 
> > > or 
> > > 
> > > var mid;
> > > 
> > > you can later assign your [non global yet] object to it:
> > > 
> > > mid =  midi;
> > > 
> > > ===============================
> > > 
> > > This all very basic stuff, meseems,
> > > and easily debuggable, 
> > > perhaps by temporarily assigning it to a fake object.
> > > 
> > > Split up code into debuggable modules.
> > > 
> > > Please start thinking modular and debuggy,
> > > do not ask us to review code that you do not understand yourself.
> > > 
> > > 
> > > -- 
> > > Evertjan.
> > > The Netherlands.
> > > (Please change the x'es to dots in my emailaddress)
> > 
> > But the code do work in windows XP, Janevert i can not see why it do not in Windows 10. That the on midi success object "midi" object is a bit elusive is more about its documentation very scarse. The problem with it seem rather general just as you say, so my question is why does it not work. 
> > 
> > Now i declared var midi,var mid,var outputs as global *outside any function*** in mainmidi.js but the error message persist.
> > 
> > UI.js:77 Uncaught TypeError: Cannot read property 'outputs' of undefined
> >     at sendProgram (UI.js:77)
> >     at setTrack (UI.js:43)
> >     at init (mainmidi.js:58)
> 
> Sorry about Janevert, Evertjan it is just the syndrom of when something eventually stick, it is stuck whether it is right or wrong.

Well the error is in sendProgram 
output = mid.outputs.get(outportindex);
This get undefined output, but not in XP.

[toc] | [prev] | [next] | [standalone]


#35080

FromJonas Thörnvall <jonas.thornvall@gmail.com>
Date2018-05-21 23:57 -0700
Message-ID<70bbbdc5-de19-428e-9280-f58b29e68a76@googlegroups.com>
In reply to#35079
Den tisdag 22 maj 2018 kl. 08:50:24 UTC+2 skrev Jonas Thörnvall:
> Den tisdag 22 maj 2018 kl. 08:09:37 UTC+2 skrev Jonas Thörnvall:
> > Den tisdag 22 maj 2018 kl. 07:02:29 UTC+2 skrev Jonas Thörnvall:
> > > Den måndag 21 maj 2018 kl. 23:42:17 UTC+2 skrev Evertjan.:
> > > > =?UTF-8?Q?Jonas_Th=C3=B6rnvall?= <jonas.thornvall@gmail.com> wrote on 21
> > > > May 2018 in comp.lang.javascript: 
> > > > 
> > > > > As you may have seen windows 10 gives *error message when* i try to send
> > > > > messages to mid output. Because apparently the mid object is not
> > > > > reachable global, and i do not know howto tackle it. 
> > > > 
> > > > If you declare a variable name in the global scope,
> > > > with
> > > > 
> > > > let mid;
> > > > 
> > > > or 
> > > > 
> > > > var mid;
> > > > 
> > > > you can later assign your [non global yet] object to it:
> > > > 
> > > > mid =  midi;
> > > > 
> > > > ===============================
> > > > 
> > > > This all very basic stuff, meseems,
> > > > and easily debuggable, 
> > > > perhaps by temporarily assigning it to a fake object.
> > > > 
> > > > Split up code into debuggable modules.
> > > > 
> > > > Please start thinking modular and debuggy,
> > > > do not ask us to review code that you do not understand yourself.
> > > > 
> > > > 
> > > > -- 
> > > > Evertjan.
> > > > The Netherlands.
> > > > (Please change the x'es to dots in my emailaddress)
> > > 
> > > But the code do work in windows XP, Janevert i can not see why it do not in Windows 10. That the on midi success object "midi" object is a bit elusive is more about its documentation very scarse. The problem with it seem rather general just as you say, so my question is why does it not work. 
> > > 
> > > Now i declared var midi,var mid,var outputs as global *outside any function*** in mainmidi.js but the error message persist.
> > > 
> > > UI.js:77 Uncaught TypeError: Cannot read property 'outputs' of undefined
> > >     at sendProgram (UI.js:77)
> > >     at setTrack (UI.js:43)
> > >     at init (mainmidi.js:58)
> > 
> > Sorry about Janevert, Evertjan it is just the syndrom of when something eventually stick, it is stuck whether it is right or wrong.
> 
> Well the error is in sendProgram 
> output = mid.outputs.get(outportindex);
> This get undefined output, but not in XP.

Found this, is it a change in the API?
"The MIDIOutputMap read-only interface of the Web MIDI API provides a Map-like interface to the currently available MIDI output ports. Although it works like a map, because it is read-only, it does not contain clear(), delete(), or set() functions."

https://developer.mozilla.org/en-US/docs/Web/API/MIDIOutputMap

[toc] | [prev] | [next] | [standalone]


#35081

FromJonas Thörnvall <jonas.thornvall@gmail.com>
Date2018-05-22 00:03 -0700
Message-ID<67e9ead3-8e37-4644-b5a9-1b775b86d2c6@googlegroups.com>
In reply to#35080
Den tisdag 22 maj 2018 kl. 08:57:52 UTC+2 skrev Jonas Thörnvall:
> Den tisdag 22 maj 2018 kl. 08:50:24 UTC+2 skrev Jonas Thörnvall:
> > Den tisdag 22 maj 2018 kl. 08:09:37 UTC+2 skrev Jonas Thörnvall:
> > > Den tisdag 22 maj 2018 kl. 07:02:29 UTC+2 skrev Jonas Thörnvall:
> > > > Den måndag 21 maj 2018 kl. 23:42:17 UTC+2 skrev Evertjan.:
> > > > > =?UTF-8?Q?Jonas_Th=C3=B6rnvall?= <jonas.thornvall@gmail.com> wrote on 21
> > > > > May 2018 in comp.lang.javascript: 
> > > > > 
> > > > > > As you may have seen windows 10 gives *error message when* i try to send
> > > > > > messages to mid output. Because apparently the mid object is not
> > > > > > reachable global, and i do not know howto tackle it. 
> > > > > 
> > > > > If you declare a variable name in the global scope,
> > > > > with
> > > > > 
> > > > > let mid;
> > > > > 
> > > > > or 
> > > > > 
> > > > > var mid;
> > > > > 
> > > > > you can later assign your [non global yet] object to it:
> > > > > 
> > > > > mid =  midi;
> > > > > 
> > > > > ===============================
> > > > > 
> > > > > This all very basic stuff, meseems,
> > > > > and easily debuggable, 
> > > > > perhaps by temporarily assigning it to a fake object.
> > > > > 
> > > > > Split up code into debuggable modules.
> > > > > 
> > > > > Please start thinking modular and debuggy,
> > > > > do not ask us to review code that you do not understand yourself.
> > > > > 
> > > > > 
> > > > > -- 
> > > > > Evertjan.
> > > > > The Netherlands.
> > > > > (Please change the x'es to dots in my emailaddress)
> > > > 
> > > > But the code do work in windows XP, Janevert i can not see why it do not in Windows 10. That the on midi success object "midi" object is a bit elusive is more about its documentation very scarse. The problem with it seem rather general just as you say, so my question is why does it not work. 
> > > > 
> > > > Now i declared var midi,var mid,var outputs as global *outside any function*** in mainmidi.js but the error message persist.
> > > > 
> > > > UI.js:77 Uncaught TypeError: Cannot read property 'outputs' of undefined
> > > >     at sendProgram (UI.js:77)
> > > >     at setTrack (UI.js:43)
> > > >     at init (mainmidi.js:58)
> > > 
> > > Sorry about Janevert, Evertjan it is just the syndrom of when something eventually stick, it is stuck whether it is right or wrong.
> > 
> > Well the error is in sendProgram 
> > output = mid.outputs.get(outportindex);
> > This get undefined output, but not in XP.
> 
> Found this, is it a change in the API?
> "The MIDIOutputMap read-only interface of the Web MIDI API provides a Map-like interface to the currently available MIDI output ports. Although it works like a map, because it is read-only, it does not contain clear(), delete(), or set() functions."
> 
> https://developer.mozilla.org/en-US/docs/Web/API/MIDIOutputMap

Maybe now i can ask how do i set output *port*, because apparently...
output = mid.outputs.get(outportindex);
Is not the way it should be done? Or? why isn't the outputs reachable and undefined, or is it the mid object itself?

mid outputs and output are all global *now*.

[toc] | [prev] | [next] | [standalone]


#35082

FromJonas Thörnvall <jonas.thornvall@gmail.com>
Date2018-05-22 00:28 -0700
Message-ID<8fa6b07d-6940-4673-900f-6a53886d7e79@googlegroups.com>
In reply to#35081
Den tisdag 22 maj 2018 kl. 09:03:47 UTC+2 skrev Jonas Thörnvall:
> Den tisdag 22 maj 2018 kl. 08:57:52 UTC+2 skrev Jonas Thörnvall:
> > Den tisdag 22 maj 2018 kl. 08:50:24 UTC+2 skrev Jonas Thörnvall:
> > > Den tisdag 22 maj 2018 kl. 08:09:37 UTC+2 skrev Jonas Thörnvall:
> > > > Den tisdag 22 maj 2018 kl. 07:02:29 UTC+2 skrev Jonas Thörnvall:
> > > > > Den måndag 21 maj 2018 kl. 23:42:17 UTC+2 skrev Evertjan.:
> > > > > > =?UTF-8?Q?Jonas_Th=C3=B6rnvall?= <jonas.thornvall@gmail.com> wrote on 21
> > > > > > May 2018 in comp.lang.javascript: 
> > > > > > 
> > > > > > > As you may have seen windows 10 gives *error message when* i try to send
> > > > > > > messages to mid output. Because apparently the mid object is not
> > > > > > > reachable global, and i do not know howto tackle it. 
> > > > > > 
> > > > > > If you declare a variable name in the global scope,
> > > > > > with
> > > > > > 
> > > > > > let mid;
> > > > > > 
> > > > > > or 
> > > > > > 
> > > > > > var mid;
> > > > > > 
> > > > > > you can later assign your [non global yet] object to it:
> > > > > > 
> > > > > > mid =  midi;
> > > > > > 
> > > > > > ===============================
> > > > > > 
> > > > > > This all very basic stuff, meseems,
> > > > > > and easily debuggable, 
> > > > > > perhaps by temporarily assigning it to a fake object.
> > > > > > 
> > > > > > Split up code into debuggable modules.
> > > > > > 
> > > > > > Please start thinking modular and debuggy,
> > > > > > do not ask us to review code that you do not understand yourself.
> > > > > > 
> > > > > > 
> > > > > > -- 
> > > > > > Evertjan.
> > > > > > The Netherlands.
> > > > > > (Please change the x'es to dots in my emailaddress)
> > > > > 
> > > > > But the code do work in windows XP, Janevert i can not see why it do not in Windows 10. That the on midi success object "midi" object is a bit elusive is more about its documentation very scarse. The problem with it seem rather general just as you say, so my question is why does it not work. 
> > > > > 
> > > > > Now i declared var midi,var mid,var outputs as global *outside any function*** in mainmidi.js but the error message persist.
> > > > > 
> > > > > UI.js:77 Uncaught TypeError: Cannot read property 'outputs' of undefined
> > > > >     at sendProgram (UI.js:77)
> > > > >     at setTrack (UI.js:43)
> > > > >     at init (mainmidi.js:58)
> > > > 
> > > > Sorry about Janevert, Evertjan it is just the syndrom of when something eventually stick, it is stuck whether it is right or wrong.
> > > 
> > > Well the error is in sendProgram 
> > > output = mid.outputs.get(outportindex);
> > > This get undefined output, but not in XP.
> > 
> > Found this, is it a change in the API?
> > "The MIDIOutputMap read-only interface of the Web MIDI API provides a Map-like interface to the currently available MIDI output ports. Although it works like a map, because it is read-only, it does not contain clear(), delete(), or set() functions."
> > 
> > https://developer.mozilla.org/en-US/docs/Web/API/MIDIOutputMap
> 
> Maybe now i can ask how do i set output *port*, because apparently...
> output = mid.outputs.get(outportindex);
> Is not the way it should be done? Or? why isn't the outputs reachable and undefined, or is it the mid object itself?
> 
> mid outputs and output are all global *now*.

I did try
output = mid.outputs.get(outportindex);
in the mainmidi.js "function selectPorts where i list all ports" and it turns out it do nothing in *Windows 10*.

So how can i reach the outputs, and set a single output.send port?

[toc] | [prev] | [next] | [standalone]


#35083

FromJonas Thörnvall <jonas.thornvall@gmail.com>
Date2018-05-22 00:43 -0700
Message-ID<421224d8-3928-4ff0-88c0-34a678376dc0@googlegroups.com>
In reply to#35082
Den tisdag 22 maj 2018 kl. 09:28:20 UTC+2 skrev Jonas Thörnvall:
> Den tisdag 22 maj 2018 kl. 09:03:47 UTC+2 skrev Jonas Thörnvall:
> > Den tisdag 22 maj 2018 kl. 08:57:52 UTC+2 skrev Jonas Thörnvall:
> > > Den tisdag 22 maj 2018 kl. 08:50:24 UTC+2 skrev Jonas Thörnvall:
> > > > Den tisdag 22 maj 2018 kl. 08:09:37 UTC+2 skrev Jonas Thörnvall:
> > > > > Den tisdag 22 maj 2018 kl. 07:02:29 UTC+2 skrev Jonas Thörnvall:
> > > > > > Den måndag 21 maj 2018 kl. 23:42:17 UTC+2 skrev Evertjan.:
> > > > > > > =?UTF-8?Q?Jonas_Th=C3=B6rnvall?= <jonas.thornvall@gmail.com> wrote on 21
> > > > > > > May 2018 in comp.lang.javascript: 
> > > > > > > 
> > > > > > > > As you may have seen windows 10 gives *error message when* i try to send
> > > > > > > > messages to mid output. Because apparently the mid object is not
> > > > > > > > reachable global, and i do not know howto tackle it. 
> > > > > > > 
> > > > > > > If you declare a variable name in the global scope,
> > > > > > > with
> > > > > > > 
> > > > > > > let mid;
> > > > > > > 
> > > > > > > or 
> > > > > > > 
> > > > > > > var mid;
> > > > > > > 
> > > > > > > you can later assign your [non global yet] object to it:
> > > > > > > 
> > > > > > > mid =  midi;
> > > > > > > 
> > > > > > > ===============================
> > > > > > > 
> > > > > > > This all very basic stuff, meseems,
> > > > > > > and easily debuggable, 
> > > > > > > perhaps by temporarily assigning it to a fake object.
> > > > > > > 
> > > > > > > Split up code into debuggable modules.
> > > > > > > 
> > > > > > > Please start thinking modular and debuggy,
> > > > > > > do not ask us to review code that you do not understand yourself.
> > > > > > > 
> > > > > > > 
> > > > > > > -- 
> > > > > > > Evertjan.
> > > > > > > The Netherlands.
> > > > > > > (Please change the x'es to dots in my emailaddress)
> > > > > > 
> > > > > > But the code do work in windows XP, Janevert i can not see why it do not in Windows 10. That the on midi success object "midi" object is a bit elusive is more about its documentation very scarse. The problem with it seem rather general just as you say, so my question is why does it not work. 
> > > > > > 
> > > > > > Now i declared var midi,var mid,var outputs as global *outside any function*** in mainmidi.js but the error message persist.
> > > > > > 
> > > > > > UI.js:77 Uncaught TypeError: Cannot read property 'outputs' of undefined
> > > > > >     at sendProgram (UI.js:77)
> > > > > >     at setTrack (UI.js:43)
> > > > > >     at init (mainmidi.js:58)
> > > > > 
> > > > > Sorry about Janevert, Evertjan it is just the syndrom of when something eventually stick, it is stuck whether it is right or wrong.
> > > > 
> > > > Well the error is in sendProgram 
> > > > output = mid.outputs.get(outportindex);
> > > > This get undefined output, but not in XP.
> > > 
> > > Found this, is it a change in the API?
> > > "The MIDIOutputMap read-only interface of the Web MIDI API provides a Map-like interface to the currently available MIDI output ports. Although it works like a map, because it is read-only, it does not contain clear(), delete(), or set() functions."
> > > 
> > > https://developer.mozilla.org/en-US/docs/Web/API/MIDIOutputMap
> > 
> > Maybe now i can ask how do i set output *port*, because apparently...
> > output = mid.outputs.get(outportindex);
> > Is not the way it should be done? Or? why isn't the outputs reachable and undefined, or is it the mid object itself?
> > 
> > mid outputs and output are all global *now*.
> 
> I did try
> output = mid.outputs.get(outportindex);
> in the mainmidi.js "function selectPorts where i list all ports" and it turns out it do nothing in *Windows 10*.
> 
> So how can i reach the outputs, and set a single output.send port?

This is the example the give

9.5 Sending MIDI Messages to an Output Device
This example sends a middle C note on message immediately on MIDI channel 1 (MIDI channels are 0-indexed, but generally referred to as channels 1-16), and queues a corresponding note off message for 1 second later.

function sendMiddleC( midiAccess, portID ) {
  var noteOnMessage = [0x90, 60, 0x7f];    // note on, middle C, full velocity
  var output = midiAccess.outputs.get(portID);
  output.send( noteOnMessage );  //omitting the timestamp means send immediately.
  output.send( [0x80, 60, 0x40], window.performance.now() + 1000.0 ); // Inlined array creation- note off, middle C,  
                                                                      // release velocity = 64, timestamp = now + 1000ms.
}

[toc] | [prev] | [next] | [standalone]


#35084

FromJonas Thörnvall <jonas.thornvall@gmail.com>
Date2018-05-22 00:57 -0700
Message-ID<3a58a21f-44f8-4fbb-9384-bd7a155e680d@googlegroups.com>
In reply to#35083
Den tisdag 22 maj 2018 kl. 09:43:56 UTC+2 skrev Jonas Thörnvall:
> Den tisdag 22 maj 2018 kl. 09:28:20 UTC+2 skrev Jonas Thörnvall:
> > Den tisdag 22 maj 2018 kl. 09:03:47 UTC+2 skrev Jonas Thörnvall:
> > > Den tisdag 22 maj 2018 kl. 08:57:52 UTC+2 skrev Jonas Thörnvall:
> > > > Den tisdag 22 maj 2018 kl. 08:50:24 UTC+2 skrev Jonas Thörnvall:
> > > > > Den tisdag 22 maj 2018 kl. 08:09:37 UTC+2 skrev Jonas Thörnvall:
> > > > > > Den tisdag 22 maj 2018 kl. 07:02:29 UTC+2 skrev Jonas Thörnvall:
> > > > > > > Den måndag 21 maj 2018 kl. 23:42:17 UTC+2 skrev Evertjan.:
> > > > > > > > =?UTF-8?Q?Jonas_Th=C3=B6rnvall?= <jonas.thornvall@gmail.com> wrote on 21
> > > > > > > > May 2018 in comp.lang.javascript: 
> > > > > > > > 
> > > > > > > > > As you may have seen windows 10 gives *error message when* i try to send
> > > > > > > > > messages to mid output. Because apparently the mid object is not
> > > > > > > > > reachable global, and i do not know howto tackle it. 
> > > > > > > > 
> > > > > > > > If you declare a variable name in the global scope,
> > > > > > > > with
> > > > > > > > 
> > > > > > > > let mid;
> > > > > > > > 
> > > > > > > > or 
> > > > > > > > 
> > > > > > > > var mid;
> > > > > > > > 
> > > > > > > > you can later assign your [non global yet] object to it:
> > > > > > > > 
> > > > > > > > mid =  midi;
> > > > > > > > 
> > > > > > > > ===============================
> > > > > > > > 
> > > > > > > > This all very basic stuff, meseems,
> > > > > > > > and easily debuggable, 
> > > > > > > > perhaps by temporarily assigning it to a fake object.
> > > > > > > > 
> > > > > > > > Split up code into debuggable modules.
> > > > > > > > 
> > > > > > > > Please start thinking modular and debuggy,
> > > > > > > > do not ask us to review code that you do not understand yourself.
> > > > > > > > 
> > > > > > > > 
> > > > > > > > -- 
> > > > > > > > Evertjan.
> > > > > > > > The Netherlands.
> > > > > > > > (Please change the x'es to dots in my emailaddress)
> > > > > > > 
> > > > > > > But the code do work in windows XP, Janevert i can not see why it do not in Windows 10. That the on midi success object "midi" object is a bit elusive is more about its documentation very scarse. The problem with it seem rather general just as you say, so my question is why does it not work. 
> > > > > > > 
> > > > > > > Now i declared var midi,var mid,var outputs as global *outside any function*** in mainmidi.js but the error message persist.
> > > > > > > 
> > > > > > > UI.js:77 Uncaught TypeError: Cannot read property 'outputs' of undefined
> > > > > > >     at sendProgram (UI.js:77)
> > > > > > >     at setTrack (UI.js:43)
> > > > > > >     at init (mainmidi.js:58)
> > > > > > 
> > > > > > Sorry about Janevert, Evertjan it is just the syndrom of when something eventually stick, it is stuck whether it is right or wrong.
> > > > > 
> > > > > Well the error is in sendProgram 
> > > > > output = mid.outputs.get(outportindex);
> > > > > This get undefined output, but not in XP.
> > > > 
> > > > Found this, is it a change in the API?
> > > > "The MIDIOutputMap read-only interface of the Web MIDI API provides a Map-like interface to the currently available MIDI output ports. Although it works like a map, because it is read-only, it does not contain clear(), delete(), or set() functions."
> > > > 
> > > > https://developer.mozilla.org/en-US/docs/Web/API/MIDIOutputMap
> > > 
> > > Maybe now i can ask how do i set output *port*, because apparently...
> > > output = mid.outputs.get(outportindex);
> > > Is not the way it should be done? Or? why isn't the outputs reachable and undefined, or is it the mid object itself?
> > > 
> > > mid outputs and output are all global *now*.
> > 
> > I did try
> > output = mid.outputs.get(outportindex);
> > in the mainmidi.js "function selectPorts where i list all ports" and it turns out it do nothing in *Windows 10*.
> > 
> > So how can i reach the outputs, and set a single output.send port?
> 
> This is the example the give
> 
> 9.5 Sending MIDI Messages to an Output Device
> This example sends a middle C note on message immediately on MIDI channel 1 (MIDI channels are 0-indexed, but generally referred to as channels 1-16), and queues a corresponding note off message for 1 second later.
> 
> function sendMiddleC( midiAccess, portID ) {
>   var noteOnMessage = [0x90, 60, 0x7f];    // note on, middle C, full velocity
>   var output = midiAccess.outputs.get(portID);
>   output.send( noteOnMessage );  //omitting the timestamp means send immediately.
>   output.send( [0x80, 60, 0x40], window.performance.now() + 1000.0 ); // Inlined array creation- note off, middle C,  
>                                                                       // release velocity = 64, timestamp = now + 1000ms.
> }

I mean it seem correct?
 var output = midiAccess.outputs.get(portID); 
compare
 output = mid.outputs.get(outportindex); 
But "output" variable will be undefined, yet i to list all the ports in same function using next?


 for (output = outputs.next(); output && !output.done; output = outputs.next()) {
        console.log("listing ports in selectPorts="+output);
       var deviceOut = output.value.name;
       console.log(deviceOut);
       var optout = document.createElement("option");
       optout.text = deviceOut;
       document.getElementById("out_portsel").add(optout);
   }
This will list the ports in same function?
I do not understand what goes wrong, using?

 output = mid.outputs.get(outportindex);
or
 output = mid.outputs.get(0);

Output get undefined?

[toc] | [prev] | [next] | [standalone]


#35085

FromJonas Thörnvall <jonas.thornvall@gmail.com>
Date2018-05-22 01:05 -0700
Message-ID<21b60750-14b0-4eaa-8803-676872139f9f@googlegroups.com>
In reply to#35084
Den tisdag 22 maj 2018 kl. 09:57:18 UTC+2 skrev Jonas Thörnvall:
> Den tisdag 22 maj 2018 kl. 09:43:56 UTC+2 skrev Jonas Thörnvall:
> > Den tisdag 22 maj 2018 kl. 09:28:20 UTC+2 skrev Jonas Thörnvall:
> > > Den tisdag 22 maj 2018 kl. 09:03:47 UTC+2 skrev Jonas Thörnvall:
> > > > Den tisdag 22 maj 2018 kl. 08:57:52 UTC+2 skrev Jonas Thörnvall:
> > > > > Den tisdag 22 maj 2018 kl. 08:50:24 UTC+2 skrev Jonas Thörnvall:
> > > > > > Den tisdag 22 maj 2018 kl. 08:09:37 UTC+2 skrev Jonas Thörnvall:
> > > > > > > Den tisdag 22 maj 2018 kl. 07:02:29 UTC+2 skrev Jonas Thörnvall:
> > > > > > > > Den måndag 21 maj 2018 kl. 23:42:17 UTC+2 skrev Evertjan.:
> > > > > > > > > =?UTF-8?Q?Jonas_Th=C3=B6rnvall?= <jonas.thornvall@gmail.com> wrote on 21
> > > > > > > > > May 2018 in comp.lang.javascript: 
> > > > > > > > > 
> > > > > > > > > > As you may have seen windows 10 gives *error message when* i try to send
> > > > > > > > > > messages to mid output. Because apparently the mid object is not
> > > > > > > > > > reachable global, and i do not know howto tackle it. 
> > > > > > > > > 
> > > > > > > > > If you declare a variable name in the global scope,
> > > > > > > > > with
> > > > > > > > > 
> > > > > > > > > let mid;
> > > > > > > > > 
> > > > > > > > > or 
> > > > > > > > > 
> > > > > > > > > var mid;
> > > > > > > > > 
> > > > > > > > > you can later assign your [non global yet] object to it:
> > > > > > > > > 
> > > > > > > > > mid =  midi;
> > > > > > > > > 
> > > > > > > > > ===============================
> > > > > > > > > 
> > > > > > > > > This all very basic stuff, meseems,
> > > > > > > > > and easily debuggable, 
> > > > > > > > > perhaps by temporarily assigning it to a fake object.
> > > > > > > > > 
> > > > > > > > > Split up code into debuggable modules.
> > > > > > > > > 
> > > > > > > > > Please start thinking modular and debuggy,
> > > > > > > > > do not ask us to review code that you do not understand yourself.
> > > > > > > > > 
> > > > > > > > > 
> > > > > > > > > -- 
> > > > > > > > > Evertjan.
> > > > > > > > > The Netherlands.
> > > > > > > > > (Please change the x'es to dots in my emailaddress)
> > > > > > > > 
> > > > > > > > But the code do work in windows XP, Janevert i can not see why it do not in Windows 10. That the on midi success object "midi" object is a bit elusive is more about its documentation very scarse. The problem with it seem rather general just as you say, so my question is why does it not work. 
> > > > > > > > 
> > > > > > > > Now i declared var midi,var mid,var outputs as global *outside any function*** in mainmidi.js but the error message persist.
> > > > > > > > 
> > > > > > > > UI.js:77 Uncaught TypeError: Cannot read property 'outputs' of undefined
> > > > > > > >     at sendProgram (UI.js:77)
> > > > > > > >     at setTrack (UI.js:43)
> > > > > > > >     at init (mainmidi.js:58)
> > > > > > > 
> > > > > > > Sorry about Janevert, Evertjan it is just the syndrom of when something eventually stick, it is stuck whether it is right or wrong.
> > > > > > 
> > > > > > Well the error is in sendProgram 
> > > > > > output = mid.outputs.get(outportindex);
> > > > > > This get undefined output, but not in XP.
> > > > > 
> > > > > Found this, is it a change in the API?
> > > > > "The MIDIOutputMap read-only interface of the Web MIDI API provides a Map-like interface to the currently available MIDI output ports. Although it works like a map, because it is read-only, it does not contain clear(), delete(), or set() functions."
> > > > > 
> > > > > https://developer.mozilla.org/en-US/docs/Web/API/MIDIOutputMap
> > > > 
> > > > Maybe now i can ask how do i set output *port*, because apparently...
> > > > output = mid.outputs.get(outportindex);
> > > > Is not the way it should be done? Or? why isn't the outputs reachable and undefined, or is it the mid object itself?
> > > > 
> > > > mid outputs and output are all global *now*.
> > > 
> > > I did try
> > > output = mid.outputs.get(outportindex);
> > > in the mainmidi.js "function selectPorts where i list all ports" and it turns out it do nothing in *Windows 10*.
> > > 
> > > So how can i reach the outputs, and set a single output.send port?
> > 
> > This is the example the give
> > 
> > 9.5 Sending MIDI Messages to an Output Device
> > This example sends a middle C note on message immediately on MIDI channel 1 (MIDI channels are 0-indexed, but generally referred to as channels 1-16), and queues a corresponding note off message for 1 second later.
> > 
> > function sendMiddleC( midiAccess, portID ) {
> >   var noteOnMessage = [0x90, 60, 0x7f];    // note on, middle C, full velocity
> >   var output = midiAccess.outputs.get(portID);
> >   output.send( noteOnMessage );  //omitting the timestamp means send immediately.
> >   output.send( [0x80, 60, 0x40], window.performance.now() + 1000.0 ); // Inlined array creation- note off, middle C,  
> >                                                                       // release velocity = 64, timestamp = now + 1000ms.
> > }
> 
> I mean it seem correct?
>  var output = midiAccess.outputs.get(portID); 
> compare
>  output = mid.outputs.get(outportindex); 
> But "output" variable will be undefined, yet i to list all the ports in same function using next?
> 
> 
>  for (output = outputs.next(); output && !output.done; output = outputs.next()) {
>         console.log("listing ports in selectPorts="+output);
>        var deviceOut = output.value.name;
>        console.log(deviceOut);
>        var optout = document.createElement("option");
>        optout.text = deviceOut;
>        document.getElementById("out_portsel").add(optout);
>    }
> This will list the ports in same function?
> I do not understand what goes wrong, using?
> 
>  output = mid.outputs.get(outportindex);
> or
>  output = mid.outputs.get(0);
> 
> Output get undefined?

Well i think i leave it there for to me the problem have become untraceable, i go back to program on XP for a week or two. 

function selectPorts(){
    output = mid.outputs.get(outportindex); //Why the fuck is this undefined?
    console.log("in selectPorts trying outputs get="+output);
   for (output = outputs.next(); output && !output.done; output = outputs.next()) {
        console.log("listing ports in selectPorts="+output);
       var deviceOut = output.value.name;
       console.log(deviceOut);
       var optout = document.createElement("option");
       optout.text = deviceOut;
       document.getElementById("out_portsel").add(optout);
   }

   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] | [prev] | [next] | [standalone]


#35093

From"Evertjan." <exxjxw.hannivoort@inter.nl.net>
Date2018-05-22 10:28 +0200
Message-ID<XnsA8EA6A80D498Deejj99@194.109.6.166>
In reply to#35085
=?UTF-8?Q?Jonas_Th=C3=B6rnvall?= <jonas.thornvall@gmail.com> wrote on 22
May 2018 in comp.lang.javascript: 

> Well i think i leave it there for to me the problem have become
> untraceable, i go back to program on XP for a week or two. 

Of cource it is tracable, GO DEBUGGING.

If a variable is undefined, you should be able to find why, where and when.

> output = mid.outputs.get(outportindex); //Why the fuck is this undefined?

"this" is nonsense, a script string is never undefined.

So what is undefined?

outportindex
mid.outputs
mid

???

GO DEBUGGING!

-- 
Evertjan.
The Netherlands.
(Please change the x'es to dots in my emailaddress)

[toc] | [prev] | [next] | [standalone]


#35094

FromJonas Thörnvall <jonas.thornvall@gmail.com>
Date2018-05-22 02:01 -0700
Message-ID<7e8d94e1-b83d-4784-b43b-6fc0cfc7f83b@googlegroups.com>
In reply to#35093
Den tisdag 22 maj 2018 kl. 10:28:15 UTC+2 skrev Evertjan.:
> =?UTF-8?Q?Jonas_Th=C3=B6rnvall?= <jonas.thornvall@gmail.com> wrote on 22
> May 2018 in comp.lang.javascript: 
> 
> > Well i think i leave it there for to me the problem have become
> > untraceable, i go back to program on XP for a week or two. 
> 
> Of cource it is tracable, GO DEBUGGING.
> 
> If a variable is undefined, you should be able to find why, where and when.
> 
> > output = mid.outputs.get(outportindex); //Why the fuck is this undefined?
> 
> "this" is nonsense, a script string is never undefined.
> 
> So what is undefined?
> 
> outportindex
> mid.outputs
> mid
> 
> ???
> 
> GO DEBUGGING!
> 
> -- 
> Evertjan.
> The Netherlands.
> (Please change the x'es to dots in my emailaddress)

outportindex is definitly defined
outputs and output also because i list output them 3 rows below.
So it is mid.outputs.get(), that produce the error in ***windows 10***

It is probably that mid somehow is not global, but it is declared global, so i do not know what to do about it.

Why can't i use just output=outputs.get(0); ?

[toc] | [prev] | [next] | [standalone]


#35095

FromJonas Thörnvall <jonas.thornvall@gmail.com>
Date2018-05-22 02:14 -0700
Message-ID<7b0a5a2d-9ffe-4940-8acf-889b8b20e073@googlegroups.com>
In reply to#35094
Den tisdag 22 maj 2018 kl. 11:01:38 UTC+2 skrev Jonas Thörnvall:
> Den tisdag 22 maj 2018 kl. 10:28:15 UTC+2 skrev Evertjan.:
> > =?UTF-8?Q?Jonas_Th=C3=B6rnvall?= <jonas.thornvall@gmail.com> wrote on 22
> > May 2018 in comp.lang.javascript: 
> > 
> > > Well i think i leave it there for to me the problem have become
> > > untraceable, i go back to program on XP for a week or two. 
> > 
> > Of cource it is tracable, GO DEBUGGING.
> > 
> > If a variable is undefined, you should be able to find why, where and when.
> > 
> > > output = mid.outputs.get(outportindex); //Why the fuck is this undefined?
> > 
> > "this" is nonsense, a script string is never undefined.
> > 
> > So what is undefined?
> > 
> > outportindex
> > mid.outputs
> > mid
> > 
> > ???
> > 
> > GO DEBUGGING!
> > 
> > -- 
> > Evertjan.
> > The Netherlands.
> > (Please change the x'es to dots in my emailaddress)
> 
> outportindex is definitly defined
> outputs and output also because i list output them 3 rows below.
> So it is mid.outputs.get(), that produce the error in ***windows 10***
> 
> It is probably that mid somehow is not global, but it is declared global, so i do not know what to do about it.
> 
> Why can't i use just output=outputs.get(0); ?

midi is the midiAccess object created on success correct? And it have "properties?" named inputs and outputs correct?

How come i can refer to outputs.next() but not to outputs.get(x) that is my question to you all?

[toc] | [prev] | [next] | [standalone]


#35096

FromJonas Thörnvall <jonas.thornvall@gmail.com>
Date2018-05-22 02:20 -0700
Message-ID<2f0f4cc8-003e-47be-b6f3-ab3dd2b5b952@googlegroups.com>
In reply to#35095
Den tisdag 22 maj 2018 kl. 11:14:14 UTC+2 skrev Jonas Thörnvall:
> Den tisdag 22 maj 2018 kl. 11:01:38 UTC+2 skrev Jonas Thörnvall:
> > Den tisdag 22 maj 2018 kl. 10:28:15 UTC+2 skrev Evertjan.:
> > > =?UTF-8?Q?Jonas_Th=C3=B6rnvall?= <jonas.thornvall@gmail.com> wrote on 22
> > > May 2018 in comp.lang.javascript: 
> > > 
> > > > Well i think i leave it there for to me the problem have become
> > > > untraceable, i go back to program on XP for a week or two. 
> > > 
> > > Of cource it is tracable, GO DEBUGGING.
> > > 
> > > If a variable is undefined, you should be able to find why, where and when.
> > > 
> > > > output = mid.outputs.get(outportindex); //Why the fuck is this undefined?
> > > 
> > > "this" is nonsense, a script string is never undefined.
> > > 
> > > So what is undefined?
> > > 
> > > outportindex
> > > mid.outputs
> > > mid
> > > 
> > > ???
> > > 
> > > GO DEBUGGING!
> > > 
> > > -- 
> > > Evertjan.
> > > The Netherlands.
> > > (Please change the x'es to dots in my emailaddress)
> > 
> > outportindex is definitly defined
> > outputs and output also because i list output them 3 rows below.
> > So it is mid.outputs.get(), that produce the error in ***windows 10***
> > 
> > It is probably that mid somehow is not global, but it is declared global, so i do not know what to do about it.
> > 
> > Why can't i use just output=outputs.get(0); ?
> 
> midi is the midiAccess object created on success correct? And it have "properties?" named inputs and outputs correct?
> 
> How come i can refer to output=outputs.next() but not to output=outputs.get(x) that is my question to you all?

Uncaught TypeError: outputs.get is not a function
    at selectPorts (mainmidi.js:31)
    at init (mainmidi.js:52)

[toc] | [prev] | [next] | [standalone]


#35102

FromJonas Thörnvall <jonas.thornvall@gmail.com>
Date2018-05-23 00:08 -0700
Message-ID<d3a5b4c6-0d7d-4d12-b357-bc3308089449@googlegroups.com>
In reply to#35096
Den tisdag 22 maj 2018 kl. 11:20:36 UTC+2 skrev Jonas Thörnvall:
> Den tisdag 22 maj 2018 kl. 11:14:14 UTC+2 skrev Jonas Thörnvall:
> > Den tisdag 22 maj 2018 kl. 11:01:38 UTC+2 skrev Jonas Thörnvall:
> > > Den tisdag 22 maj 2018 kl. 10:28:15 UTC+2 skrev Evertjan.:
> > > > =?UTF-8?Q?Jonas_Th=C3=B6rnvall?= <jonas.thornvall@gmail.com> wrote on 22
> > > > May 2018 in comp.lang.javascript: 
> > > > 
> > > > > Well i think i leave it there for to me the problem have become
> > > > > untraceable, i go back to program on XP for a week or two. 
> > > > 
> > > > Of cource it is tracable, GO DEBUGGING.
> > > > 
> > > > If a variable is undefined, you should be able to find why, where and when.
> > > > 
> > > > > output = mid.outputs.get(outportindex); //Why the fuck is this undefined?
> > > > 
> > > > "this" is nonsense, a script string is never undefined.
> > > > 
> > > > So what is undefined?
> > > > 
> > > > outportindex
> > > > mid.outputs
> > > > mid
> > > > 
> > > > ???
> > > > 
> > > > GO DEBUGGING!
> > > > 
> > > > -- 
> > > > Evertjan.
> > > > The Netherlands.
> > > > (Please change the x'es to dots in my emailaddress)
> > > 
> > > outportindex is definitly defined
> > > outputs and output also because i list output them 3 rows below.
> > > So it is mid.outputs.get(), that produce the error in ***windows 10***
> > > 
> > > It is probably that mid somehow is not global, but it is declared global, so i do not know what to do about it.
> > > 
> > > Why can't i use just output=outputs.get(0); ?
> > 
> > midi is the midiAccess object created on success correct? And it have "properties?" named inputs and outputs correct?
> > 
> > How come i can refer to output=outputs.next() but not to output=outputs.get(x) that is my question to you all?
> 
> Uncaught TypeError: outputs.get is not a function
>     at selectPorts (mainmidi.js:31)
>     at init (mainmidi.js:52)

I changed the name of outputs and inputs to inmidi and outmidi, since it was confusing with inputs=mid.inputs.values(); so now instead inmidi=mid.inputs.values(); and same for outputs.

But the names was not the problem.

https://3d16zci4vuzyxt8hxvovrg-on.drv.tw/Website/midi.html

[toc] | [prev] | [next] | [standalone]


Page 2 of 3 — ← Prev page 1 [2] 3  Next page →

Back to top | Article view | comp.lang.javascript


csiph-web