Which is a less processor intensive method of wave shaping: using writing an equation once to a table and modulating tabread4~ with an incoming signal or running that signal through the expr~ (the exquation I'm using is [epxr~ $v1-($v1*$v2) + if($v1<=0, -pow(-$v1, 0.15), pow($v1, 0.15))*$v2] Where $v1 is the incoming audio signal and $v2 is value from 0 to 1. I have had success using expr~ but have a suspicion that tabread4~ might be a little less processor hungry. Anyone have any clue? Thanks -Phil
Do you Yahoo!? Yahoo! Search presents - Jib Jab's 'Second Term'
Zitiere Phillip Stearns mindphone_divided@yahoo.com:
that tabread4~ might be a little less processor hungry. Anyone have any clue?
nothing(!) is faster than reading values from a table. you have very little overhead by getting the input signal to the correct range, and a bit more by the interpolation of [tabread4~] but still, reading tables should be ways faster.
mfg.asd.r IOhannes
Hallo, zmoelnig@iem.at hat gesagt: // zmoelnig@iem.at wrote:
Zitiere Phillip Stearns mindphone_divided@yahoo.com:
that tabread4~ might be a little less processor hungry. Anyone have any clue?
nothing(!) is faster than reading values from a table. you have very little overhead by getting the input signal to the correct range, and a bit more by the interpolation of [tabread4~] but still, reading tables should be ways faster.
However, speed put aside: If you want to change the waveshaping function on the fly, then you're stuck with arithmetics as changing a table's content is generally a no go in Pd in this use case. There are some special externals for Chebyshev polynome based waveshaping. I did shabby~ and shaffy~ but they are crude and even I don't use them anymore, the better one is in Tom Schouten's collection of creb and called [cheby~]
Frank Barknecht _ ______footils.org__
Frank Barknecht fbar@footils.org writes:
However, speed put aside: If you want to change the waveshaping function on the fly, then you're stuck with arithmetics as changing a table's content is generally a no go in Pd in this use case.
Just for the record, there's a still a possibility of changing between tables (whose contents, in turn, can be changed 'behind the scenes') with the 'set' message to the [tabread4~] if swapping functions is still desirable and CPU so precious...
./MiS
Hallo, Phillip Stearns hat gesagt: // Phillip Stearns wrote:
Which is a less processor intensive method of wave shaping: using writing an equation once to a table and modulating tabread4~ with an incoming signal or running that signal through the expr~ (the exquation I'm using is [epxr~ $v1-($v1*$v2) + if($v1<=0, -pow(-$v1, 0.15), pow($v1, 0.15))*$v2] Where $v1 is the incoming audio signal and $v2 is value from 0 to 1. I have had success using expr~ but have a suspicion that tabread4~ might be a little less processor hungry. Anyone have any clue?
I would guess, that tabread4~ indeed is faster here, but I didn't do any benchmarking, which should be easy to do with an abstraction for each approach and copying it a lot of times using Pd's internal messages like in: [until 100]---[; pd-subpatch 10 10 my_test_abstraction(
Frank Barknecht _ ______footils.org__
Hallo, Frank Barknecht hat gesagt: // Frank Barknecht wrote:
I would guess, that tabread4~ indeed is faster here, but I didn't do any benchmarking, which should be easy to do with an abstraction for each approach and copying it a lot of times using Pd's internal messages like in: [until 100]---[; pd-subpatch 10 10 my_test_abstraction(
As Johannes predicted, tabread4~ is WAY faster, as you can test yourself with the little benchmark patch attached. Using 15 objects, expr~ in this case already has 80% cpu on my good ol' Athlon 900MHz while tabread4~ using a 1027 element table is at about 18%.
Frank Barknecht _ ______footils.org__