jersmi's picture

Wondering if there's a way in Vuo to create polyphonic MIDI notes with qwerty (ie, multiple keypresses), ala "Musical Typing" in Logic/GarageBand?

Receive Keyboard Buttons seems a better choice than HID at present for multiple keypresses... I think? Wondering how to handle note on's/off's, how to add notes to/take away from a Vuo list, or? Looks like Track Notes would not work here with the note input?

Related questions: is there a way to use Receive Keyboard Buttons without rendering a window (and sending to the Window input)? With Receive HID Controls, what's going on with multiple keypresses? It appears there is some unique integer for each combination of multiple keypresses? Any suggestions for how to wrangle this data?

Comments

@jersmi haven't played much

Bodysoulspirit's picture
Submitted by

jersmi haven't played much with audio yet and not with Midi at all.

Yeah I remember the Play Blues Organ sample composition from the audio category with the keyboard playing UI. One note at the time though, would require some changes.

What about using the released event output ports from the Keyboard Node ? Like Pressed would be used to ON the note and released to OFF ? The sample puts all note frequencies in a list and choose, perhaps when lists doesn't do it yet (more list nodes to come) you must manually use as many nodes as needed, perhaps it would do it as qwerty is a small number of inputs.

Related questions: is there a way to use Receive Keyboard Buttons without rendering a window

I guess yes, just don't connect a cable to the Window port of the Keyboard node. Not sure if it will play only if you are within or your app only then or in all apps ;)

Sorry just saw your question on the fly, had no time to try things, you may perhaps already know all this yet.

The PlayBluesOrgan.vuo

jersmi's picture
Submitted by

The PlayBluesOrgan.vuo example is good to see. I knew I saw a qwerty image somewhere in the examples, couldn't remember where. :-)

Yeah, I am on the same page with the stuff you mention so far. Except not connecting to the window port on Receive Keyboard Buttons means the node does not process for me. Am I missing something?

Anyway, something like this does ok for the moment for monophonic midi (still thinking about modes of (re)triggering while notes are held, I have an ADSR envelope built that I'll be inserting, retriggering the ADSR for a keypress should be one mode):

And for polyphony, looks like I can store a list of notes with Hold List, just don't know how I'd use the list to play a chord or whatever.

Yeah, I am on the same page

Bodysoulspirit's picture
Submitted by

Yeah, I am on the same page with the stuff you mention so far. Except not connecting to the window port on Receive Keyboard Buttons means the node does not process for me. Am I missing something?

Problem is when you don't use any Render X to the composition starts but no icon appears in the dock so I presume you actually stay focused on the Editor which doesn't react to the node.

A dumb workaround that works for me would be to add a List Syphon Servers node for example. It does add an Icon on the dock allowing to enter the app and then I can react to the Keyboard Button node.

There may be other nodes then List Syphonthat could work.

Polyphony is very complex

alexmitchellmus's picture
Submitted by

Polyphony is very complex area. This is probably better left to feature request for turning nodes into iterators - (so you have lots of oscillators). But even then you need to have a way to lock notes to oscillators with MIDI logic etc...

I have been thinking about contributing to this but ADSR is probably a better place to start this node set journey.

However then we need a smaller bufferr than 512 samples (you won't hear the adsr) or its built into an oscillator (which isn't fun to patch with)... A buffer of 64 samples (like PD or MAX) solves that issue.

Polyphony is very complex

jersmi's picture
Submitted by

Polyphony is very complex area.

I suppose. I'm in learning mode, enjoying the Vuo journey. I was trying to imagine polyphony as a Build List scenario....

ADSR

I guess I should say that my desires for Vuo are not for deeper audio support. It's fun to see what's possible. Partly it's that "working within limits can build character" thing.

The ADSR I have right now looks something like this, simply a few staged Curve nodes, and this leads to ideas about visual animations, keyframes and whatnot. :-)

A dumb workaround that works

jersmi's picture
Submitted by

A dumb workaround that works for me would be to add a List Syphon Servers node for example. It does add an Icon on the dock allowing to enter the app and then I can react to the Keyboard Button node.

Bodysoulspirit, that's a clever workaround! Thanks for sharing, kinda what I was hoping for at this stage prior to Vuo 10.3....

FM should be doable with

alexmitchellmus's picture
Submitted by

FM should be doable with minimal code and current oscillator (would need to drive the frequency at audio rate) and the audio library Vuo uses can do that...

If we had a dedicated ADSR node then it's doable now. (It's just an event triggered lerp volume controller with 4 States)

However if you wanted to build your own adsr enveloper in Vuo we would need to have smaller buffer so that you could get the envelope reacting fast enough.

So sometimes in Vuo you just have to "break out the code" but this is true for anythung- thankfully team Vuo has made it super simple to code nodes! (And there are plans to make it even simpler!)

Wondering how to handle note

jstrecker's picture
Submitted by

Wondering how to handle note on's/off's, how to add notes to/take away from a Vuo list, or? Looks like Track Notes would not work here with the note input?

Track Notes would actually be one way to do it. See attached composition, courtesy of Steve, for an example with 2 keys (could be expanded to more).

With Receive HID Controls, what's going on with multiple keypresses? It appears there is some unique integer for each combination of multiple keypresses? Any suggestions for how to wrangle this data?

Rather than trying to parse the raw integer data, you could get the names of the controls and use Filter Control. See attached composition, also courtesy of Steve, that demonstrates receiving the A and S keys, individually or in combination. (You might have to edit the Device input to match your HID keyboard.) To figure out the names of the controls, you can hook up Receive HID Controls -> Display Console Window.

A dumb workaround that works for me would be to add a List Syphon Servers node for example. It does add an Icon on the dock allowing to enter the app and then I can react to the Keyboard Button node.

Bodysoulspirit, that's a clever workaround! Thanks for sharing, kinda what I was hoping for at this stage prior to Vuo 10.3....

When running a composition from Vuo Editor, the keyboard (and mouse) nodes can only detect keyboard/mouse actions if the composition is a non-headless (headed?) app. Usually that means adding a window node to the composition, though it seems there are a few other nodes that do the trick. Also, exporting the composition to app makes it headed.

jersmi, is there some specific feature request for Vuo 1.3 that you're alluding to? I'm not aware of anything coming in 1.3 that would change the behavior of keyboard nodes in headless apps.

@jstrecker I believe that

alexmitchellmus's picture
Submitted by

Jaymie I believe that track notes while outputting a list of tracked notes does not hold the position within the list of the note. So for example if you have 2 oscillators, when it is playing two notes 1=1 2=2 it's fine, but if you let go of 1 then 2 will drop to position 1 in list. This is OK when there is no ADSR, but other more advanced modulations will not work with that setup.

Maybe we need a new node to remember the position of the note in the list? Or each note could have an oscillator number associated with it?

Thanks to @smokris. I learn

jersmi's picture
Submitted by

Thanks to Steve. I learn so much from his examples! Seems so simple, but it's great to know I can input "Keyboard a", "Keyboard s", etc., to filter HID values. (Where can I learn more about this?)

jersmi, is there some specific feature request for Vuo 1.3 that you're alluding to? I'm not aware of anything coming in 1.3 that would change the behavior of keyboard nodes in headless apps.

I'm still exploring solutions, thought it was a bit premature for me to make this a feature request. It looks like Steve's HID example might solve my problem here.

That said, doesn't it seem like a very good idea to have the option for "headless" keyboard input from Receive Keyboard Buttons? I guess it might have to account for scenarios like Window, Editor, Both, Any, etc. Bodysoulspirit's workaround certainly suggests the need for this.

@jstrecker I believe that

jersmi's picture
Submitted by

alexmitchellmus wrote: Jaymie I believe that track notes while outputting a list of tracked notes does not hold the position within the list of the note. So for example if you have 2 oscillators, when it is playing two notes 1=1 2=2 it's fine, but if you let go of 1 then 2 will drop to position 1 in list. This is OK when there is no ADSR, but other more advanced modulations will not work with that setup.

I haven't had a chance to play around with Steve solution yet, but at first glance I thought the 'drop to position' was a result of using Arrange Layers on Grid (ie, visual, but not actual?), and that Select Latest might be keeping Note Ons/Offs in order?

Certainly not elegant, but as a workaround, maybe worth a try to send one ADSR per voice as velocity between Switch and Make Note (and adjust the Is Note On (ie, gate) for ADSR release)? I'm not sure yet how to iterate Make Audio Wave, using Process List or whatever.

Well we don't have ADSR yet..

alexmitchellmus's picture
Submitted by

Well we don't have ADSR yet... But it wouldn't be crazy to do...

When I was playing with polyphonic note output, I was watching the list that was generated- and it was simply outputting all the notes played at once (very correctly may I add) but notes were added all over the place- not in a consistent order. So we would need a node (or composition) that holds the order of notes to feed it into the oscillator and enveloper consistently. Possibly adding a "voice number" property could do this?