Is there anything in the API that offers ability to detect when an array has been changed and then act upon it? This would be quite useful when using array as a multislider to change values. If there isn't I am proposing providing an invisible send from array whenever it is changed with the name <array_name>_changed. It could also send exactly which element has changed.
Likewise, for the same reason, I would like to provide clipping of the drawn items to the visible area but before I do so, is there a reason one would want to keep outside elements visible as well despite their distracting appearance?
Ico
Just output the value store in the array at the desire index (with [tabread]) before to write the new value (at the same index) and compare this new value with the old with [==]. If the result is false (0) then the array change. You get also the index that changed. Or i miss something ? ++
Jack
Le lundi 27 décembre 2010 à 11:44 -0500, Ivica Ico Bukvic a écrit :
Is there anything in the API that offers ability to detect when an array has been changed and then act upon it? This would be quite useful when using array as a multislider to change values. If there isn't I am proposing providing an invisible send from array whenever it is changed with the name <array_name>_changed. It could also send exactly which element has changed.
Likewise, for the same reason, I would like to provide clipping of the drawn items to the visible area but before I do so, is there a reason one would want to keep outside elements visible as well despite their distracting appearance?
Ico
Pd-list@iem.at mailing list UNSUBSCRIBE and account-management -> http://lists.puredata.info/listinfo/pd-list
Here's my point of view:
Theres a million and one ways.
If an array is changed by some pd-internal probably you can track that
down in the "changer patch", thus you can control and know it.
Array comparison (as Jack noticed) is always possible, although slower.
You can hack into the object that you use for arraywriting (tabwrite?)
and make a simple outlet that outputs some information about the last write (such as timestamp or other trick), then by simple comparison of the last know (stored by your patch) timestamp with the value from that outlet you can always know if the array was changed. But honeslty after writing this, it doesn't seem that elegant to me :)
Best of luck, Pedri
On Mon, Dec 27, 2010 at 5:02 PM, Jack jack@rybn.org wrote:
Just output the value store in the array at the desire index (with [tabread]) before to write the new value (at the same index) and compare this new value with the old with [==]. If the result is false (0) then the array change. You get also the index that changed. Or i miss something ? ++
Jack
Le lundi 27 décembre 2010 à 11:44 -0500, Ivica Ico Bukvic a écrit :
Is there anything in the API that offers ability to detect when an array has been changed and then act upon it? This would be quite useful when using array as a multislider to change values. If there isn't I am proposing providing an invisible send from array whenever it is changed with the name <array_name>_changed. It could also send exactly which element has changed.
Likewise, for the same reason, I would like to provide clipping of the drawn items to the visible area but before I do so, is there a reason one would want to keep outside elements visible as well despite their distracting appearance?
Ico
Pd-list@iem.at mailing list UNSUBSCRIBE and account-management ->
http://lists.puredata.info/listinfo/pd-list
Pd-list@iem.at mailing list UNSUBSCRIBE and account-management -> http://lists.puredata.info/listinfo/pd-list
On Mon, 2010-12-27 at 17:16 +0000, Pedro Lopes wrote:
Here's my point of view:
Theres a million and one ways.
If an array is changed by some pd-internal probably you can track
that down in the "changer patch", thus you can control and know it.
- Array comparison (as Jack noticed) is always possible, although
slower.
Thanks all for the reply. Forgot to mention critical part--all this detection should however happen when one is "drawing" the array by clicking with the mouse onto the array's points and dragging them to new positions. Hence, there is no "middleware" patch to speak of (other than what array inherently provides). Is there anything that may provide this?
Look at the patch attached to this mail. I think array in data structures is a most elegant way to do what you are looking for. ++
Jack
Le lundi 27 décembre 2010 à 12:25 -0500, Ivica Ico Bukvic a écrit :
On Mon, 2010-12-27 at 17:16 +0000, Pedro Lopes wrote:
Here's my point of view:
Theres a million and one ways.
If an array is changed by some pd-internal probably you can track
that down in the "changer patch", thus you can control and know it.
- Array comparison (as Jack noticed) is always possible, although
slower.
Thanks all for the reply. Forgot to mention critical part--all this detection should however happen when one is "drawing" the array by clicking with the mouse onto the array's points and dragging them to new positions. Hence, there is no "middleware" patch to speak of (other than what array inherently provides). Is there anything that may provide this?
what do you mean with data structures, didn't see any in your patch.
to the original poster, if it's a control array, it should change when you tell it to. so, jack's first suggestion is the most efficient, before you do a change, see if the written indexes are really different. otherwise there is the hard solution, but that implies you have a constant data flow going on at the same time, it's not the most efficient solution.
Look at the patch attached to this mail. I think array in data structures is a most elegant way to do what you are looking for. ++
Thanks all for the reply. Forgot to mention critical part--all this detection should however happen when one is "drawing" the array by clicking with the mouse onto the array's points and dragging them to new positions. Hence, there is no "middleware" patch to speak of (other than what array inherently provides). Is there anything that may provide this?
if that's what you want to do, then there will always be changes. it's not
possible to have the hand precision.
unless you use an array that has a vertical step limit. since that's not a
feature from array, I did once a data structures abstraction to do it. but
I can't find it now.
or, if using data strucutres, you can use the click output to know when
change is being made, and compare it with an older state. that makes it
more efficient, the comparison patch doesn't have to be working at an x
rate.
actually, that abstraction I did would do the job, then. it's somewhere in
my disk, was part of a bigger patch.
Dear list
I want to design a patch that shows the frequency, bandwidth and intensity of the four major formants. With fiddle ~ I can get the frequency and intensity, but not the bandwidth. There is some object that can calculate in real time the bandwidth of an audio signal? Greetings.
On Tue, 28 Dec 2010, Felipe Rodríguez wrote:
There is some object that can calculate in real time the bandwidth of an audio signal?
What do you want exactly ?
Compute the standard deviation of the frequency histogram (spectrogram) ?
Compute the frequency bounds within which 95 % of the energy lies ?
Compute the max frequency minus the min frequency ?
Something else related to that ?
| Mathieu Bouchard ---- tél: +1.514.383.3801 ---- Villeray, Montréal, QC
El 28 de diciembre de 2010 13:25, Mathieu Bouchard matju@artengine.caescribió:
On Tue, 28 Dec 2010, Felipe Rodríguez wrote:
There is some object that can calculate in real time the bandwidth of an
audio signal?
What do you want exactly ?
I want to overlap an audio signal with a sound generated by five formants. These formants will be generated by a bank of filtered white noise. The filters will use for this purpose will be bandpass filters, which need the frequency and Q parameters of the original signal to create a smooth overlap .
Compute the standard deviation of the frequency histogram (spectrogram) ?
Compute the frequency bounds within which 95 % of the energy lies ?
Compute the max frequency minus the min frequency ?
Something else related to that ?
Thank you.
| Mathieu Bouchard ---- tél: +1.514.383.3801 ---- Villeray, Montréal, QC
Le mardi 28 décembre 2010 à 13:25 +0100, João Pais a écrit :
what do you mean with data structures, didn't see any in your patch.
It was a suggestion. My patch only show one possibility to achieve what Ico was looking for, without data structure. The use of data structure (array) is another possibility (not so elegant, as i wrote before, the click on data structure is not enough, you still need a metro or a mouse listener. However, it is most elegant graphically ! ;). ++
Jack
to the original poster, if it's a control array, it should change when you tell it to. so, jack's first suggestion is the most efficient, before you do a change, see if the written indexes are really different. otherwise there is the hard solution, but that implies you have a constant data flow going on at the same time, it's not the most efficient solution.
Look at the patch attached to this mail. I think array in data structures is a most elegant way to do what you are looking for. ++
Thanks all for the reply. Forgot to mention critical part--all this detection should however happen when one is "drawing" the array by clicking with the mouse onto the array's points and dragging them to new positions. Hence, there is no "middleware" patch to speak of (other than what array inherently provides). Is there anything that may provide this?
if that's what you want to do, then there will always be changes. it's not possible to have the hand precision. unless you use an array that has a vertical step limit. since that's not a feature from array, I did once a data structures abstraction to do it. but I can't find it now. or, if using data strucutres, you can use the click output to know when change is being made, and compare it with an older state. that makes it more efficient, the comparison patch doesn't have to be working at an x rate. actually, that abstraction I did would do the job, then. it's somewhere in
my disk, was part of a bigger patch.
It was a suggestion. My patch only show one possibility to achieve what Ico was looking for, without data structure. The use of data structure (array) is another possibility (not so elegant, as i wrote before, the click on data structure is not enough, you still need a metro or a mouse listener. However, it is most elegant graphically ! ;).
I think it's also elegant to compare, because it will trigger only when
there's a click. If I find the array+ abstraction I've done before, I
could clean it up - but only after new year.