Re: [PD] maxlib/arraycopy

2017-04-22 Thread Alexandre Torres Porres
2017-04-21 13:30 GMT-03:00 Ed Kelly via Pd-list :

> At the back of my mind, a thought that there must be a vanilla way of
> doing this. "I'm sure I saw it somewhere..." etc
> Just as with the [text] objects, I'm gradually emerging from years of
> using Pd-extended 0.42/43 and realising the power of vanilla.
>

There's this new thing also, called Purr Data, it has all the power of the
late extended, plus the power of the current vanilla

just saying...
___
Pd-list@lists.iem.at mailing list
UNSUBSCRIBE and account-management -> 
https://lists.puredata.info/listinfo/pd-list


Re: [PD] maxlib/arraycopy & pd-essentials

2017-04-21 Thread Fred Jan Kraan

Hi Ed,

Did I understand correctly the object works in a predictable way in the 
end?


Sometimes I try to maintain a version of maxlib distributed with deken, 
and had the impression it worked as expected when I revisited the 
help-patch.


At the same time, I had the idea that this object, as there are a lot 
more in Max/MSP and pd-extended, are just convenience objects; could be 
as well a proper abstraction. Which would have much higher educational 
value IMHO.


It would be a nice project for the Pd-community as a whole to find the 
(few) essential objects missing from pd-vanilla and leave the rest of 
pd-extended as proper legacy; nice to have to get that old patch 
working, not otherwise not really useful.


Greetings,

Fred Jan

On 21-04-17 17:02, Ed Kelly via Pd-list wrote:

compiled objects for maxlib/arraycopy

_-_-_-_-_-_-_-^-_-_-_-_-_-_-_

For *Lone Shark *releases, *Pure Data *software and published
*Research*, go to http://sharktracks.co.uk 


On Friday, 21 April 2017, 15:53, Ed Kelly  wrote:


Correction - I mean it assumed the destination had to be bigger or the
same size as the source!

_-_-_-_-_-_-_-^-_-_-_-_-_-_-_

For *Lone Shark *releases, *Pure Data *software and published
*Research*, go to http://sharktracks.co.uk 


On Friday, 21 April 2017, 14:17, Ed Kelly via Pd-list
 wrote:


I don't quite know what has happened to arraycopy from maxlib.
It seems to expect, from the code, that the destination array is smaller
or the same size as the source array. That's ridiculous. My source array
is 90 seconds long and the destination arrays are small - the duration
between two bonk~ events in an audio stream. My rechunk~ patch, which I
extensively rely on for live sampling, has been broken for a while.

I fixed it. Enclosed.
Ed

_-_-_-_-_-_-_-^-_-_-_-_-_-_-_

For *Lone Shark *releases, *Pure Data *software and published
*Research*, go to http://sharktracks.co.uk 
___
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


Re: [PD] maxlib/arraycopy

2017-04-21 Thread Ed Kelly via Pd-list
At the back of my mind, a thought that there must be a vanilla way of doing 
this. "I'm sure I saw it somewhere..." etc
Just as with the [text] objects, I'm gradually emerging from years of using 
Pd-extended 0.42/43 and realising the power of vanilla.Thanks Roman
Ed _-_-_-_-_-_-_-^-_-_-_-_-_-_-_

For Lone Shark releases, Pure Data software and published Research, go to 
http://sharktracks.co.uk  

On Friday, 21 April 2017, 16:15, Roman Haefeli  wrote:
 

 You know about [array get] and [array set], do you?

Roman


On Fre, 2017-04-21 at 15:02 +, Ed Kelly via Pd-list wrote:
> compiled objects for maxlib/arraycopy
>  
> _-_-_-_-_-_-_-^-_-_-_-_-_-_-_
> 
> For Lone Shark releases, Pure Data software and published Research,
> go to http://sharktracks.co.uk 
> 
> 
> On Friday, 21 April 2017, 15:53, Ed Kelly 
> wrote:
> 
> 
> Correction - I mean it assumed the destination had to be bigger or
> the same size as the source!
>  
> _-_-_-_-_-_-_-^-_-_-_-_-_-_-_
> 
> For Lone Shark releases, Pure Data software and published Research,
> go to http://sharktracks.co.uk 
> 
> 
> On Friday, 21 April 2017, 14:17, Ed Kelly via Pd-list  iem.at> wrote:
> 
> 
> I don't quite know what has happened to arraycopy from maxlib.
> It seems to expect, from the code, that the destination array is
> smaller or the same size as the source array. That's ridiculous. My
> source array is 90 seconds long and the destination arrays are small
> - the duration between two bonk~ events in an audio stream. My
> rechunk~ patch, which I extensively rely on for live sampling, has
> been broken for a while.
> 
> I fixed it. Enclosed.
> Ed
>  
> _-_-_-_-_-_-_-^-_-_-_-_-_-_-_
> 
> For Lone Shark releases, Pure Data software and published Research,
> go to http://sharktracks.co.uk 
> ___
> Pd-list@lists.iem.at mailing list
> UNSUBSCRIBE and account-management -> https://lists.puredata.info/lis
> tinfo/pd-list
> 
> 
> 
> 
> ___
> Pd-list@lists.iem.at mailing list
> UNSUBSCRIBE and account-management -> https://lists.puredata.info/lis
> tinfo/pd-list

   ___
Pd-list@lists.iem.at mailing list
UNSUBSCRIBE and account-management -> 
https://lists.puredata.info/listinfo/pd-list


Re: [PD] maxlib/arraycopy

2017-04-21 Thread Roman Haefeli
You know about [array get] and [array set], do you?

Roman


On Fre, 2017-04-21 at 15:02 +, Ed Kelly via Pd-list wrote:
> compiled objects for maxlib/arraycopy
>  
> _-_-_-_-_-_-_-^-_-_-_-_-_-_-_
> 
> For Lone Shark releases, Pure Data software and published Research,
> go to http://sharktracks.co.uk 
> 
> 
> On Friday, 21 April 2017, 15:53, Ed Kelly 
> wrote:
> 
> 
> Correction - I mean it assumed the destination had to be bigger or
> the same size as the source!
>  
> _-_-_-_-_-_-_-^-_-_-_-_-_-_-_
> 
> For Lone Shark releases, Pure Data software and published Research,
> go to http://sharktracks.co.uk 
> 
> 
> On Friday, 21 April 2017, 14:17, Ed Kelly via Pd-list  iem.at> wrote:
> 
> 
> I don't quite know what has happened to arraycopy from maxlib.
> It seems to expect, from the code, that the destination array is
> smaller or the same size as the source array. That's ridiculous. My
> source array is 90 seconds long and the destination arrays are small
> - the duration between two bonk~ events in an audio stream. My
> rechunk~ patch, which I extensively rely on for live sampling, has
> been broken for a while.
> 
> I fixed it. Enclosed.
> Ed
>  
> _-_-_-_-_-_-_-^-_-_-_-_-_-_-_
> 
> For Lone Shark releases, Pure Data software and published Research,
> go to http://sharktracks.co.uk 
> ___
> Pd-list@lists.iem.at mailing list
> UNSUBSCRIBE and account-management -> https://lists.puredata.info/lis
> tinfo/pd-list
> 
> 
> 
> 
> ___
> Pd-list@lists.iem.at mailing list
> UNSUBSCRIBE and account-management -> https://lists.puredata.info/lis
> tinfo/pd-list

signature.asc
Description: This is a digitally signed message part
___
Pd-list@lists.iem.at mailing list
UNSUBSCRIBE and account-management -> 
https://lists.puredata.info/listinfo/pd-list


Re: [PD] maxlib/arraycopy

2017-04-21 Thread Ed Kelly via Pd-list
compiled objects for maxlib/arraycopy
 _-_-_-_-_-_-_-^-_-_-_-_-_-_-_

For Lone Shark releases, Pure Data software and published Research, go to 
http://sharktracks.co.uk  

On Friday, 21 April 2017, 15:53, Ed Kelly  wrote:
 

 Correction - I mean it assumed the destination had to be bigger or the same 
size as the source!
 _-_-_-_-_-_-_-^-_-_-_-_-_-_-_

For Lone Shark releases, Pure Data software and published Research, go to 
http://sharktracks.co.uk  

On Friday, 21 April 2017, 14:17, Ed Kelly via Pd-list 
 wrote:
 

 I don't quite know what has happened to arraycopy from maxlib.
It seems to expect, from the code, that the destination array is smaller or the 
same size as the source array. That's ridiculous. My source array is 90 seconds 
long and the destination arrays are small - the duration between two bonk~ 
events in an audio stream. My rechunk~ patch, which I extensively rely on for 
live sampling, has been broken for a while.

I fixed it. Enclosed.
Ed
 _-_-_-_-_-_-_-^-_-_-_-_-_-_-_

For Lone Shark releases, Pure Data software and published Research, go to 
http://sharktracks.co.uk ___
Pd-list@lists.iem.at mailing list
UNSUBSCRIBE and account-management -> 
https://lists.puredata.info/listinfo/pd-list


   

   

arraycopy.l_i386
Description: Binary data


arraycopy.pd_darwin
Description: Binary data
___
Pd-list@lists.iem.at mailing list
UNSUBSCRIBE and account-management -> 
https://lists.puredata.info/listinfo/pd-list


Re: [PD] maxlib/arraycopy

2017-04-21 Thread Ed Kelly via Pd-list
Correction - I mean it assumed the destination had to be bigger or the same 
size as the source!
 _-_-_-_-_-_-_-^-_-_-_-_-_-_-_

For Lone Shark releases, Pure Data software and published Research, go to 
http://sharktracks.co.uk  

On Friday, 21 April 2017, 14:17, Ed Kelly via Pd-list 
 wrote:
 

 I don't quite know what has happened to arraycopy from maxlib.
It seems to expect, from the code, that the destination array is smaller or the 
same size as the source array. That's ridiculous. My source array is 90 seconds 
long and the destination arrays are small - the duration between two bonk~ 
events in an audio stream. My rechunk~ patch, which I extensively rely on for 
live sampling, has been broken for a while.

I fixed it. Enclosed.
Ed
 _-_-_-_-_-_-_-^-_-_-_-_-_-_-_

For Lone Shark releases, Pure Data software and published Research, go to 
http://sharktracks.co.uk ___
Pd-list@lists.iem.at mailing list
UNSUBSCRIBE and account-management -> 
https://lists.puredata.info/listinfo/pd-list


   /* - arraycopy  --- */
/*  */
/* Copy data from one array to another .*/
/* Written by Olaf Matthes */
/* Get source at http://www.akustische-kunst.org/puredata/maxlib/   */
/*  */
/* This program is free software; you can redistribute it and/or*/
/* modify it under the terms of the GNU General Public License  */
/* as published by the Free Software Foundation; either version 2   */
/* of the License, or (at your option) any later version.   */
/*  */
/* This program is distributed in the hope that it will be useful,  */
/* but WITHOUT ANY WARRANTY; without even the implied warranty of   */
/* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the*/
/* GNU General Public License for more details. */
/*  */
/* You should have received a copy of the GNU General Public License*/
/* along with this program; if not, write to the Free Software  */
/* Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA  02111-1307, USA.  */
/*  */
/* Based on PureData by Miller Puckette and others. */
/*  */
/*  */

#include "m_pd.h"
#include 

static char *version = "arraycopy v0.2.1, written by Olaf Matthes ";

typedef struct arraycopy
{
	t_object x_obj;		
	t_symbol *x_destarray;
	t_symbol *x_sourcearray;
	t_garray *x_destbuf;
	t_garray *x_sourcebuf;
	t_intx_start;
	t_intx_end;
	t_intx_pos;
	shortx_print;
} t_arraycopy;

	/* choose the destination array to copy to */
static void arraycopy_setdestarray(t_arraycopy *x, t_symbol *s)
{
	t_garray *b;
	
	if ((b = (t_garray *)pd_findbyclass(s, garray_class)))
	{
		// post("arraycopy: destination array set to \"%s\"", s->s_name);
		x->x_destbuf = b;
	} else {
		post("arraycopy: no array \"%s\" (error %d)", s->s_name, b);
		x->x_destbuf = 0;
	}
}

static void arraycopy_setdest(t_arraycopy *x, t_symbol *s)
{
		x->x_destarray = s;
		arraycopy_setdestarray(x, x->x_destarray);
}

	/* choose the source array to copy from */
static void arraycopy_setsourcearray(t_arraycopy *x, t_symbol *s)
{
	t_garray *b;
	
	if ((b = (t_garray *)pd_findbyclass(s, garray_class)))
	{
		// post("arraycopy: source array set to \"%s\"", s->s_name);
		x->x_sourcebuf = b;
	} else {
		post("arraycopy: no array \"%s\" (error %d)", s->s_name, b);
		x->x_sourcebuf = 0;
	}
}

	/* this is the routine that actually does the copying */
	/* get's called directly when we get a 'bang' */
static void arraycopy_docopy(t_arraycopy *x)
{
  /* use new 64-bit compatible array API if available */
#if (defined PD_MAJOR_VERSION && defined PD_MINOR_VERSION) && (PD_MAJOR_VERSION > 0 || PD_MINOR_VERSION >= 41)
# define arraynumber_t t_word
# define array_getarray garray_getfloatwords
# define array_get(pointer, index) (pointer[index].w_float)
# define array_set(pointer, index, value) ((pointer[index].w_float)=value)
#else
# define arraynumber_t t_float
# define array_getarray garray_getfloatarray
# define array_get(pointer, index) (pointer[index])
# define array_set(pointer, index, value) ((pointer[index])=value)
#endif

	t_garray *b;		/* make local copy of array */
	arraynumber_t *tab;  /* the content itself */
	int source

[PD] maxlib/arraycopy

2017-04-21 Thread Ed Kelly via Pd-list
I don't quite know what has happened to arraycopy from maxlib.
It seems to expect, from the code, that the destination array is smaller or the 
same size as the source array. That's ridiculous. My source array is 90 seconds 
long and the destination arrays are small - the duration between two bonk~ 
events in an audio stream. My rechunk~ patch, which I extensively rely on for 
live sampling, has been broken for a while.

I fixed it. Enclosed.
Ed
 _-_-_-_-_-_-_-^-_-_-_-_-_-_-_

For Lone Shark releases, Pure Data software and published Research, go to 
http://sharktracks.co.uk /* - arraycopy  --- */
/*  */
/* Copy data from one array to another .*/
/* Written by Olaf Matthes */
/* Get source at http://www.akustische-kunst.org/puredata/maxlib/   */
/*  */
/* This program is free software; you can redistribute it and/or*/
/* modify it under the terms of the GNU General Public License  */
/* as published by the Free Software Foundation; either version 2   */
/* of the License, or (at your option) any later version.   */
/*  */
/* This program is distributed in the hope that it will be useful,  */
/* but WITHOUT ANY WARRANTY; without even the implied warranty of   */
/* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the*/
/* GNU General Public License for more details. */
/*  */
/* You should have received a copy of the GNU General Public License*/
/* along with this program; if not, write to the Free Software  */
/* Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA  02111-1307, USA.  */
/*  */
/* Based on PureData by Miller Puckette and others. */
/*  */
/*  */

#include "m_pd.h"
#include 

static char *version = "arraycopy v0.2.1, written by Olaf Matthes ";

typedef struct arraycopy
{
	t_object x_obj;		
	t_symbol *x_destarray;
	t_symbol *x_sourcearray;
	t_garray *x_destbuf;
	t_garray *x_sourcebuf;
	t_intx_start;
	t_intx_end;
	t_intx_pos;
	shortx_print;
} t_arraycopy;

	/* choose the destination array to copy to */
static void arraycopy_setdestarray(t_arraycopy *x, t_symbol *s)
{
	t_garray *b;
	
	if ((b = (t_garray *)pd_findbyclass(s, garray_class)))
	{
		// post("arraycopy: destination array set to \"%s\"", s->s_name);
		x->x_destbuf = b;
	} else {
		post("arraycopy: no array \"%s\" (error %d)", s->s_name, b);
		x->x_destbuf = 0;
	}
}

static void arraycopy_setdest(t_arraycopy *x, t_symbol *s)
{
		x->x_destarray = s;
		arraycopy_setdestarray(x, x->x_destarray);
}

	/* choose the source array to copy from */
static void arraycopy_setsourcearray(t_arraycopy *x, t_symbol *s)
{
	t_garray *b;
	
	if ((b = (t_garray *)pd_findbyclass(s, garray_class)))
	{
		// post("arraycopy: source array set to \"%s\"", s->s_name);
		x->x_sourcebuf = b;
	} else {
		post("arraycopy: no array \"%s\" (error %d)", s->s_name, b);
		x->x_sourcebuf = 0;
	}
}

	/* this is the routine that actually does the copying */
	/* get's called directly when we get a 'bang' */
static void arraycopy_docopy(t_arraycopy *x)
{
  /* use new 64-bit compatible array API if available */
#if (defined PD_MAJOR_VERSION && defined PD_MINOR_VERSION) && (PD_MAJOR_VERSION > 0 || PD_MINOR_VERSION >= 41)
# define arraynumber_t t_word
# define array_getarray garray_getfloatwords
# define array_get(pointer, index) (pointer[index].w_float)
# define array_set(pointer, index, value) ((pointer[index].w_float)=value)
#else
# define arraynumber_t t_float
# define array_getarray garray_getfloatarray
# define array_get(pointer, index) (pointer[index])
# define array_set(pointer, index, value) ((pointer[index])=value)
#endif

	t_garray *b;		/* make local copy of array */
	arraynumber_t *tab;  /* the content itself */
	int sourcesize, destsize;
	t_int i;
	t_garray *A;
	arraynumber_t *vec;

	if(!x->x_destarray)
	{
		post("arraycopy: no destination array specified");
		return;
	}
	if(!x->x_sourcearray)
	{
		post("arraycopy: no source array specified");
		return;
	}

	A = x->x_destbuf;

	if ((b = (t_garray *)pd_findbyclass(x->x_sourcearray, garray_class)))
	{
		// post("arraycopy: source array set to \"%s\"", x->x_sourcearray->s_name);
	} else {
		post("arraycopy: no array \"%s\" (error %d)", x->x

Re: [PD] maxlib arraycopy

2016-12-05 Thread Ed Kelly via Pd-list
Perfect. A way of doing it in Vanilla Pd. If I can gradually trim away the 
externals from my patches and vanillarize them I'll be a happy man.Thanks,Ed

 _-_-_-_-_-_-_-^-_-_-_-_-_-_-_

For Lone Shark releases, Pure Data software and published Research, go to 
http://sharktracks.co.uk  

On Thursday, 1 December 2016, 20:31, Roman Haefeli  
wrote:
 
 

 On Thu, 2016-12-01 at 18:48 +, Ed Kelly via Pd-list wrote:

> Does anyone have a better way of copying chunks from one array into
> another? Is there a vanilla way?

Checkout help for new [array] class. There is [array get ] for
retrieving part of or whole array as a list. With [array set ]
you can update part of or whole array.

And there has always been:

[ (
|
[send ]

to update an array/table.

Roman

___
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


Re: [PD] maxlib arraycopy

2016-12-01 Thread Roman Haefeli
On Thu, 2016-12-01 at 18:48 +, Ed Kelly via Pd-list wrote:

> Does anyone have a better way of copying chunks from one array into
> another? Is there a vanilla way?

Checkout help for new [array] class. There is [array get ] for
retrieving part of or whole array as a list. With [array set ]
you can update part of or whole array.

And there has always been:

[ (
|
[send ]

to update an array/table.

Roman



signature.asc
Description: This is a digitally signed message part
___
Pd-list@lists.iem.at mailing list
UNSUBSCRIBE and account-management -> 
https://lists.puredata.info/listinfo/pd-list


Re: [PD] maxlib arraycopy

2016-12-01 Thread Matt Barber
Fastest vanilla way now is to get the range from the source as a list with
[array get] and then write to the dest with [array set]. It's faster than
you'd think. You can do some minor bounds checking, but the way Pd ranges
work mostly takes care of that for you.

On Thu, Dec 1, 2016 at 1:48 PM, Ed Kelly via Pd-list 
wrote:

> Hey list,
>
> Recently my rechunk~ abstraction has ceased to work. I've recently
> re-installed and, it seems the maxlib/arraycopy object is not working the
> way it used to. I used to send it a list with
> [sourceArray start end destinationArray(
> values,
> but now, when the source array is longer than the destination array, I get
> error messages that:
> arraycopy: start point 1223199 out of range for destination chunk_2_13
> Where chunk_2_13 is an array created to be the same length as the chunk I
> wish to extract.
>
> Does anyone have a better way of copying chunks from one array into
> another? Is there a vanilla way?
>
> Questions, questions,
> Ed
>
> _-_-_-_-_-_-_-^-_-_-_-_-_-_-_
>
> For *Lone Shark *releases, *Pure Data *software and published *Research*,
> go to http://sharktracks.co.uk
>
> ___
> 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] maxlib arraycopy

2016-12-01 Thread Ed Kelly via Pd-list
Hey list,
Recently my rechunk~ abstraction has ceased to work. I've recently re-installed 
and, it seems the maxlib/arraycopy object is not working the way it used to. I 
used to send it a list with[sourceArray start end destinationArray(values,but 
now, when the source array is longer than the destination array, I get error 
messages that:arraycopy: start point 1223199 out of range for destination 
chunk_2_13Where chunk_2_13 is an array created to be the same length as the 
chunk I wish to extract.
Does anyone have a better way of copying chunks from one array into another? Is 
there a vanilla way?
Questions, questions,Ed
 _-_-_-_-_-_-_-^-_-_-_-_-_-_-_

For Lone Shark releases, Pure Data software and published Research, go to 
http://sharktracks.co.uk ___
Pd-list@lists.iem.at mailing list
UNSUBSCRIBE and account-management -> 
https://lists.puredata.info/listinfo/pd-list