I'm sorry but i lack an english term for that:
3.14159265 I [round] I 3.142
So i can get the data i get from, let's say [env~], and use it properly with graphics (without jittering them around like hell). And yes, i used average and some basic math and got nice results, but something like the above would be nice as well.
Furthermore i search for a Perlin Noise object or a way to implement it. Perlin Noise is nice.
Hi Adrian, list,
Adrian wrote:
I'm sorry but i lack an english term for that:
3.14159265 I [round] I 3.142
This works for non-negative numbers:
3.14159265 | [* 1000] | [+ 0.5] | [int] | [/ 1000] | 3.142
For negative numbers, it seems [int] truncates towards 0, which is a bit weird.
Also try
[expr floor($f1,0)]
[expr ceil($f1,0)]
Which reminds me to ask, does anyone know why expr's floor and ceil require two arguments, and would it make sense to allow floor and ceil to work with a single argument only?
" expr: syntax error: function 'floor' needs 2 arguments
error: expr: syntax error ... you might be able to track this down from the Find menu. expr floor($f1) ... couldn't create "
On Tue, 24 Oct 2006, Claude Heiland-Allen wrote:
[expr floor($f1,0)] [expr ceil($f1,0)] Which reminds me to ask, does anyone know why expr's floor and ceil require two arguments,
Because of a typo that Orm Finnendahl made in 2002.
and would it make sense to allow floor and ceil to work with a single argument only?
Yes, but it wouldn't be backwards-compatible, unless [expr] allows optional arguments, but there's no way to specify that in [expr]'s function table.
_ _ __ ___ _____ ________ _____________ _____________________ ... | Mathieu Bouchard - tél:+1.514.383.3801 - http://artengine.ca/matju | Freelance Digital Arts Engineer, Montréal QC Canada
Hello,
Mathieu Bouchard wrote:
On Tue, 24 Oct 2006, Claude Heiland-Allen wrote:
[expr floor($f1,0)] [expr ceil($f1,0)] Which reminds me to ask, does anyone know why expr's floor and ceil require two arguments,
it is No 1464539 in the bug-tracker.
Because of a typo that Orm Finnendahl made in 2002.
and would it make sense to allow floor and ceil to work with a single argument only?
Yes, but it wouldn't be backwards-compatible, unless [expr] allows optional arguments, but there's no way to specify that in [expr]'s function table.
Do you really think, we should keep this (bug) for backwards compatibility? BTW, Orm told me once, that it wasn't he who wrote this code.
Siegfried
On Wed, 25 Oct 2006, s.koepf wrote:
it is No 1464539 in the bug-tracker.
Because of a typo that Orm Finnendahl made in 2002.
BTW, Orm told me once, that it wasn't he who wrote this code.
It's possible. Me, I only looked up the credits in pd/extra/expr~/ .
Do you really think, we should keep this (bug) for backwards compatibility?
No, I think that [expr] should get an optional argument feature, which would then allow floor() and ceil() to be redefined to be an either-1-or-2-argument function.
_ _ __ ___ _____ ________ _____________ _____________________ ... | Mathieu Bouchard - tél:+1.514.383.3801 - http://artengine.ca/matju | Freelance Digital Arts Engineer, Montréal QC Canada
Hi Adrian,
3.14159265 | [* 1000] | [i ] | [/ 1000] | 3.141
(not rounded but actually truncated)
Rounding could be implemented by splitting of the last comma position right of the decimal using a [moses 4] object.
Is this what you are looking for? Otherwise there is a message-lowpass filter in the iemlib or iemabs. [line] is also a good thing to smooth out data.
lg,P
Adrian wrote:
I'm sorry but i lack an english term for that:
3.14159265 I [round] I 3.142
So i can get the data i get from, let's say [env~], and use it properly with graphics (without jittering them around like hell). And yes, i used average and some basic math and got nice results, but something like the above would be nice as well.
Furthermore i search for a Perlin Noise object or a way to implement it. Perlin Noise is nice.