Dear List,
I found a bug:
My system: 0.43.1-extended-20111218 Ubuntu 11.04 qjackctl 0.3.7
metronome | | [ expr $f1; if ($f1 == 1, 1, 0); if ($f1 == 5, 2, 0); if ($f1 == 9, 3, 0); if ($f1 == 13, 4, 0); if ($f1 == 17, 5, 0); if ($f1 == 21, 6, 0); if ($f1 == 25, 7, 0); if ($f1 == 29, 8, 0); if ($f1 == 33, 9, 0); if ($f1 == 37, 10, 0); if ($f1 == 41, 11, 0); if ($f1 == 45, 12, 0); ]
When I put this expressions, pd shut down... The expr receive counts(like 1,2,3,4...and so on) from metronome.
What's the problem?
Thanks, Jong
Le 2012-01-31 à 16:07:00, Jonghyun Kim a écrit :
Dear List, I found a bug: When I put this expressions, pd shut down... What's the problem?
[expr] only supports 9 or 10 outlets at the same time, maximum, but this is not verified by [expr], which should just tell you about the limit, instead of crashing, and it's also not documented in the help.
[#expr] does not have this limitation. You may find this external in GridFlow 9.13 or 9.14. The number of outlets is basically unlimited. (I don't recommend using the one that is in GridFlow 9.12)
http://gridflow.ca/help/%23expr-help.html http://gridflow.ca/
You could also simply use several [expr] at once.
| Mathieu BOUCHARD ----- téléphone : +1.514.383.3801 ----- Montréal, QC
On 31/01/2012 16:07, Jonghyun Kim wrote:
Dear List,
I found a bug:
My system: 0.43.1-extended-20111218 Ubuntu 11.04 qjackctl 0.3.7
metronome | | [ expr $f1; if ($f1 == 1, 1, 0); if ($f1 == 5, 2, 0); if ($f1 == 9, 3, 0); if ($f1 == 13, 4, 0); if ($f1 == 17, 5, 0); if ($f1 == 21, 6, 0); if ($f1 == 25, 7, 0); if ($f1 == 29, 8, 0); if ($f1 == 33, 9, 0); if ($f1 == 37, 10, 0); if ($f1 == 41, 11, 0); if ($f1 == 45, 12, 0); ]
You could also use a [select] instead of [expr]. Something like
| [sel 1 5 9 ... ] | | | ... | [1( [2( [3( ... [t b] | [0(
Just an idea..
Lorenzo
When I put this expressions, pd shut down... The expr receive counts(like 1,2,3,4...and so on) from metronome.
What's the problem?
Thanks, Jong
Pd-list@iem.at mailing list UNSUBSCRIBE and account-management -> http://lists.puredata.info/listinfo/pd-list
Le 2012-01-31 à 18:33:00, Lorenzo Sutton a écrit :
On 31/01/2012 16:07, Jonghyun Kim wrote:
expr $f1; if ($f1 == 1, 1, 0); if ($f1 == 5, 2, 0); if ($f1 == 9, 3, 0); if ($f1 == 13, 4, 0); if ($f1 == 17, 5, 0); if ($f1 == 21, 6, 0); if ($f1 == 25, 7, 0); if ($f1 == 29, 8, 0); if ($f1 == 33, 9, 0); if ($f1 == 37, 10, 0); if ($f1 == 41, 11, 0); if ($f1 == 45, 12, 0);
You could also use a [select] instead of [expr]. Something like | [sel 1 5 9 ... ] | | | ... | [1( [2( [3( ... [t b] | [0(
Now that I think of it, with GridFlow (any version), you have this :
[listfind 1 5 9 13 17 21 25 29 33 37 41 45] | [+ 1]
To get a single index from 1 to 12, or 0 if not found.
If you really need to send a zero for each time something is not found, however, you can do this :
[#outer == (1 5 9 13 17 21 25 29 33 37 41 45)] | [# * (1 2 3 4 5 6 7 8 9 10 11 12)] | [#unpack 12] ||||||||||||
But because of the pattern of numbers involved (equally spaced), you could use [mod 4] and [div 4] to separate $f1 into two parts, one part that should be 1, and the other that should be between 1 and 12. That's quite a shortcut.
| Mathieu BOUCHARD ----- téléphone : +1.514.383.3801 ----- Montréal, QC
----- Original Message -----
From: Mathieu Bouchard matju@artengine.ca To: Lorenzo Sutton lorenzofsutton@gmail.com Cc: pd-list@iem.at Sent: Tuesday, January 31, 2012 1:04 PM Subject: Re: [PD] [expr $f1 if...] bug?
Le 2012-01-31 à 18:33:00, Lorenzo Sutton a écrit :
On 31/01/2012 16:07, Jonghyun Kim wrote:
expr $f1; if ($f1 == 1, 1, 0); if ($f1 == 5, 2, 0); if ($f1 == 9, 3, 0); if ($f1 == 13, 4, 0); if ($f1 == 17, 5, 0); if ($f1 == 21, 6, 0); if ($f1 == 25, 7, 0); if ($f1 == 29, 8, 0); if ($f1 == 33, 9, 0); if ($f1 == 37, 10, 0); if ($f1 == 41, 11, 0); if ($f1 == 45, 12, 0);
You could also use a [select] instead of [expr]. Something like | [sel 1 5 9 ... ] | | | ... | [1( [2( [3( ... [t b] | [0(
Now that I think of it, with GridFlow (any version), you have this :
[listfind 1 5 9 13 17 21 25 29 33 37 41 45] | [+ 1]
To get a single index from 1 to 12, or 0 if not found.
If you really need to send a zero for each time something is not found, however, you can do this :
[#outer == (1 5 9 13 17 21 25 29 33 37 41 45)] | [# * (1 2 3 4 5 6 7 8 9 10 11 12)] | [#unpack 12] ||||||||||||
This is where Pd users suffer.
-Jonathan
But because of the pattern of numbers involved (equally spaced), you could use [mod 4] and [div 4] to separate $f1 into two parts, one part that should be 1, and the other that should be between 1 and 12. That's quite a shortcut.
| Mathieu BOUCHARD ----- téléphone : +1.514.383.3801 ----- Montréal, QC _______________________________________________ Pd-list@iem.at mailing list UNSUBSCRIBE and account-management -> http://lists.puredata.info/listinfo/pd-list
Le 2012-01-31 à 11:15:00, Jonathan Wilkes a écrit :
From: Mathieu Bouchard matju@artengine.ca [#outer == (1 5 9 13 17 21 25 29 33 37 41 45)] | [# * (1 2 3 4 5 6 7 8 9 10 11 12)] | [#unpack 12] ||||||||||||
This is where Pd users suffer.
- Type "||||||||||||"
- Notice how long it takes and how your wrist feels
- Make 12 connections from [#unpack 12] to some message boxes.
- Notice how long it takes and how your wrist feels
I'm not actually advocating that type of solution. GridFlow is generally designed so that you put just one wire instead of N wires because you connect to just one object instead of N. This is done by grouping similar computations together in a kind of batch processing. It's a principle that comes from vector math (but extends well beyond vector-space theory).
The principle can't be used all of the time. e.g. there's no way to use it with signals ; but there are also a lot of cases in the message domain for which it's impractical. I focus on the cases where it helps. It's not just shorter for the wrist or in time to write, it's also shorter in effort of reading, and in effort of modifying.
For this case, it depends on what happens after [#unpack 12]. You could do away with [#unpack 12] and use [#to_l] or [#to_literal] or something else.
| Mathieu BOUCHARD ----- téléphone : +1.514.383.3801 ----- Montréal, QC
On 31/01/2012 19:04, Mathieu Bouchard wrote:
Le 2012-01-31 à 18:33:00, Lorenzo Sutton a écrit :
On 31/01/2012 16:07, Jonghyun Kim wrote:
expr $f1; if ($f1 == 1, 1, 0); if ($f1 == 5, 2, 0); if ($f1 == 9, 3, 0); if ($f1 == 13, 4, 0); if ($f1 == 17, 5, 0); if ($f1 == 21, 6, 0); if ($f1 == 25, 7, 0); if ($f1 == 29, 8, 0); if ($f1 == 33, 9, 0); if ($f1 == 37, 10, 0); if ($f1 == 41, 11, 0); if ($f1 == 45, 12, 0);
You could also use a [select] instead of [expr]. Something like | [sel 1 5 9 ... ] | | | ... | [1( [2( [3( ... [t b] | [0(
Now that I think of it, with GridFlow (any version), you have this :
[listfind 1 5 9 13 17 21 25 29 33 37 41 45] | [+ 1]
To get a single index from 1 to 12, or 0 if not found.
If you really need to send a zero for each time something is not found, however, you can do this :
[#outer == (1 5 9 13 17 21 25 29 33 37 41 45)] | [# * (1 2 3 4 5 6 7 8 9 10 11 12)] | [#unpack 12] ||||||||||||
But because of the pattern of numbers involved (equally spaced), you could use [mod 4] and [div 4] to separate $f1 into two parts, one part that should be 1, and the other that should be between 1 and 12. That's quite a shortcut.
Ah true! I hadn't seen the pattern initially (I saw prime numbers for some reason...) So maybe one could simply use two counters with a mod 4 'driving' the second one... No? I mean:
| [f 0] X [+ 1] | [mod 4] | [sel 1] | [f 1] X [+ 1]
On 01/31/2012 06:33 PM, Lorenzo Sutton wrote:
metronome | | [ expr $f1; if ($f1 == 1, 1, 0); if ($f1 == 5, 2, 0); if ($f1 == 9, 3, 0); if ($f1 == 13, 4, 0); if ($f1 == 17, 5, 0); if ($f1 == 21, 6, 0); if ($f1 == 25, 7, 0); if ($f1 == 29, 8, 0); if ($f1 == 33, 9, 0); if ($f1 == 37, 10, 0); if ($f1 == 41, 11, 0); if ($f1 == 45, 12, 0); ]
You could also use a [select] instead of [expr]. Something like
| [sel 1 5 9 ... ] | | | ... | [1( [2( [3( ... [t b] | [0(
or something like:
[expr int(($f1 + 3) * 0.25)] | [change 0]
cheers, y
-- yvan.volochine@gmail.com http://yvanvolochine.com
On 01/31/2012 07:33 PM, yvan volochine wrote:
or something like:
[expr int(($f1 + 3) * 0.25)] | [change 0]
which of course is wrong cause it misses the "else 0" part...
y
Yup, that sounds like a bug! Please submit a bug report and include this info :)
.hc
On Jan 31, 2012, at 10:07 AM, Jonghyun Kim wrote:
Dear List,
I found a bug:
My system: 0.43.1-extended-20111218 Ubuntu 11.04 qjackctl 0.3.7
metronome | | [ expr $f1; if ($f1 == 1, 1, 0); if ($f1 == 5, 2, 0); if ($f1 == 9, 3, 0); if ($f1 == 13, 4, 0); if ($f1 == 17, 5, 0); if ($f1 == 21, 6, 0); if ($f1 == 25, 7, 0); if ($f1 == 29, 8, 0); if ($f1 == 33, 9, 0); if ($f1 == 37, 10, 0); if ($f1 == 41, 11, 0); if ($f1 == 45, 12, 0); ]
When I put this expressions, pd shut down... The expr receive counts(like 1,2,3,4...and so on) from metronome.
What's the problem?
Thanks, Jong _______________________________________________ Pd-list@iem.at mailing list UNSUBSCRIBE and account-management -> http://lists.puredata.info/listinfo/pd-list
Looking at things from a more basic level, you can come up with a more direct solution... It may sound small in theory, but it in practice, it can change entire economies. - Amy Smith