Hello I have two questions: what are some strategies for capturing
specific live pd data into pd to reuse it later? I'm sort of
visualizing something like a buffer of some arbitrary length of time
provided by the user, then perhaps "on the one" you could re-trigger
and / or save this loop.
also: What are ways to load store and play non-audio loop data?
ideally this could work from small one-off files similar to audio
loops.
Sorry if this is an RTFM question, but the pd universe is vast and maybe
someone has done this before.
Quick response, since it's 5pm and I'm leaving work:
qlist, textfile, pool, array (for numerical data only). And lately the list object has been helpful at this too. In fact, check out the small sequencer applications that Miller has included in the help file for the list object. You may find exactly what you need. It worked for me.
~Kyle
On 9/11/06, greg gkjoyce@gmail.com wrote:
Hello I have two questions: what are some strategies for capturing specific live pd data into pd to reuse it later? I'm sort of visualizing something like a buffer of some arbitrary length of time provided by the user, then perhaps "on the one" you could re-trigger and / or save this loop. also: What are ways to load store and play non-audio loop data? ideally this could work from small one-off files similar to audio loops. Sorry if this is an RTFM question, but the pd universe is vast and maybe someone has done this before.
PD-list@iem.at mailing list UNSUBSCRIBE and account-management -> http://lists.puredata.info/listinfo/pd-list
Try using two arrays, one for the data, one for a timestamp. The two pieces of data would be associated based on a common array index. Then you can use the [textfile] object to store the data, in a form like "$data $timestamp;" on each line. Thus, each line of the textfile corresponds to an index of the array. There are some timer objects in PD to get a timestamp - you may or may not want to quantize this. If you wish to capture note events, you may need a more complicated scheme, such as: array 1: velocity, array 2: note#, array 3: timestamp.
In this scheme, you are limited in the number of total events, but not in the length of time a loop can be.
Note that PD doesn't know where a "1" is, so you will have to develop a custom timing scheme to represent loops and metred time. The standard 96 ppq timing is fairly simple to implement, depending on what resolution you need.
~David
On 9/11/06, greg gkjoyce@gmail.com wrote:
Hello I have two questions: what are some strategies for capturing specific live pd data into pd to reuse it later? I'm sort of visualizing something like a buffer of some arbitrary length of time provided by the user, then perhaps "on the one" you could re-trigger and / or save this loop. also: What are ways to load store and play non-audio loop data? ideally this could work from small one-off files similar to audio loops. Sorry if this is an RTFM question, but the pd universe is vast and maybe someone has done this before.
PD-list@iem.at mailing list UNSUBSCRIBE and account-management -> http://lists.puredata.info/listinfo/pd-list
Hallo, David Powers hat gesagt: // David Powers wrote:
Try using two arrays, one for the data, one for a timestamp. The two pieces of data would be associated based on a common array index. Then you can use the [textfile] object to store the data, in a form like "$data $timestamp;" on each line.
Somehow this sounds like pieces of data organized in a structured way. Somehow like a data structure. Somehow as if it would be moe flexible to realize with [struct] and relatives.
Frank Barknecht _ ______footils.org_ __goto10.org__
You know, after a few years of Pd frustration, I'm starting to agree with you! Time to hunker down on data structures.
~Kyle
On 9/12/06, Frank Barknecht fbar@footils.org wrote:
Hallo, David Powers hat gesagt: // David Powers wrote:
Try using two arrays, one for the data, one for a timestamp. The two pieces of data would be associated based on a common array index. Then you can use the [textfile] object to store the data, in a form like "$data $timestamp;" on each line.
Somehow this sounds like pieces of data organized in a structured way. Somehow like a data structure. Somehow as if it would be moe flexible to realize with [struct] and relatives.
Ciao
Frank Barknecht _ ______footils.org_ __goto10.org__
PD-list@iem.at mailing list UNSUBSCRIBE and account-management -> http://lists.puredata.info/listinfo/pd-list
Hallo, Kyle Klipowicz hat gesagt: // Kyle Klipowicz wrote:
You know, after a few years of Pd frustration, I'm starting to agree with you! Time to hunker down on data structures.
I attached a little sequencer example (I think, I posted it in the past as well) which just creates some random notes any plays them back according to x-position. y-position is taken as midi note value.
[pd note] contains the structure definition for this, sequence-data.pd is a general purpose struct-player.
In this form it isn't much more than a [qlist], but it's easy to extend the [struct note float x float y] data structure with more fields, for example "float length", "float instrument", "float cc" etc. Then you don't need to juggle with lots of seperate arrays and you can still edit single events.
Live recording is possible as well of course: I'd just use [timer] for this, just reset the timer at the start of recording, then on every incoming event bang the timer to output the current time and use that as x-position when [append]ing a new struct-instance, maybe scaled by a speed-factor.
Frank Barknecht _ ______footils.org_ __goto10.org__
Thanks a bunch, Frank! I downloaded your example a while ago, but it's lost in one of my many full and disorganized patch directories. It's nice to see it again.
Greg, I am just starting to get serious about learning data structures. They are a bit obtuse and off-putting at first, but Frank is correct. You are much better using a single data structure to manage your parametric data than using a bunch of separate arrays.
To learn about data structures, here are some tutorials I can recommend (Miller's description in the Pd Manual always confuses me):
http://puredata.org/Members/ggkarman/Tutoriales/datastruct_en_02/view http://puredata.org/community/projects/convention04/lectures/tk-barknecht/tu...
Good luck!
~Kyle
On 9/12/06, Frank Barknecht fbar@footils.org wrote:
Hallo, Kyle Klipowicz hat gesagt: // Kyle Klipowicz wrote:
You know, after a few years of Pd frustration, I'm starting to agree with you! Time to hunker down on data structures.
I attached a little sequencer example (I think, I posted it in the past as well) which just creates some random notes any plays them back according to x-position. y-position is taken as midi note value.
[pd note] contains the structure definition for this, sequence-data.pd is a general purpose struct-player.
In this form it isn't much more than a [qlist], but it's easy to extend the [struct note float x float y] data structure with more fields, for example "float length", "float instrument", "float cc" etc. Then you don't need to juggle with lots of seperate arrays and you can still edit single events.
Live recording is possible as well of course: I'd just use [timer] for this, just reset the timer at the start of recording, then on every incoming event bang the timer to output the current time and use that as x-position when [append]ing a new struct-instance, maybe scaled by a speed-factor.
Ciao
Frank Barknecht _ ______footils.org_ __goto10.org__
PD-list@iem.at mailing list UNSUBSCRIBE and account-management -> http://lists.puredata.info/listinfo/pd-list
I have to admit, I opened this stuff up, and I still JUST DON'T GET IT! The whole patch confuses me. Nothing has made me feel as stupid, as my unsuccesful attempts to learn data structures.
What order do you go through, when you design such a patch? If you could explain that, it might give me an idea of how to analyse your patch, one component at a time.
~David
On 9/12/06, Frank Barknecht fbar@footils.org wrote:
Hallo, Kyle Klipowicz hat gesagt: // Kyle Klipowicz wrote:
You know, after a few years of Pd frustration, I'm starting to agree with you! Time to hunker down on data structures.
I attached a little sequencer example (I think, I posted it in the past as well) which just creates some random notes any plays them back according to x-position. y-position is taken as midi note value.
[pd note] contains the structure definition for this, sequence-data.pd is a general purpose struct-player.
In this form it isn't much more than a [qlist], but it's easy to extend the [struct note float x float y] data structure with more fields, for example "float length", "float instrument", "float cc" etc. Then you don't need to juggle with lots of seperate arrays and you can still edit single events.
Live recording is possible as well of course: I'd just use [timer] for this, just reset the timer at the start of recording, then on every incoming event bang the timer to output the current time and use that as x-position when [append]ing a new struct-instance, maybe scaled by a speed-factor.
Ciao
Frank Barknecht _ ______footils.org_ __goto10.org__
PD-list@iem.at mailing list UNSUBSCRIBE and account-management -> http://lists.puredata.info/listinfo/pd-list
I'm sure that's true, but I'm I had problems understanding the existing data structure tutorials. Just the definition of the term "scalar" confused me, for starters. It's not even entirely clear, from the tutorials, that structures might be useful, if you don't care about the graphic part. For some reason, the struct in C makes much more sense. Probably it's just some new terminology that I don't recognize.
Perhaps I need a different tutorial approach, such as beginning with the problem of the sequencer, and then showing how a data structure can solve that problem. Maybe looking at your examples below will allow me to finally make sense of it. If I figure it out, I could consider writing such a "top down" tutorial.
~David
On 9/12/06, Frank Barknecht fbar@footils.org wrote:
Hallo, David Powers hat gesagt: // David Powers wrote:
Try using two arrays, one for the data, one for a timestamp. The two pieces of data would be associated based on a common array index. Then you can use the [textfile] object to store the data, in a form like "$data $timestamp;" on each line.
Somehow this sounds like pieces of data organized in a structured way. Somehow like a data structure. Somehow as if it would be moe flexible to realize with [struct] and relatives.
Ciao
Frank Barknecht _ ______footils.org_ __goto10.org__
PD-list@iem.at mailing list UNSUBSCRIBE and account-management -> http://lists.puredata.info/listinfo/pd-list
Hallo, David Powers hat gesagt: // David Powers wrote:
I'm sure that's true, but I'm I had problems understanding the existing data structure tutorials. Just the definition of the term "scalar" confused me, for starters. It's not even entirely clear, from the tutorials, that structures might be useful, if you don't care about the graphic part. For some reason, the struct in C makes much more sense. Probably it's just some new terminology that I don't recognize.
hm, did you read this: http://puredata.info/community/projects/convention04/lectures/tk-barknecht/t...
It's trying to explain all this stuff in very small steps, and reportedly people seem to get along with it quite well. There also is a pdf on puredata.info, but I don't have URL availabl atm. Check the archives.
Regarding the sequencer-example: I admit it's not documented, but it's kind of too advanced anyways if you didn't yet do or understand the basics tutorial.
But to give a broad overview: In your array-based approach you have different arrays for different needs: One to store time stamps, another to store note value etc.
timestamp [table ts]: t0 t1 t2 ... tn notes [table note]: n0 n1 n2 ... nn ...
A data structure in Pd is similar to this, but it's like one column of all these tables crammed into one single "thing":
[struct ds float ts float note]
ts note
| |
ds 0: t0 n0 ... ds 1: t1 n1 ... ds 2: t2 n2 ... ... ds n: tn nn ...
You then use the [set] and [get] objects to access or change these fields:
1028 | 60 pointer | | | [set ds ts note]
pointer | [get ds ts note] | | | 60 1028
The "pointer" in the graphic above is used to select a data structure instance to work on with get or set. You may think of the pointer as equivalent to the number you would use to index all the tables from your table-based approach:
[struct ds float ts float note] <=> [table ts], [table note] pointer <=> [f]: index from 0, 1, 2, ... ,n get <=> tabread set <=> tabwrite "next" <=> increment index: [+ 1] "traverse pd-data" <=> reset index to 0 and "set table" message for tabwrite/-read
Whereas with tables you have lots of tables to store data, with data structures, you have one definition (struct ...) and then one or more subpatches to hold the actual data.
So data structures can be seen as an extension of [table]. In fact, they even share part of their implementation AFAIK. A [table] in Pd is just a special kind of data structure that's predefined.
Frank Barknecht _ ______footils.org_ __goto10.org__
Okay, I did try to go through most of your tutorial, but for some reason the post below seems much clearer. Just what I needed, thanks.
Hopefully I can make more sense of things from here.
~David
On 9/12/06, Frank Barknecht fbar@footils.org wrote:
Hallo, David Powers hat gesagt: // David Powers wrote:
I'm sure that's true, but I'm I had problems understanding the existing data structure tutorials. Just the definition of the term "scalar" confused me, for starters. It's not even entirely clear, from the tutorials, that structures might be useful, if you don't care about the graphic part. For some reason, the struct in C makes much more sense. Probably it's just some new terminology that I don't recognize.
hm, did you read this: http://puredata.info/community/projects/convention04/lectures/tk-barknecht/t...
It's trying to explain all this stuff in very small steps, and reportedly people seem to get along with it quite well. There also is a pdf on puredata.info, but I don't have URL availabl atm. Check the archives.
Regarding the sequencer-example: I admit it's not documented, but it's kind of too advanced anyways if you didn't yet do or understand the basics tutorial.
But to give a broad overview: In your array-based approach you have different arrays for different needs: One to store time stamps, another to store note value etc.
timestamp [table ts]: t0 t1 t2 ... tn notes [table note]: n0 n1 n2 ... nn ...
A data structure in Pd is similar to this, but it's like one column of all these tables crammed into one single "thing":
[struct ds float ts float note]
ts note | |
ds 0: t0 n0 ... ds 1: t1 n1 ... ds 2: t2 n2 ... ... ds n: tn nn ...
You then use the [set] and [get] objects to access or change these fields:
1028 | 60 pointer | | | [set ds ts note]
pointer | [get ds ts note] | | | 60 1028
The "pointer" in the graphic above is used to select a data structure instance to work on with get or set. You may think of the pointer as equivalent to the number you would use to index all the tables from your table-based approach:
[struct ds float ts float note] <=> [table ts], [table note] pointer <=> [f]: index from 0, 1, 2, ... ,n get <=> tabread set <=> tabwrite "next" <=> increment index: [+ 1] "traverse pd-data" <=> reset index to 0 and "set table" message for tabwrite/-read
Whereas with tables you have lots of tables to store data, with data structures, you have one definition (struct ...) and then one or more subpatches to hold the actual data.
So data structures can be seen as an extension of [table]. In fact, they even share part of their implementation AFAIK. A [table] in Pd is just a special kind of data structure that's predefined.
Ciao
Frank Barknecht _ ______footils.org_ __goto10.org__
PD-list@iem.at mailing list UNSUBSCRIBE and account-management -> http://lists.puredata.info/listinfo/pd-list
From what I understand, a "scalar" in DS lingo is really a
multi-variable, which is turned into a multidimensional array using the pointer as an index. Is this even half-right?
What I don't understand is why there is a completely different atom, pointer, to index the datastructures. Why not just use an integer? Is it faster?
~Kyle
On 9/12/06, David Powers cyborgk@gmail.com wrote:
Okay, I did try to go through most of your tutorial, but for some reason the post below seems much clearer. Just what I needed, thanks.
Hopefully I can make more sense of things from here.
~David
On 9/12/06, Frank Barknecht fbar@footils.org wrote:
Hallo, David Powers hat gesagt: // David Powers wrote:
I'm sure that's true, but I'm I had problems understanding the existing data structure tutorials. Just the definition of the term "scalar" confused me, for starters. It's not even entirely clear, from the tutorials, that structures might be useful, if you don't care about the graphic part. For some reason, the struct in C makes much more sense. Probably it's just some new terminology that I don't recognize.
hm, did you read this: http://puredata.info/community/projects/convention04/lectures/tk-barknecht/t...
It's trying to explain all this stuff in very small steps, and reportedly people seem to get along with it quite well. There also is a pdf on puredata.info, but I don't have URL availabl atm. Check the archives.
Regarding the sequencer-example: I admit it's not documented, but it's kind of too advanced anyways if you didn't yet do or understand the basics tutorial.
But to give a broad overview: In your array-based approach you have different arrays for different needs: One to store time stamps, another to store note value etc.
timestamp [table ts]: t0 t1 t2 ... tn notes [table note]: n0 n1 n2 ... nn ...
A data structure in Pd is similar to this, but it's like one column of all these tables crammed into one single "thing":
[struct ds float ts float note]
ts note | |
ds 0: t0 n0 ... ds 1: t1 n1 ... ds 2: t2 n2 ... ... ds n: tn nn ...
You then use the [set] and [get] objects to access or change these fields:
1028 | 60 pointer | | | [set ds ts note]
pointer | [get ds ts note] | | | 60 1028
The "pointer" in the graphic above is used to select a data structure instance to work on with get or set. You may think of the pointer as equivalent to the number you would use to index all the tables from your table-based approach:
[struct ds float ts float note] <=> [table ts], [table note] pointer <=> [f]: index from 0, 1, 2, ... ,n get <=> tabread set <=> tabwrite "next" <=> increment index: [+ 1] "traverse pd-data" <=> reset index to 0 and "set table" message for tabwrite/-read
Whereas with tables you have lots of tables to store data, with data structures, you have one definition (struct ...) and then one or more subpatches to hold the actual data.
So data structures can be seen as an extension of [table]. In fact, they even share part of their implementation AFAIK. A [table] in Pd is just a special kind of data structure that's predefined.
Ciao
Frank Barknecht _ ______footils.org_ __goto10.org__
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
And also, can an array be a valid ds entry (i.e. [struct ds array fft aray sigblock])? That would be awesome, if it was efficient and quick!
~Kyle
On 9/12/06, Kyle Klipowicz kyleklip@gmail.com wrote:
From what I understand, a "scalar" in DS lingo is really a multi-variable, which is turned into a multidimensional array using the pointer as an index. Is this even half-right?
What I don't understand is why there is a completely different atom, pointer, to index the datastructures. Why not just use an integer? Is it faster?
~Kyle
On 9/12/06, David Powers cyborgk@gmail.com wrote:
Okay, I did try to go through most of your tutorial, but for some reason the post below seems much clearer. Just what I needed, thanks.
Hopefully I can make more sense of things from here.
~David
On 9/12/06, Frank Barknecht fbar@footils.org wrote:
Hallo, David Powers hat gesagt: // David Powers wrote:
I'm sure that's true, but I'm I had problems understanding the existing data structure tutorials. Just the definition of the term "scalar" confused me, for starters. It's not even entirely clear, from the tutorials, that structures might be useful, if you don't care about the graphic part. For some reason, the struct in C makes much more sense. Probably it's just some new terminology that I don't recognize.
hm, did you read this: http://puredata.info/community/projects/convention04/lectures/tk-barknecht/t...
It's trying to explain all this stuff in very small steps, and reportedly people seem to get along with it quite well. There also is a pdf on puredata.info, but I don't have URL availabl atm. Check the archives.
Regarding the sequencer-example: I admit it's not documented, but it's kind of too advanced anyways if you didn't yet do or understand the basics tutorial.
But to give a broad overview: In your array-based approach you have different arrays for different needs: One to store time stamps, another to store note value etc.
timestamp [table ts]: t0 t1 t2 ... tn notes [table note]: n0 n1 n2 ... nn ...
A data structure in Pd is similar to this, but it's like one column of all these tables crammed into one single "thing":
[struct ds float ts float note]
ts note | |
ds 0: t0 n0 ... ds 1: t1 n1 ... ds 2: t2 n2 ... ... ds n: tn nn ...
You then use the [set] and [get] objects to access or change these fields:
1028 | 60 pointer | | | [set ds ts note]
pointer | [get ds ts note] | | | 60 1028
The "pointer" in the graphic above is used to select a data structure instance to work on with get or set. You may think of the pointer as equivalent to the number you would use to index all the tables from your table-based approach:
[struct ds float ts float note] <=> [table ts], [table note] pointer <=> [f]: index from 0, 1, 2, ... ,n get <=> tabread set <=> tabwrite "next" <=> increment index: [+ 1] "traverse pd-data" <=> reset index to 0 and "set table" message for tabwrite/-read
Whereas with tables you have lots of tables to store data, with data structures, you have one definition (struct ...) and then one or more subpatches to hold the actual data.
So data structures can be seen as an extension of [table]. In fact, they even share part of their implementation AFAIK. A [table] in Pd is just a special kind of data structure that's predefined.
Ciao
Frank Barknecht _ ______footils.org_ __goto10.org__
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
--
http://theradioproject.com http://perhapsidid.blogspot.com
(((())))(()()((((((((()())))()(((((((())()()())()))) (())))))(()))))))))))))(((((((((((()()))))))))((()))) ))(((((((((((())))())))))))))))))))__________ _____())))))(((((((((((((()))))))))))_______ ((((((())))))))))))((((((((000)))oOOOOOO
On Tue, Sep 12, 2006 at 11:26:25AM -0500, Kyle Klipowicz wrote:
And also, can an array be a valid ds entry (i.e. [struct ds array fft aray sigblock])? That would be awesome, if it was efficient and quick!
Yep, you can make an array be part of a datastructure (check pd's help files for [struct] and friends) but it's not that efficient and quick, and you can't use it like a regular array (e.g. you can't use [tabread~] and friends).
One abstraction that I made which tried to read an array and interpolated between values very quickly slowed down my patches intensely when I had a couple of them instantiated. This could be my own patching ineptitude though.
Best,
Chris.
chris@mccormick.cx http://mccormick.cx
On Tue, 12 Sep 2006, Kyle Klipowicz wrote:
What I don't understand is why there is a completely different atom, pointer, to index the datastructures. Why not just use an integer? Is it faster?
This is because Miller is still using linked-lists for a bunch of things in Pd. Getting to element number N in a linked-list takes N steps, if you don't have a pointer that gives you direct access. So, yes, it's faster.
I won't advocate switching to integers and B-trees or something, because there's also an advantage to using pointers: if you delete or insert elements in a list, all integers pointing to a later part of the list will get shifted to different elements; with pointers it's not the case.
(a B-tree is one kind of array-like structure in which inserting and deleting is a lot faster than in regular arrays. it's made using several levels of nested arrays. This is not the same as a binary-tree, which also can be used as a fast-inserting array, but which is slower than a B-tree)
(Pd could be reimplemented with a variant on the integer system in which integers wouldn't indicate the order of the objects, but i don't think that it's really worth it.)
_ _ __ ___ _____ ________ _____________ _____________________ ... | Mathieu Bouchard - tél:+1.514.383.3801 - http://artengine.ca/matju | Freelance Digital Arts Engineer, Montréal QC Canada
Ah, so is the [pointer] object the same thing as a C pointer (*ptr) traversing a linked list? I knew the had the same name, but since so many things are named strangely in Pd (right Matju?) I couldn't be sure.
I guess the difficult thing for me with data structures is there is only the ability to traverse and step ahead, so it seems that there will be a lot of [until] use to get to specific portions of the data. There is no step backwards or prepend feature, or push/pop stuff either, which would be nice. I guess they'd have to be abstractions? And what would be the most efficient way to keep track of things, some kind of construct using [until] or a counter and comparing that with an index value in the scalar? Arrrg.
~Kyle
On 9/12/06, Mathieu Bouchard matju@artengine.ca wrote:
On Tue, 12 Sep 2006, Kyle Klipowicz wrote:
What I don't understand is why there is a completely different atom, pointer, to index the datastructures. Why not just use an integer? Is it faster?
This is because Miller is still using linked-lists for a bunch of things in Pd. Getting to element number N in a linked-list takes N steps, if you don't have a pointer that gives you direct access. So, yes, it's faster.
I won't advocate switching to integers and B-trees or something, because there's also an advantage to using pointers: if you delete or insert elements in a list, all integers pointing to a later part of the list will get shifted to different elements; with pointers it's not the case.
(a B-tree is one kind of array-like structure in which inserting and deleting is a lot faster than in regular arrays. it's made using several levels of nested arrays. This is not the same as a binary-tree, which also can be used as a fast-inserting array, but which is slower than a B-tree)
(Pd could be reimplemented with a variant on the integer system in which integers wouldn't indicate the order of the objects, but i don't think that it's really worth it.)
_ _ __ ___ _____ ________ _____________ _____________________ ... | Mathieu Bouchard - tél:+1.514.383.3801 - http://artengine.ca/matju | Freelance Digital Arts Engineer, Montréal QC Canada
On Tue Sep 12, 2006 at 12:36:52PM -0500, Kyle Klipowicz wrote:
Ah, so is the [pointer] object the same thing as a C pointer (*ptr) traversing a linked list? I knew the had the same name, but since so many things are named strangely in Pd (right Matju?) I couldn't be sure.
I guess the difficult thing for me with data structures is there is only the ability to traverse and step ahead, so it seems that there will be a lot of [until] use to get to specific portions of the data. There is no step backwards or prepend feature, or push/pop stuff either, which would be nice
you should check out PDContainer. it has a vast collection of various types of data structures. far more than are built-in. altho it isnt tightly coupled to a particular GUI display, so youd have to build that part yourself, if you want graphical editing..
What would be the comparitive efficiency, of keeping track of data with pyext and a simple Python script, versus creating a data structure to hold the data?
Many tasks that are annoying to do in Pure Data, take about two minutes to do in Python. At least for me.
~David
On 9/12/06, Kyle Klipowicz kyleklip@gmail.com wrote:
Ah, so is the [pointer] object the same thing as a C pointer (*ptr) traversing a linked list? I knew the had the same name, but since so many things are named strangely in Pd (right Matju?) I couldn't be sure.
I guess the difficult thing for me with data structures is there is only the ability to traverse and step ahead, so it seems that there will be a lot of [until] use to get to specific portions of the data. There is no step backwards or prepend feature, or push/pop stuff either, which would be nice. I guess they'd have to be abstractions? And what would be the most efficient way to keep track of things, some kind of construct using [until] or a counter and comparing that with an index value in the scalar? Arrrg.
~Kyle
On 9/12/06, Mathieu Bouchard matju@artengine.ca wrote:
On Tue, 12 Sep 2006, Kyle Klipowicz wrote:
What I don't understand is why there is a completely different atom, pointer, to index the datastructures. Why not just use an integer? Is it faster?
This is because Miller is still using linked-lists for a bunch of things in Pd. Getting to element number N in a linked-list takes N steps, if you don't have a pointer that gives you direct access. So, yes, it's faster.
I won't advocate switching to integers and B-trees or something, because there's also an advantage to using pointers: if you delete or insert elements in a list, all integers pointing to a later part of the list will get shifted to different elements; with pointers it's not the case.
(a B-tree is one kind of array-like structure in which inserting and deleting is a lot faster than in regular arrays. it's made using several levels of nested arrays. This is not the same as a binary-tree, which also can be used as a fast-inserting array, but which is slower than a B-tree)
(Pd could be reimplemented with a variant on the integer system in which integers wouldn't indicate the order of the objects, but i don't think that it's really worth it.)
_ _ __ ___ _____ ________ _____________ _____________________ ... | Mathieu Bouchard - tél:+1.514.383.3801 - http://artengine.ca/matju | Freelance Digital Arts Engineer, Montréal QC Canada
--
http://theradioproject.com http://perhapsidid.blogspot.com
(((())))(()()((((((((()())))()(((((((())()()())()))) (())))))(()))))))))))))(((((((((((()()))))))))((()))) ))(((((((((((())))())))))))))))))))__________ _____())))))(((((((((((((()))))))))))_______ ((((((())))))))))))((((((((000)))oOOOOOO
PD-list@iem.at mailing list UNSUBSCRIBE and account-management -> http://lists.puredata.info/listinfo/pd-list
On Tue Sep 12, 2006 at 01:14:56PM -0500, David Powers wrote:
What would be the comparitive efficiency, of keeping track of data with pyext and a simple Python script, versus creating a data structure to hold the data?
the main reason i dont use the millerstructures is their tight coupling to a crippled GUI, the inability to fix that without hacking voluminous C code, and the dearth of methods to manipulate and store the data (key/value arrays, queues that you can push/pop, etc), and the need to rigidly define the format of the data beforehand, SQL style. but that doesnt mean i go right to Python. you can do quite a bit with PDContainer, and using stock PD objects for the actual timestamping and playback of the data (del, pipe, timer, etc)..
Many tasks that are annoying to do in Pure Data, take about two minutes to do in Python. At least for me.
i woudlnt want python driving the event loop for something like note playback... i'd maybe use PyGTK for a GUI, if Tk didnt kick ass, though... :)
there is a Python extnesion that someone came up with to give it better timing, for music applications, might want to search the recent linux-audio-{user,dev} archives..
What's PDContainer? I never heard of it? Does it work on WinXP? ~David
On 9/12/06, carmen _@whats-your.name wrote:
On Tue Sep 12, 2006 at 01:14:56PM -0500, David Powers wrote:
What would be the comparitive efficiency, of keeping track of data with pyext and a simple Python script, versus creating a data structure to hold the data?
the main reason i dont use the millerstructures is their tight coupling to a crippled GUI, the inability to fix that without hacking voluminous C code, and the dearth of methods to manipulate and store the data (key/value arrays, queues that you can push/pop, etc), and the need to rigidly define the format of the data beforehand, SQL style. but that doesnt mean i go right to Python. you can do quite a bit with PDContainer, and using stock PD objects for the actual timestamping and playback of the data (del, pipe, timer, etc)..
Many tasks that are annoying to do in Pure Data, take about two minutes to do in Python. At least for me.
i woudlnt want python driving the event loop for something like note playback... i'd maybe use PyGTK for a GUI, if Tk didnt kick ass, though... :)
there is a Python extnesion that someone came up with to give it better timing, for music applications, might want to search the recent linux-audio-{user,dev} archives..
PD-list@iem.at mailing list UNSUBSCRIBE and account-management -> http://lists.puredata.info/listinfo/pd-list
On Tue Sep 12, 2006 at 02:05:17PM -0500, David Powers wrote:
What's PDContainer? I never heard of it? Does it work on WinXP?
theres a windows binary at http://grh.mur.at/software/pdcontainer.html
Hallo, David Powers hat gesagt: // David Powers wrote:
What would be the comparitive efficiency, of keeping track of data with pyext and a simple Python script, versus creating a data structure to hold the data?
Many tasks that are annoying to do in Pure Data, take about two minutes to do in Python. At least for me.
It's no problem to use pyext for handling sequence data. I would probably do the actual sequencing, that is, the timed creation of events, outside pyext using [del], [pipe] and [metro] as usual. I would use pyext to hold and modify the "score" as a kind of [textfile] on steroids.
Your gain would be - besides simpler patches - that you don't need to pass so many messages around, as you can do a lot of stuff directly inside your pyext object. This can be especially handy for doing list operations which are quite common in sequencing. In Pd and with [list]-abs lists get unpacked and repacked all the time, which can be costly. In pyext you could just store lists or lists of lists or dictionaries of lists and output them after processing them inside Python.
I also used the PDContainers as textfile-replacements, however they lack the flexibility of pyext when it comes to modify the stored data without passing them through Pd's message flow, so if you want to achieve this, you should use pyext (or one of the other embedded languages like gridflow, Snd/Scheme, pf, k_cext etc.)
Frank Barknecht _ ______footils.org_ __goto10.org__
That's the answer I was hoping for! Unfortunately, I probably can't play with this in the immediate future, but hopefully I will have time soon.
One extra advantage of this: I write some Python scripts to create arbitrary Midi files using PyMIDI. With pyext, the data that is used to create the Midi file could come from Pure Data, letting me create a very useful type of sequencer.
Midi files may not seem like a very exciting format, but it's a format that I can import into Finale to create notation for traditional instruments. Not to mention, data-bending or arbitrarily manipulating a Midi piece could yield interesting results.
~David
On 9/13/06, Frank Barknecht fbar@footils.org wrote:
It's no problem to use pyext for handling sequence data. I would probably do the actual sequencing, that is, the timed creation of events, outside pyext using [del], [pipe] and [metro] as usual. I would use pyext to hold and modify the "score" as a kind of [textfile] on steroids.
Your gain would be - besides simpler patches - that you don't need to pass so many messages around, as you can do a lot of stuff directly inside your pyext object. This can be especially handy for doing list operations which are quite common in sequencing. In Pd and with [list]-abs lists get unpacked and repacked all the time, which can be costly. In pyext you could just store lists or lists of lists or dictionaries of lists and output them after processing them inside Python.
I also used the PDContainers as textfile-replacements, however they lack the flexibility of pyext when it comes to modify the stored data without passing them through Pd's message flow, so if you want to achieve this, you should use pyext (or one of the other embedded languages like gridflow, Snd/Scheme, pf, k_cext etc.)
Ciao
Frank Barknecht _ ______footils.org_ __goto10.org__
PD-list@iem.at mailing list UNSUBSCRIBE and account-management -> http://lists.puredata.info/listinfo/pd-list
On Tue, 12 Sep 2006, Kyle Klipowicz wrote:
Ah, so is the [pointer] object the same thing as a C pointer (*ptr) traversing a linked list?
It's the closest that you can get in pd, but it's not directly a C pointer:
[pointer] holds one A_POINTER atom like [f] does for A_FLOAT and [symbol] for A_SYMBOL.
an A_POINTER points to a t_gpointer, which is an intermediate thing that makes it safe to use pointers to things that may disappear from memory. (outside pd it's called "weak pointer" or "weakref")
a t_gpointer can only point to a t_scalar or to the element of a t_array. at the same time it also gives access to the canvas containing the scalar or the array containing the element.
However, GEM and GridFlow pretends that it's a direct pointer because Miller gave us no other choice.
I knew the had the same name, but since so many things are named strangely in Pd (right Matju?) I couldn't be sure.
when using Pd it's important to distinguish between pointers, pointers and pointers, as well as between objects, objects, objects and objects, and also canvases vs canvases, but I shall not forget the opposition between lists and lists, and the one between pd, pd, pd and pd. (anyone up for some disambiguation?)
_ _ __ ___ _____ ________ _____________ _____________________ ... | Mathieu Bouchard - tél:+1.514.383.3801 - http://artengine.ca/matju | Freelance Digital Arts Engineer, Montréal QC Canada
Hallo, Mathieu Bouchard hat gesagt: // Mathieu Bouchard wrote:
and the one between pd, pd, pd and pd. (anyone up for some disambiguation?)
Don't forget about "Pd" which is the official way to abbreviate "Pure Data" (sic!) if you accept Miller's papers since 1996 as reference.
Frank Barknecht _ ______footils.org_ __goto10.org__
On Wed, 13 Sep 2006, Frank Barknecht wrote:
Mathieu Bouchard hat gesagt: // Mathieu Bouchard wrote:
and the one between pd, pd, pd and pd. (anyone up for some disambiguation?)
Don't forget about "Pd" which is the official way to abbreviate "Pure Data" (sic!) if you accept Miller's papers since 1996 as reference.
That's another problem: I was talking about ambiguity, not about aliases.
Ambiguity: "pd" can mean:
the Pure Data environment itself
the [pd] class, for making subpatch
the pd receiver, for system messages, like [; pd dsp 1<
a t_pd, which is what would be called "an object" in the terminology of
other languages. However, I can think of five meanings (not four) for the word "object" in pd, and I haven't really searched for them.
Aliases: when you download "Pure Data" or "Pd" from Miller, it's in a tarball whose filename starts with "pd". To start it, run the command "pd" in Linux or "Pd" in OSX. Community sites about it are called "puredata" or "pure-data", but GEM's SF directory is called "pd-gem", and mailing-lists are called "pd-list" "pd-dev" ...
However, most of the time I write it PureData so that it looks like one word yet also like two; and so that it looks like a "proper noun"; and because I'd rather call it "PureData" than "Pd" because the latter sounds like "pédé", which is a public (or pubic) relation problem in French.
_ _ __ ___ _____ ________ _____________ _____________________ ... | Mathieu Bouchard - tél:+1.514.383.3801 - http://artengine.ca/matju | Freelance Digital Arts Engineer, Montréal QC Canada
Mathieu Bouchard wrote:
Aliases: when you download "Pure Data" or "Pd" from Miller, it's in a tarball whose filename starts with "pd". To start it, run the command "pd" in Linux or "Pd" in OSX. Community sites about it are called
but since os-x's fs is case-insensitive (though case-aware), it should be able to start it with "pd" too, or am i mistaken? (i haven't checked it)
"puredata" or "pure-data",
the joys of domain grabbing
but GEM's SF directory is called "pd-gem",
the joys of name-clashes, since "gem" is already taken at sourceforge (though dead, afaik) and i thought "pure-data-gem" and "puredata-gem" both too long names
and mailing-lists are called "pd-list" "pd-dev" ...
but you are free to post to "Pd-list" and "Pd-dev" and...
mfa.dr IOhannes
On Wed, 13 Sep 2006, IOhannes m zmoelnig wrote:
Mathieu Bouchard wrote:
Aliases: when you download "Pure Data" or "Pd" from Miller, it's in a tarball whose filename starts with "pd". To start it, run the command "pd" in Linux or "Pd" in OSX. Community sites about it are called
but since os-x's fs is case-insensitive (though case-aware), it should be able to start it with "pd" too, or am i mistaken? (i haven't checked it)
Yes it is, but my point is that in the filesystem it's recorded as "Pd" in OSX, contrary to what it is on Linux, for example.
Anyway, that isn't so much of an issue: I mean, I don't think that aliases and slight variations in spelling matter as much as clashes in terminology.
_ _ __ ___ _____ ________ _____________ _____________________ ... | Mathieu Bouchard - tél:+1.514.383.3801 - http://artengine.ca/matju | Freelance Digital Arts Engineer, Montréal QC Canada
On 9/13/06, Mathieu Bouchard matju@artengine.ca wrote:
On Wed, 13 Sep 2006, IOhannes m zmoelnig wrote:
Mathieu Bouchard wrote:
Aliases: when you download "Pure Data" or "Pd" from Miller, it's in a tarball whose filename starts with "pd". To start it, run the command "pd" in Linux or "Pd" in OSX. Community sites about it are called
but since os-x's fs is case-insensitive (though case-aware), it should be able to start it with "pd" too, or am i mistaken? (i haven't checked it)
Yes it is, but my point is that in the filesystem it's recorded as "Pd" in OSX, contrary to what it is on Linux, for example.
Anyway, that isn't so much of an issue: I mean, I don't think that aliases and slight variations in spelling matter as much as clashes in terminology.
What I find confusing is the two separate files called "Pd" and "pd" in the OSX app.
Hallo, Mathieu Bouchard hat gesagt: // Mathieu Bouchard wrote:
Aliases: when you download "Pure Data" or "Pd" from Miller, it's in a tarball whose filename starts with "pd". To start it, run the command "pd" in Linux or "Pd" in OSX.
That's a bit like the difference between Perl, the programming language and perl, the interpreter binary. Well, let the language lawyers fight this out. Every language, artifical or spoken, has ambiguities and irregularities. Some (German) have more than others (Mathematics), and there are more ambiguities on word level ("read") than on sentence or story level ("read -resize file.wav sample"), because you have more context.
Frank Barknecht _ ______footils.org_ __goto10.org__