• ### How to smoothe out Arrays ?

Hello everybody,

this is my first post and I am a Pure Data Beginner.

I would like to smoothe out an Array in a specific way.
This for example:

This curve is meant to rise until the end. The Values arent supposed to fall at any point. Two same values after each others is also not ideal. In my original patch, I recorded a Pitchbend Automation with 16384 Values. X and Y. During recording, there happened a few midi values, which didn't fit to the rest.

I would like to smooth out the recorded curve, that it is never falling an rises up until the last x value. Like here in the manually corrected example.

I have an Idea, but as I am a beginner I am very frustrated at the moment. tried to get it to work three days.

My Idea was to create a loop, which goes through the array and stops at position "n", if value x on position "n" is smaller or the same value like at position "n-1". Then a counter starts at this position and counts until a x value is bigger than the x value at position "n-1".
If it is bigger, the counter adds the last number. After that the Patch looks what the difference is of Value x on position "n-1" and Value y on position "n-1" plus the Counter Value. After that it divides the difference into the Counter Number as the value "Increment". Then the Patch goes back to Position "n" and adds up the P Value. Then it goes to position "n+1" and adds the Value "n" plus the P Value * 2 and so on, until it reaches the highest Point. After the whole loop beginns again, until it smoothes out the Courve completely.

How can I do that? Maybe there exists already something like that? A patch or so? I appreciate easy beginner tipps!

Thank you very much!!

• | Posts 26 | Views 2264
• @whale-av said:

@Bangflip Try the vertical fader...... or the mouse if you have the cyclone/mousestate installed.
smoothe.zip
File to open....... smooth_triple-help.pd.
I have set alpha to 0.05 which seems to work well.
It is far too complex probably for what you want to achieve but hey...... it was a good evening....... and if it gets the job done then that will be a result.
David.

Very interesting patch. Thank you also very much for your helpfile. Didn't ended up using your patch for my curve, but I will defenitely safe it for future needs and learning purpose. You did some interesting things with pure data, which I didn't know. Maybe I will also do a combination of your patch for my controller converter and the patch of lacuna.

• @lacuna said:

I think the fastest response you could get with standard Vanilla, is starting PD from the console with -noaudio -nosleep flags and maybe -nogui ... if you care about this.

Yes, I care. Thank you for the suggestion.

• @Bangflip Maybe you have seen this discussion...... https://discuss.cakewalk.com/index.php?/topic/19846-mackie-control-questions/

The Mackie control is supposed to spit out a direct linear midi slope...... Mackie Control Midi Table.pdf and only clockwise/counterclockwise and count for rotary encoders (like the BCF2000).

In the discussion above "skavan" has given an approximate formula for a linearization of the Cakewalk curve. Maybe there is other information out there or a question on a Cubase forum would shed some light.
Or maybe the curve is the same in Cubase as a lot of the software developers were moving around as Cakewalk folded.

If you have jitter in the slope then make absolutely sure that you have no midi feedback anywhere in your setup....... I am a bit embarrassed to mention that as it seems you know what you are doing......
David.

• @whale-av said:

@Bangflip Maybe you have seen this discussion...... https://discuss.cakewalk.com/index.php?/topic/19846-mackie-control-questions/

The Mackie control is supposed to spit out a direct linear midi slope...... Mackie Control Midi Table.pdf and only clockwise/counterclockwise and count for rotary encoders (like the BCF2000).

In the discussion above "skavan" has given an approximate formula for a linearization of the Cakewalk curve. Maybe there is other information out there or a question on a Cubase forum would shed some light.
Or maybe the curve is the same in Cubase as a lot of the software developers were moving around as Cakewalk folded.

Hey, thank you for the discussion link!

If you have jitter in the slope then make absolutely sure that you have no midi feedback anywhere in your setup....... I am a bit embarrassed to mention that as it seems you know what you are doing......
David.

I already made sure, that there isn’t any feedback. I also think it has maybe something to do with my configuration or the values, Cubase sends out, because the little midi drops are always the same with continuus raising of the Cubase Fader.

I am experienced with sound design, yes, but I am more a creative, not a technican or programmer. It‘s a project, to invest some time and learn pure data for me.

I am thankful for every tip.

• Hey, thank you all, for your help! With the help of you, I have now made a curve correction with my Smoothed out Arrays. The Motorfaders move really smoothe now, without wiggle, as it was before.

The curve isn‘t perfect, so I need to do some finetuning, but the fadermovement is!

• @Bangflip Can you please post your noisy data so I can try a different smoothing algorithm on it? I'm porting something from the Arduino world for fun.

• @jameslo said:

@Bangflip Can you please post your noisy data so I can try a different smoothing algorithm on it? I'm porting something from the Arduino world for fun.

Yes, I deleted already my old data, but recorded this curve today, that you can use it. It's an strange curve.

I got this curve by send the pitchbend Data from Pure Data to Cubase and record as automation. All values linear via Mackie Mode. Then I switched Cubase to "Houston" Mode and recorded the the output of cubase with pd into the array. The result is always the same. I thought it has maybe to do with the 20 years old algorithm for my houston hardware. Because if I send the midi data via mackie mode to pd, it's much smoother, without these artefacts.

The curve you can see here is also a little bit different in what I described after starting this thread, because the artefacts are in the opposite direction. But it's clear to see with the eyes, how the curve should be. Would be cool, if you could also post, what you came up with. I am interested in the result.

For Forum Request.pd

• @Bangflip I don't really understand this thread with respect to the hardware, but I was just curious if this thing I ported from the Arduino library "ResponsiveAnalogRead" (https://github.com/dxinteractive/ResponsiveAnalogRead) could remove all the negative first differences without making any assumptions about which way the signal should be heading (it can). I think it's just a self-adjusting version of the exponential moving average stuff that @whale-av posted. Put both files in the same directory and open "houstonData.pd" to run it.
houstonData.pd
responsiveExpMovgAvg.pd

• @jameslo said:

@Bangflip I don't really understand this thread with respect to the hardware, but I was just curious if this thing I ported from the Arduino library "ResponsiveAnalogRead" (https://github.com/dxinteractive/ResponsiveAnalogRead) could remove all the negative first differences without making any assumptions about which way the signal should be heading (it can). I think it's just a self-adjusting version of the exponential moving average stuff that @whale-av posted. Put both files in the same directory and open "houstonData.pd" to run it.
houstonData.pd
responsiveExpMovgAvg.pd

Interesting, thank you! Will keep this for future needs.

| Posts 26 | Views 2264
Internal error.

Oops! Looks like something went wrong!