headache with ports and filtering certain ports from Recorded

16 views
Skip to first unread message

Mike Edwards

unread,
Nov 10, 2017, 10:25:57 AM11/10/17
to KeyKit
Hi all,

I am having a few issues recently.

The first weird thing is that my .types are integers and not strings. This is on a new keykit 7.3d installation on windows 7.

so a NOTEON print(blah.type) outputs 4, a noteoff 8 and midi start and stop are type 8192.

Not seen this before so any ideas.

The other problem is .port numbers. They are changing between boot sessions. As you might expect I guess. So last night the notes from my keyboard were P69. Today they are P67. I thought I could just replace the number with the integer from blah = outport("mykeyboard"), but then blah = 4?

So that's another question. How do I preempt the P attributes notes will get from different devices. This is essential for reliable scripting.

Finally, I want to filter some notes from Recorded. Actually notes on a particular channel/port, when a flag is set. I don't want my transposition notes recorded when I am transposing. I am sure this should be simple, but I can't find it. Workarounds I have considered are building a phrase of unwanted notes, then cutting them from the phrase that is cut from Recorded. Am I missing an easier way.

Any help really appreciated.

Kind regards,
Mike

Tim Thompson

unread,
Nov 10, 2017, 10:45:36 AM11/10/17
to Mike Edwards, KeyKit
 The first weird thing is that my .types are integers and not strings. This is on a new keykit 7.3d installation on windows 7.
so a NOTEON print(blah.type) outputs 4, a noteoff 8 and midi start and stop are type 8192.

.type has always been an integer.  There are built-in constants for the values, so you can say "if ( nt.type == NOTE || nt.type == CONTROLLER ) ..."

The other problem is .port numbers. They are changing between boot sessions. As you might expect I guess. So last night the notes from my keyboard were P69. Today they are P67. I thought I could just replace the number with the integer from blah = outport("mykeyboard"), but then blah = 4?

At startup, you should find the port number based on the name and put it in a global variable (e.g. "MyKeyboard = outport("mykeyboard") and then rather than hardcoding the number anywhere, get and set it using that variable (e.g. "if nt.port == MyKeyboard ) ..."

Finally, I want to filter some notes from Recorded. Actually notes on a particular channel/port, when a flag is set. I don't want my transposition notes recorded when I am transposing. I am sure this should be simple, but I can't find it. Workarounds I have considered are building a phrase of unwanted notes, then cutting them from the phrase that is cut from Recorded. Am I missing an easier way.

Doing lots of cuts and selects is natural in keykit.   Another approach would be to have a task that uses get() in a loop on the Midi input to read each note as it comes in, rather than using Recorded.
    
      ...Tim...

Mike

unread,
Nov 10, 2017, 11:30:02 AM11/10/17
to KeyKit
Hi Tim,

Thanks for coming back.

> At startup, you should find the port number based on the name and put it in a global variable (e.g. "MyKeyboard = outport("mykeyboard") and then rather than hardcoding the number anywhere, get and set it using that variable (e.g. "if nt.port == 
> MyKeyboard ) ..."

but in my test MyKeyboard was coming back as 4, but nt.port=67 in Recorded?

Mike

Tim Thompson

unread,
Nov 10, 2017, 11:37:41 AM11/10/17
to Mike, KeyKit
> At startup, you should find the port number based on the name and put it in a global variable (e.g. "MyKeyboard = outport("mykeyboard") and then rather than hardcoding the number anywhere, get and set it using that variable (e.g. "if nt.port == MyKeyboard ) ..."

but in my test MyKeyboard was coming back as 4, but nt.port=67 in Recorded?

Input ports and output ports are separate.  If you do MyKeyboard = inport("mykeyboard") you should get 67.

     ...Tim... 
Reply all
Reply to author
Forward
0 new messages