Complete newb here. I'm using the analog inputs from an arduino to send midi cc into Ableton. However, the values jump from one to another and aren't smooth at all. Is there any way to make this smoother? And also, is there an easy way to turn on and off data flow to a ctlout object? Basic questions I'm sure... I've attached my patch.
-
-
Interpolation might be appropriate, or "lowpass". Googling interpolation should give you some hits showing you how to implement cubic or sine interpolation, but that is expensive. Easier way is to "lowpass" the signal by using [average].
-
Thanks for the quick response. I'm noticing latency in general with my arduino and more so when using average. Is there any way around this or is there anything I could optimize to improve this? I should mention that I'm using firmata and Pduino.
-
try the smooth object,
but it sounds like something is wrong with the arduino. do you have rubber pads on the circuit? my arduino sends crappy data when its lying on its circuit surface even on a paper ground. could be just a matter of creepy electicity
and you should definitly not have reasonable latency. use *analog firmata*, when only working with the analog pins.
dataflow you turn on or of with a spigot object. -
I also noticed latency when using firmata, which Is why I switched to dedicate firmware.
-
Im using pretty much the same setup as you are. When I put a delay on 100 or 200 milliseconds in the arduino-code I get much less jumping parameters in Ableton.
Anyone who knows how to make such a delay in PD? Is there some way to open and close the line between two objects, like some kind of toggle-button that then can be turned quickly on and off using a metro object.
The reason why I need that is that I also have a piezo connected to the arduino and it doesnt work with a delay in the arduino code, if I hit it sends a signal so quicky that it is missed with a delay.
Hope its ok that I jump in with questions in your thread firebrandboy...
-
try speedlim, pipe, lop or iir_lop
pd redefining mathematics |expr fact(0)|==0
-
Hi, I got the same issue with an Arduino and it seems that nobody got a solution, so I made one myself:
for this you'll need the cyclone library. Basically a way to smooth input values is calculating a portion of the values constantly up to a desired size, in this pd patch you calculate the average value each 1000 values, of course this is useful if you are getting input values fast, but it can be configured for your own needs.
I hope this helps anybody having this issue.
-
How come nobody mentioned [line~]? Or is what you need not for signal objects?
-
@joex92 said:
nobody got a solution, so I made one myself
I have moving-mean and moving-median objects in my set of abstractions: (link from memory, hope I get it right) https://github.com/jamshark70/hjh-abs
hjh
-
Here is a full pd-vanilla median filter that I am using. It works pretty well, but I dont remember where does it comes from since I might tuned it and renamed it and for my need.
-
@joex92 There is a link to a great read on smoothing in the mapping library https://www.itl.nist.gov/div898/handbook/pmc/section4/pmc435.htm
[smooth_triple-help] shows results in scrolled arrays for tuning.
I think the objects are vanilla (as in the list-abs library) so even if not on deken they can still be used in 64-bit (although in this case it is using [cyclone/mousestate] for the demo).
I cannot test deken as my new antivirus install has just deleted all my Pd vanilla binaries.
I will upload the mapping library if someone wants to check it out.
David.