Real time quality issues in chops? Makes Sound %$#@

Here is something I ran into while playing with sound in Touch.
In the example below, there are two Record Chops that show a significant quality difference.
Record3 is a channel being exported to the multiply parameter in the Math1 chop,
and Record2 is that same channel piped into Math3 with the channels multiplied with the “combine chops” tab.

The example (all chops are sampling at 44100):
I have a simple wave (“Wave1”) at a very high frequency.
This gives me a nice tone when connected to an Audio Out chop.

I have Wave2 which is setup to raise and lower the volume.
Math2 normalizes that wave to a range of 0 to 1.
The idea is that Wave1 is multiplied by Wave2 (once it’s normalized).

If exported to Math1, I get very noisy sound due to the reduced quality in calculation.

Is this chunky quality due to a re-cook?
Is the lowering in quality a result of having to calculate changes in realtime? (seems that way)
It seems like any change in sound (in any of my projects) in realtime creates noise, and I suspect it has to do with this difference in calculation quality.
Any way around this?
Am I just stuck with this problem?

thanks

Jim
TimesliceIssueMaybe.4.toe (8.5 MB)

Currently when you export a CHOP value, it only uses 1 value for the entire length of the CHOP its appying it to. When using the Combine CHOPs feature in the Math CHOP, it lines up the CHOP channels and multiplies them sample by sample.
I think this explains what you’re seeing

Sooooooo…

Am I stuck?
Are all my sound projects going to be noisy when exporting a channel,
and then changing it’s value?

If so, then that’s very disheartening to me.
That means my sound projects will not be able to be completed.

sigh.

Well, using the Math CHOP’s Combine CHOPs feature is the correct way to do this. Why not do that?

If we were to extend CHOP exporting so that it would use multiple values per cook it would be significantly slower than the Math CHOP’s Combine CHOPs feature, so I don’t think that’s the answer.

What are you trying to do that you can’t do with the Math CHOP?

Hi Malcolm,

The previous example was just proof of a larger issue I’m having with Designer.
Something that is making all my audio noisy in all my projects.
it’s simply not a matter of the Math chop being exported or not.
I think this happens when any parameter values in Chops has to be updated on the fly.
Check out this new example.

All op’s set to a sampling rate of 44100.
Wave3 feeds the “seed” parameter on Noise1.
Noise1 is one sample long.
Wave1 is the basic tone.
Wave1 and Noise1 are piped into Math4 with the “combine chops” feature activated.
Record1 shows the same quality issues.
The quality is reduced by calculating once per frame instead of based on sample rate.

Check out the .toe if want.

Your thoughts?

thanks

Jim


NewExampleQualityIssue.17.toe (2.35 MB)

Hmm, this sample still does what I’d expect it to. You have a CHOP thats 1 sample long, getting multiplied by one that is 441000 samples long. So all samples will get multiplied by the same number. Then the next frame you get a new random value for the 1 sample, and all 441000 samples gets multiplied by this random number, resulting it a totally different ‘step’ of the wave data, which is what the record output is.

Maybe you need to post a more direct example of your issue?

So what you’re saying (forgive any ignorance here)
is that despite the fact that all sampling rates are set to 44100,
that any changes in the data stream can only be calculated on per frame basis?

If this is the case, then this brings all my recent (well in the past year) projects to a halt.
A wall I can’t get around.

So even if I place a Filter chop (which seems to crash things these days)
it’s still only going to calculate variations based on the frame rate?

Hmm, well the creation of data is done when a node cooks, and a node is only going to cook once per frame in general. So if that’s what you mean by “that any changes in the data stream can only be calculated on per frame basis?”, then yes, that’s the case.

If you want your 441,000 Wave CHOP samples to be multiplied by 441,000 random values from a Noise CHOP, then you need to make the output of the Noise CHOP be 441,000 samples.

I think what you want to do is do-able, just not in the way you are trying. I think you are expecting too much from the 'sample rate’s of CHOPs. The sample rate is description of the channel data, letting other CHOPs know how to interact with the data (especially when trying to combine two CHOPs different sample rates). It also play a big part in timeslicing, as it determines how many samples will be in the timeslice.
It doesn’t mean the node is going to cook multiple times per frame to create extra data. Thats what timeslicing is (A timesliced node at 44,100 sample rate will create 735 samples per frame, when running at 60fps).

The Noise1 chop is actually set to output at 44100.
But if I follow you (which I might not) what you’re saying is that I need to increase cook times from 60fps to something that is more compatible with audio.
Is there a way to do this?

Here’s the idea.
Cook rates could be altered on the fly as necessary.
Perhaps from a slider (although I believe the screen info rate is locked to 60hz, but let’s pretend its not)
This would allow for larger cook calculations to be performed on audio when necessary.
I believe there would still be some initial noise in the first 60hz cook,
but maybe I can knock out a lot of the noise in this manner?

I think this leads back to the same issue that I was having when I created that “interactive ramp-top creator”.

I know Touch was designed to work on FPS,
but what I’m trying to do is merge audio and visual information.
To do this (if I understand you correctly) I have to get beyond FPS for chop calculation.

I think you’re thinking sample rate does something that it doesn’t. The Noise CHOP is set to output 2 samples, the sample rate is totally irrelevant in that respect. You could make the sample rate 100,000,000, its still only going to output 2 samples, cause that’s what its set to do.

Nah you shouldn’t change the cook times (FPS). Timeslicing is how you do this. Look at this example.

Is this what you want to do, does it make sense?
NewExampleQualityIssue.18.toe (686 KB)

I think when you talked to us about the “interactive ramp-top creator”, you were basically asking for Timeslicing, for TOPs, which isn’t possible. Luckily it is possible with CHOPs, and it’s already in TouchDesigner.

:bulb:

Hi Malcolm,

I thought that solved the problem,
and it appeared to in the example that was attached…
but it doesn’t fix the issue I’m running into here.

Just got off the phone with Ben, and Rob had a quick peak as well.

So the actual issue is: Exported value in Chops appears to be limited to a refresh rate (cook rate?) based on FPS.
So one exported value per frame.

This creates “stair steps” with calculation done above 60hz (or current FPS).
This is what is making my audio noisy.

So the big question:
Is there a different manner to get chop data to a parameter (in another op) that will allow it to update values beyond FPS?

I know it can be piped in directly, but other than that.

Thanks again

Jim

Currently there is no way to do this, and unfortunately it’d be quite a large task to add this feature (and as I mentioned, would likely run quite slow).

You’re best off asking for CHOPs like the Math CHOP that can combine CHOP channels in the ways that you need.

well, try changing the limit CHOP to ‘Normalize’ - oh, take off your headphones first. :slight_smile:

No it doesn’t solve your problem, just having fun.

I’m also frustrated by audio in Touch but find it fun anyway because my aesthetic is a little on the glortchy side anyhow.

oh well… back to work!

Rod.
MuuHaHaHaHaHAHaHAAAAH.18.toe (1.66 MB)