Hi list,
I have a design consideration: There is a mapping abstraction where IDs of buttons are mapped to MIDI notes. There are different tunings.
Previously I used an array to store the tunings and filled this by reading a text file in which the tuning was stored.
Now, I do the same thing but I am using the text object. Nice thing here is that I can store the tuning in an object.
However in both cases I want to be able to use this abstraction either only once or multiple times.
Problem is, that if I use it multiple times the [array name] or [text define -k name] will be defined multiple times.
Is there a smart way to solve this kind of issue?
I could still use text files and load them in [array $0-name] or [text define -k $0-name] objects, but that doesn't strike me as particular elegant since they will still contain the same thing, meaning it's code duplication.
cheers
m.
Do you have concrete code examples?
Already for many years I don't use any variable which doesn't have an $0-
at the start of it. This also includes data structures structs and etc.,
or there will be clashes when using abstractions.
Hi list,
I have a design consideration: There is a mapping abstraction where IDs of buttons are mapped to MIDI
notes. There are different tunings.Previously I used an array to store the tunings and filled this by
reading a text file in which the tuning was stored.Now, I do the same thing but I am using the text object. Nice thing here
is that I can store the tuning in an object.However in both cases I want to be able to use this abstraction either
only once or multiple times.Problem is, that if I use it multiple times the [array name] or [text
define -k name] will be defined multiple times.Is there a smart way to solve this kind of issue?
I could still use text files and load them in [array $0-name] or [text
define -k $0-name] objects, but that doesn't strike me as particular
elegant since they will still contain the same thing, meaning it's code
duplication.cheers
m.
Ah, cool. Thanks IOhannes.
I tried a Pd implementation but can't get it to work. Do you know why my approach fails?
I see that NetPd has a singleton message, will try to analyze how it's done there.
m.
On 24.12.18 11:40, IOhannes m zmölnig wrote:
On 12/23/18 9:06 PM, Max wrote:
Is there a smart way to solve this kind of issue?
search for "singleton".
gadsmr IOhannes
Pd-list@lists.iem.at mailing list UNSUBSCRIBE and account-management -> https://lists.puredata.info/listinfo/pd-list
I found Enriques patch in the archive and solved it like he did. Attached just in case someone is wondering. It's probably some depth-first thing why my first approach didn't work as expected.
m.
On 30.12.18 22:10, Max wrote:
Ah, cool. Thanks IOhannes.
I tried a Pd implementation but can't get it to work. Do you know why my approach fails?
I see that NetPd has a singleton message, will try to analyze how it's done there.
m.
On 24.12.18 11:40, IOhannes m zmölnig wrote:
On 12/23/18 9:06 PM, Max wrote:
Is there a smart way to solve this kind of issue?
search for "singleton".
gadsmr IOhannes
Pd-list@lists.iem.at mailing list UNSUBSCRIBE and account-management -> https://lists.puredata.info/listinfo/pd-list
Pd-list@lists.iem.at mailing list UNSUBSCRIBE and account-management -> https://lists.puredata.info/listinfo/pd-list
I have a patch with the singleton abstraction inside an abstraction called with clone 14 times. There is a [text declare -k g_major] created once. Yet I get 14 Warnings in the Pd console like this: warning: g_major: multiply defined when looking into the other instances of the cloned abstraction with [vis 8 1( etc. I can see however that the singleton patch worked, only in instance 0 of clone is the abstraction which holds the text declare.
Likewise, the Pd search only finds one instance of the text declare.
It's this patch: https://github.com/chairaudio/tickle-examples/blob/master/Pd/A11.karplus-div...
On 31.12.18 17:50, Max wrote:
I found Enriques patch in the archive and solved it like he did. Attached just in case someone is wondering. It's probably some depth-first thing why my first approach didn't work as expected.
m.
On 30.12.18 22:10, Max wrote:
Ah, cool. Thanks IOhannes.
I tried a Pd implementation but can't get it to work. Do you know why my approach fails?
I see that NetPd has a singleton message, will try to analyze how it's done there.
m.
On 24.12.18 11:40, IOhannes m zmölnig wrote:
On 12/23/18 9:06 PM, Max wrote:
Is there a smart way to solve this kind of issue?
search for "singleton".
gadsmr IOhannes
Pd-list@lists.iem.at mailing list UNSUBSCRIBE and account-management -> https://lists.puredata.info/listinfo/pd-list
Pd-list@lists.iem.at mailing list UNSUBSCRIBE and account-management -> https://lists.puredata.info/listinfo/pd-list
Pd-list@lists.iem.at mailing list UNSUBSCRIBE and account-management -> https://lists.puredata.info/listinfo/pd-list
Maybe the clear message you put inside each abstraction clears the subpatch after pd throws the error message...
Em Ter, 1 de jan de 2019 09:55, Max abonnements@revolwear.com escreveu:
I have a patch with the singleton abstraction inside an abstraction called with clone 14 times. There is a [text declare -k g_major] created once. Yet I get 14 Warnings in the Pd console like this: warning: g_major: multiply defined when looking into the other instances of the cloned abstraction with [vis 8 1( etc. I can see however that the singleton patch worked, only in instance 0 of clone is the abstraction which holds the text declare.
Likewise, the Pd search only finds one instance of the text declare.
It's this patch:
https://github.com/chairaudio/tickle-examples/blob/master/Pd/A11.karplus-div...
On 31.12.18 17:50, Max wrote:
I found Enriques patch in the archive and solved it like he did. Attached just in case someone is wondering. It's probably some depth-first thing why my first approach didn't work as expected.
m.
On 30.12.18 22:10, Max wrote:
Ah, cool. Thanks IOhannes.
I tried a Pd implementation but can't get it to work. Do you know why my approach fails?
I see that NetPd has a singleton message, will try to analyze how it's done there.
m.
On 24.12.18 11:40, IOhannes m zmölnig wrote:
On 12/23/18 9:06 PM, Max wrote:
Is there a smart way to solve this kind of issue?
search for "singleton".
gadsmr IOhannes
Pd-list@lists.iem.at mailing list UNSUBSCRIBE and account-management -> https://lists.puredata.info/listinfo/pd-list
Pd-list@lists.iem.at mailing list UNSUBSCRIBE and account-management -> https://lists.puredata.info/listinfo/pd-list
Pd-list@lists.iem.at mailing list UNSUBSCRIBE and account-management ->
https://lists.puredata.info/listinfo/pd-list
Pd-list@lists.iem.at mailing list UNSUBSCRIBE and account-management -> https://lists.puredata.info/listinfo/pd-list
That sounds like a good lead. I've tried to strip it down to the issue, but in the minimal example the issue isn't showing.
On 01.01.19 13:53, José de Abreu wrote:
Maybe the clear message you put inside each abstraction clears the subpatch after pd throws the error message...
Em Ter, 1 de jan de 2019 09:55, Max <abonnements@revolwear.com mailto:abonnements@revolwear.com> escreveu:
I have a patch with the singleton abstraction inside an abstraction called with clone 14 times. There is a [text declare -k g_major] created once. Yet I get 14 Warnings in the Pd console like this: warning: g_major: multiply defined when looking into the other instances of the cloned abstraction with [vis 8 1( etc. I can see however that the singleton patch worked, only in instance 0 of clone is the abstraction which holds the text declare. Likewise, the Pd search only finds one instance of the text declare. It's this patch: https://github.com/chairaudio/tickle-examples/blob/master/Pd/A11.karplus-division.pd On 31.12.18 17:50, Max wrote: > I found Enriques patch in the archive and solved it like he did. > Attached just in case someone is wondering. It's probably some > depth-first thing why my first approach didn't work as expected. > > m. > > > On 30.12.18 22:10, Max wrote: >> Ah, cool. Thanks IOhannes. >> >> I tried a Pd implementation but can't get it to work. Do you know why >> my approach fails? >> >> I see that NetPd has a singleton message, will try to analyze how it's >> done there. >> >> m. >> >> >> On 24.12.18 11:40, IOhannes m zmölnig wrote: >>> On 12/23/18 9:06 PM, Max wrote: >>>> >>>> Is there a smart way to solve this kind of issue? >>>> >>> >>> search for "singleton". >>> >>> gadsmr >>> IOhannes >>> >>> >>> _______________________________________________ >>> Pd-list@lists.iem.at <mailto:Pd-list@lists.iem.at> mailing list >>> UNSUBSCRIBE and account-management -> >>> https://lists.puredata.info/listinfo/pd-list >>> >> >> >> _______________________________________________ >> Pd-list@lists.iem.at <mailto:Pd-list@lists.iem.at> mailing list >> UNSUBSCRIBE and account-management -> >> https://lists.puredata.info/listinfo/pd-list >> > > > _______________________________________________ > Pd-list@lists.iem.at <mailto:Pd-list@lists.iem.at> mailing list > UNSUBSCRIBE and account-management -> https://lists.puredata.info/listinfo/pd-list > _______________________________________________ Pd-list@lists.iem.at <mailto:Pd-list@lists.iem.at> mailing list UNSUBSCRIBE and account-management -> https://lists.puredata.info/listinfo/pd-list