Brown noise generator?
@ddw_music said:
[fexpr~] appears to be basically undocumented -- opening help on an [fexpr~] object goes to [expr] help, which neglects to explain the difference between [expr~] and [fexpr~].
http://yadegari.org/expr/expr.html
but there's no [>~] object, so how would one check that at an audio rate?
yes, I do it with [expr~] or [fexpr~]
Floating point modulo?
@ddw_music you can get rid of the floating point when multiplying by 10s and dividing at the end.
for example:
[* 10000]
[mod 20000]
[/ 10000]
fmod() you can use in [expr], [expr~] and [fexpr~]
And notice in the helpfile of [expr] >> [pd [expr] examples] the use of floats and integers
Puredata expr nested if?
I would like to enter something like the following pseudocode in PD:
if ($f1<$f3) {
output (0);
} else {
if($f1-$f3<=$f2) {
output (($f1-$f3)/$f2);
} else {
output(1.0);
}
}
So, I've tried to enter this expr if
construction:
[ expr if ($f1<$f3, 0, if( ($f1-$f3<=$f2, ($f1-$f3)/$f2, 1.0) )) ]
However, PD will not accept this, and it returns:
expr: syntax error: illegal comma
,
(
$f1
-
$f3
)
/
$f2
,
1.000000
expr: syntax error
expr if ($f1<$f3 , 0 , if( ($f1-$f3<=$f2 , ($f1-$f3)/$f2 , 1.0) ))
... couldn't create
Is there a syntax where I can use nested "if"s in an [expr]
object?
Compressor attack / release time
For the broken language your issue isn't really clear to me.
Maybe this will help:
[>]
[<=]
[>=~]
[<~]
[threshold~]
[select]
[expr if(condition, ifTrue-expr, ifFalse-expr)]
[expr~ if (condition, ifTrue-expr, ifFalse-expr)]
[expr~ if($v1>0.5, 10, 20)]
also look inside the expr-helpfile
A compressor patch is explained here:
http://designingsound.org/2013/06/28/tutorial-a-compressor-in-pure-data/
Calculation order of multiple expressions in [expr]
Ah.. it's written in the description. http://yadegari.org/expr/expr.html
So it's obviously not a bug. Still wonder if there's any reason behind it though.
Expression are evaluated from right to left (which means that the last expression defined will be the first executed.)
Wave Folding
@robertsyrett You can use different variables inside an expr object, and they refer to the corresponding inlets. For example if you have [expr~ $v1 + $v2 + $f3], the object will have 3 inlets, the first two are signal inlets ($v refers to a signal) and the third will be a control inlet ($f refers to a float). The help file for [expr] is very useful for that, and you can find further information here http://yadegari.org/expr/expr.html
When you say different wavefolders, I would assume you mean different equations as the [expr~ asin(sin($v1 *(pi/2)))] object is itself the wavefolder. The $v or $f variables refer to the object's inlets.
How to use $0 variable names in [expr]?
@cuinjune I cannot claim that I am never confused building an [expr].
You forced me to go looking for "Pd expr best practice"....... and I found this which could be useful........
http://yadegari.org/expr/expr.html
although there is no mention of why spaces are sometimes necessary. I have come a cropper before.... that's the only reason I knew.
David.
Vanilla now 0.48 available for testing
paste power
**5.1. release notes
**
------------------ 0.48-0 ------------------------------
It's possible to save and recall "settings" to files, and/or to erase system settings. On Pcs, the settings are now stored in the "user" resource area (before, it was per-machine, and users who weren't administrators apparently couldn't save their settings.)
The expr family (expr, expr~, fexpr~) got an update from Shahrokh Yadegari. I'm not sure when this first came about, but expr now can access "variable" objects as variables inside expressions. Expressions using "if" skip evaluating the argument that isn't used.
New "fudiparse", "fudiformat" objects.
New "list store" object for faster and easier concatenation and splitting apart of lists.
New notification outlet in "text define" so the patch can know when the text is changed.
New "text insert" object.
"delwrite~" now has a "clear" message.
"declare -path" inside abstractions was changed so that, if the declaration isn't an absolute filename, it's relative to the abstraction's directory, not to the owning patch's directory. This might be considered an** incompatible change**; but since the situation with paths declared inside abstractions has always been so confused, I think nobody will have got away without editing patches that relied on it as things changed in the past.
But the biggest changes are under the hood. Pd now can manage more than one running instance, so that it is possible to make plug-ins of various sorts out of Pd and they can coexist with each other. This will allow people to write much better VST plug-ins in Pd. I'm grateful to Carlos Eduardo Batista for much help on this.
The Pd API allows starting and/or shutting down the GUI dynamically while Pd is running.
Another internal change: the pd~ object now communicates with sub-processes in binary by default. This increases the numerical accuracy of signal passing (it should be exact now) and makes the passing back and forth of audio signals much more efficient.
Thanks to much effort by Dan Wilcox and Iohannes Zmoelnig, the compile-and-build system is much improved, especially for Macintosh computers. One visible effect is that language support is finally working in the compiled versions on msp.ucsd.edu.
Setting [expr] formula dynamically
@ingox @svanya Thanks, great solutions but unfortunately there is a problem with functions that require a comma. I've taken bits from your patches to come up with this solution which is fairly involved but it works.
Now the expression is taken from the argument. I've tried a few ways to send a list to the object to replace the expression and save is as new argument as well with [canvasargs], but none seemed to work when there is a comma involved. That would be very handy (in fact it was one of the main reasons to do this rather than just using [expr]) but right now my brain is melting after all the trial and errors and crashes.
There still is a problem with the use of $0. I would like the [expr] to be able to access values from tables in the parent patch. I can't think of how this could be done in my implementation since any $0 that is in the argument is passed to the abstraction as-is, and therefore becomes the $0 of the abstraction.
Setting [expr] formula dynamically
i just start to learn about the expr object, so i am not sure, but here is some information: http://yadegari.org/expr/expr.html
in the expr helpfile examples are some objects with spaces, i assume the spaces are allowed at certain positions. and you need $f1, $f2... for the variables.