I was attempting to modify the Play Blues Organ example…

To power the "time" on a Wave patch, is it appropriate to use "requestedFrame", or is there something else, like QC's "patch time" patch? What I'm wondering here is, since it's audio, should the time be coming from the output window?

Also, what is the preferred way to make a square wave? In the composition you can see I use a fire periodically, a toggle, and then I have to use an add to get the range of the toggle to be correct to change the input on the Select input.

Is there a reason why selection doesn't start with 0? That is really handy in QC, because when a signal is present, it automatically turns into a signal that can select "1", on multiplexers and things like that. With Vuo, I can see it will always need extra math (not the biggest deal in the world)…but it seems like this chain of patches results in more data conversions than should be necessary.

I don't understand the feedback loop from the output of Send Live Audio, to Select Output, that then goes back to Make Audio Wave. What is it that this does to make things work?

Thanks!

Comments

To power the "time" on a Wave

smokris's picture
Submitted by

To power the "time" on a Wave patch, is it appropriate to use "requestedFrame", or is there something else, like QC's "patch time" patch? What I'm wondering here is, since it's audio, should the time be coming from the output window?

It depends on how frequently you want the Wave to update its value. If you're using the output of Wave to change the audio frequency, then it's fine for it to update much slower than the rate at which audio sample buffers are processed. Basically, you should use Send Live Audio's requestedChannels port to drive Make Audio Wave's refresh port, to ensure it produces sample buffers at the correct rate, but otherwise it's up to you.

You could drive Wave using a graphics window's requestedFrame port, or a Fire Periodically, or whatever.

Also, what is the preferred way to make a square wave?

We're planning to add a Make Pulse Wave node soon: similar to the Wave node, but it outputs a variable-width pulse wave. In the meantime, you could use a triangle Wave connected to Is Greater Than (the electrical-engineering way :^] ).

Is there a reason why selection doesn't start with 0? That is really handy in QC, because when a signal is present, it automatically turns into a signal that can select "1", on multiplexers and things like that. With Vuo, I can see it will always need extra math (not the biggest deal in the world)…but it seems like this chain of patches results in more data conversions than should be necessary.

We chose to index lists starting at 1 to favor the way most humans (C-language programmers being the exception) count. But that doesn't mean you need extra nodes:

Vuo has 2 kinds of Select Input nodes:

The left one, which you're familiar with, takes a 1-based index. The right one takes a boolean. So if you're using Toggle, you can connect it directly to the right one. (We're planning to make this distinction clearer as part of our revamping of the Select nodes during the Vuo 1.0 release.)

I don't understand the feedback loop from the output of Send Live Audio, to Select Output, that then goes back to Make Audio Wave. What is it that this does to make things work?

When you start "Play Blues Organ", it is silent. Then, the first time you press a key, it starts making audio. The Select Output makes that happen: its input is false to begin with, so the events fired by requestedChannels go nowhere. But every keypress causes Select Output to change to the trueOption, which completes the audio synthesis event loop.

We made this composition before we had the Adjust Loudness node; now that that node exists, it would probably be clearer to implement that behavior using that new node.