Re: [PD] how to emulate while conditional?

2008-09-04 Thread Frank Barknecht
Hallo,
Adityo Pratomo hat gesagt: // Adityo Pratomo wrote:

 yes, but i guess it's used to make a for, can i iuse it to make a while?
 because i don't really want to make a looping. 

But while is looping, or am I misunderstanding what you want to do?

Anyway [until] is the object to use. What [until] does is after it
receives a bang is this: send bangs, UNTIL there's a bang in the
right inlet. That's practically the same as send bangs, WHILE there
is no bang in the right inlet.

[until] used as a FOR replacement is started with a float number
into the first inlet.

Ciao
-- 
 Frank Barknecht _ __footils.org__

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


[PD] Connecting VLC-Player with pd under Windows

2008-09-04 Thread Anton Hörnquist
Carlo,

Does VLC support ASIO? If it does, the windows version of jackdmp can
help you stream audio to and from VLC to other ASIO-applications such
as Pd:
http://www.grame.fr/~letz/jackdmp.html


/Anton

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


[PD] Number box and CPU load

2008-09-04 Thread Mika Ristimäki
Hi all,

I have a one quick question about number boxes and how they effect CPU  
load. I use number boxes quite a lot for debugging and sometimes I  
forget to remove them from the final patch or abstraction. So I was  
wondering do the number boxes cause significant CPU usage even when  
they are not visible? For example when the abstraction window with the  
number boxes is closed?

-Mika


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


Re: [PD] how to emulate while conditional?

2008-09-04 Thread Adityo Pratomo
oo..i got it.. i just misunderstood the concept.. thank u so much :)
___
Pd-list@iem.at mailing list
UNSUBSCRIBE and account-management - 
http://lists.puredata.info/listinfo/pd-list


Re: [PD] pdp_text stange behaviour

2008-09-04 Thread Claude Heiland-Allen
ydegoyon wrote:
 ola,
 
 it's a limitation here,
 as we use the imlib library
 that lets sets the font only
 globally in your application
 with :
 
 imlib_context_set_font( font );
 
 i don't know any workaround for it.

How about storing a different 'font' in each instance of 'pdp_text', and 
calling imlib_context_set_font() every time just before drawing text?

Or would that be too inefficient?

 saluti,
 sevy

Thanks,


Claude


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


Re: [PD] Number box and CPU load

2008-09-04 Thread Frank Barknecht
Hallo,
Mika Ristimäki hat gesagt: // Mika Ristimäki wrote:

 I have a one quick question about number boxes and how they effect CPU  
 load. I use number boxes quite a lot for debugging and sometimes I  
 forget to remove them from the final patch or abstraction. So I was  
 wondering do the number boxes cause significant CPU usage even when  
 they are not visible? For example when the abstraction window with the  
 number boxes is closed?

Even invisble numberboxes are terrible for performance so avoid them
(until this is fixed). Also avoid [bng], sliders and every other GUI
object unless you need them visible.

Attached is a benchmark comparing number boxes with float-objects.

Ciao
-- 
 Frank Barknecht _ __footils.org__


numbox-benchmark.pd
Description: application/puredata


numbox.pd
Description: application/puredata


nonumbox.pd
Description: application/puredata
___
Pd-list@iem.at mailing list
UNSUBSCRIBE and account-management - 
http://lists.puredata.info/listinfo/pd-list


Re: [PD] Number box and CPU load

2008-09-04 Thread marius schebella

Frank Barknecht wrote:

Hallo,
Mika Ristimäki hat gesagt: // Mika Ristimäki wrote:

I have a one quick question about number boxes and how they effect CPU  
load. I use number boxes quite a lot for debugging and sometimes I  
forget to remove them from the final patch or abstraction. So I was  
wondering do the number boxes cause significant CPU usage even when  
they are not visible? For example when the abstraction window with the  
number boxes is closed?


Even invisble numberboxes are terrible for performance so avoid them
(until this is fixed). Also avoid [bng], sliders and every other GUI
object unless you need them visible.

Attached is a benchmark comparing number boxes with float-objects.


thanks for that test, good to see real numbers, otoh, floats only have a 
terrible performance if they are 'updated' (= receive a message.)


since there was already a good testlayout, I thought it might be worth 
to test the difference between s/r and cord connections. guess what. s/r 
were faster. I guess this is, because you need more cord connections to 
go from the random to the subpatch to the abstraction. but for me that 
was new. the overhead is not big, though, only around 10%.


but, sending messages in general (s/r of cord connections) is quite a 
bottleneck in pd and I wonder if that could be improved. This is where 
any other programming language wins :(.


marius.



Ciao




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




connf.pd
Description: application/extension-pd


numbox-benchmark.pd
Description: application/extension-pd


nonumbox.pd
Description: application/extension-pd


numbox.pd
Description: application/extension-pd
___
Pd-list@iem.at mailing list
UNSUBSCRIBE and account-management - 
http://lists.puredata.info/listinfo/pd-list


[PD] earplug~ or FIR~ for HRTF?

2008-09-04 Thread Claude Heiland-Allen
Hi all,

I'm considering whether to use the earplug~ HRTF external or some 
alternative implementation of binaural spatialization.

On the plus side, earplug~ seems quite easy to use.

On the down side, earplug~ seems not to handle any sample-rate stuff at 
all, so I'm wondering which samplerate the impulse responses in the 
earplug_data.txt are sampled at (because obviously it would be somewhat 
weird to use them at another rate...).

I don't really need the interpolation provided by earplug~ either, so I 
guess I could save some CPU by using FIR~ directly, but then I need to 
obtain some HRIR's (ideally both at 44100Hz and 48000Hz sample rates).

So: has someone already made a binaural processing patch using FIR~ and 
some set of impulse responses and would care to share it?


Some context for the curious:  I'm trying to auralize 4D space using 4D 
room simulation, with an ear made up of several co-solid listening 
points in the 4D space, each mapped to a 3D source point for binaural 
processing.

Thanks for any tips,


Claude
-- 
http://claudiusmaximus.goto10.org

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


Re: [PD] earplug~ or FIR~ for HRTF?

2008-09-04 Thread Nicholas Mariette
IEM's bin_ambi is a sophisticated binaural rendering system via higher  
order Ambisonic spatialisation to virtual speaker arrays.
http://iem.at/Members/noisternig/bin_ambi

FIR~ is very CPU intensive for HRTF processing.  It's much better to  
use frequency domain convolution with fft~  ifft~ which is the case  
with bin_ambi.

I've listed some publicly available HRTF sets on my blog here:
http://blog.soundsorange.net/2005/11/09/hrtf/

Nick

http://soundsorange.net


On Sep 4, 2008, at 4:09 PM, Claude Heiland-Allen wrote:

 Hi all,

 I'm considering whether to use the earplug~ HRTF external or some
 alternative implementation of binaural spatialization.

 On the plus side, earplug~ seems quite easy to use.

 On the down side, earplug~ seems not to handle any sample-rate stuff  
 at
 all, so I'm wondering which samplerate the impulse responses in the
 earplug_data.txt are sampled at (because obviously it would be  
 somewhat
 weird to use them at another rate...).

 I don't really need the interpolation provided by earplug~ either,  
 so I
 guess I could save some CPU by using FIR~ directly, but then I need to
 obtain some HRIR's (ideally both at 44100Hz and 48000Hz sample rates).

 So: has someone already made a binaural processing patch using FIR~  
 and
 some set of impulse responses and would care to share it?


 Some context for the curious:  I'm trying to auralize 4D space using  
 4D
 room simulation, with an ear made up of several co-solid listening
 points in the 4D space, each mapped to a 3D source point for binaural
 processing.

 Thanks for any tips,


 Claude
 -- 
 http://claudiusmaximus.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


Re: [PD] pdp_text stange behaviour

2008-09-04 Thread ydegoyon

ok, it seems to work,
here it is attached

but i cannot commit to  svn ::


svn commit --username sevyves --password *** -m setting font before 
drawing pdp_text.c

svn: Commit failed (details follow):
svn: MKACTIVITY of 
'/svnroot/pure-data/!svn/act/b4c68913-14a6-4477-9381-0ceebc911e4c': 403 
Forbidden (http://pure-data.svn.sourceforge.net)


and don't ask,
yes my password is allright

ydegoyon wrote:

Claude Heiland-Allen wrote:

ydegoyon wrote:

ola,

it's a limitation here,
as we use the imlib library
that lets sets the font only
globally in your application
with :

imlib_context_set_font( font );

i don't know any workaround for it.


How about storing a different 'font' in each instance of 'pdp_text'

this is already the case
and calling imlib_context_set_font() every time just before drawing 
text?

yeh that could be done,
but maybe it's a little bit heavy?
i can try

cheers,
sevy


Or would that be too inefficient?


saluti,
sevy


Thanks,


Claude







/*
 *   PiDiP module
 *   Copyright (c) by Yves Degoyon ([EMAIL PROTECTED])
 *
 *   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., 675 Mass Ave, Cambridge, MA 02139, USA.
 *
 */

/*  This object is a text rendering object for PDP
 *  It uses imlib2 for all graphical operations
 */

/*  Listening to :
 *  Deviants - Nothing Man
 *  Monte Cazzaza - Kick That Habit Man
 */

#include pdp.h
#include yuv.h
#include math.h
#include ctype.h
#include Imlib2.h  // imlib2 is required

#define DEFAULT_CAPACITY 10
#define DEFAULT_FONT Vera/16

static char   *pdp_text_version = pdp_text: version 0.2 : text rendering object written by [EMAIL PROTECTED];

typedef struct pdp_text_struct
{
t_object x_obj;
t_float x_f;

int x_packet0;
int x_packet1;
int x_dropped;
int x_queue_id;

t_outlet *x_outlet0;
int x_vwidth;
int x_vheight;
int x_vsize;

char **x_text_array;
int *x_xoffsets;
int *x_yoffsets;
int *x_r;
int *x_g;
int *x_b;
t_float *x_angle;
t_float x_alpha;
int *x_scroll;

int x_nbtexts;
int x_current;
int x_capacity;

/* imlib data */
Imlib_Image x_image;
Imlib_Font x_font;

} t_pdp_text;

/* add a new text : syntax : text my%20text x y */
static void pdp_text_add(t_pdp_text *x, t_symbol *s, int argc, t_atom *argv)
{
 char *pname;
 char *pdname;
 int len;

   if ( x-x_nbtexts = x-x_capacity )
   {
  post( pdp_text : sorry, maximum capacity has been reached... try resize );
  return;
   } 
   
   if ( argc  3 )
   {
  post( pdp_text : error in the number of arguments ( minimum is 3 ), argc );
  return;
   }
   if ( argv[0].a_type != A_SYMBOL || argv[1].a_type != A_FLOAT || argv[2].a_type != A_FLOAT ) {
  post( pdp_text : add : wrong arguments );
  return;
   }

   // allocate new text area
   len = strlen( argv[0].a_w.w_symbol-s_name ); 
   pdname = x-x_text_array[x-x_nbtexts] = (char *) getbytes( len+1 );
   pname = (char *) getbytes( len+1 );
   memset( pname, 0x0, len+1 );
   memcpy( pname, argv[0].a_w.w_symbol-s_name, len );
   while (*(pname))
   {
  if ( (*pname=='%')  ( isdigit(*(pname+1)) || (*(pname+1)=='%') ) )
  {
int ivalue;
int ndigits;
char  *piname;

 ndigits=0;
 piname=pname+1;
 while ( isdigit( *(piname++) ) ) ndigits++;
 
 ivalue=atoi(pname+1);

 // special case %%
 if ( ( pname != argv[0].a_w.w_symbol-s_name )  ( *(pname+1) == '%' ) )
 {
*(pdname++)=*(pname++);
pname++;
continue;
 } 
 *(pdname++)=(char)ivalue;
 pname+=ndigits+1;
  }
  else if ( !strncmp( pname, \, 1 ) ) // quotes are ignored unless %34
  { 
pname++;
  }
  else
  {
 *(pdname++)=*(pname++);
  } 
   }
   *(pdname)='\0';
   x-x_xoffsets[x-x_nbtexts] = (int)argv[1].a_w.w_float;
   x-x_yoffsets[x-x_nbtexts] = (int)argv[2].a_w.w_float;

   if ( (argc=4)  (argv[3].a_type == A_FLOAT) )
   {
  x-x_r[x-x_nbtexts] = (int)argv[3].a_w.w_float;
   }
   if ( (argc=5)  (argv[4].a_type == A_FLOAT) )
   {
  x-x_g[x-x_nbtexts] = (int)argv[4].a_w.w_float;
   }
   if ( (argc=6)  (argv[5].a_type == A_FLOAT) )
   {
  x-x_b[x-x_nbtexts] = (int)argv[5].a_w.w_float;
   }
   if ( (argc=7)  (argv[6].a_type == A_FLOAT) )
   {
  

Re: [PD] pdp_text stange behaviour

2008-09-04 Thread IOhannes m zmoelnig
ydegoyon wrote:
 ok, it seems to work,
 here it is attached
 
 but i cannot commit to  svn ::
 
 
 svn commit --username sevyves --password *** -m setting font before 
 drawing pdp_text.c
 svn: Commit failed (details follow):
 svn: MKACTIVITY of 
 '/svnroot/pure-data/!svn/act/b4c68913-14a6-4477-9381-0ceebc911e4c': 403 
 Forbidden (http://pure-data.svn.sourceforge.net)
 
 and don't ask,
 yes my password is allright


your problems are most likely because of a scheduled downtime of the 
subversion servers: 
http://lists.puredata.info/pipermail/pd-dev/2008-09/012246.html


fgadrm
IOhannes

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


Re: [PD] [PD-dev] cross-platform support for externals (extern not enough?) (Was: Re: Problem building pdlua on MinGW (solved for now))

2008-09-04 Thread PSPunch

Hi all,

 
 Am 03.09.2008 um 22:11 schrieb Claude Heiland-Allen:
 

 So the question is, does every external have to jump through this kind
 of hoop if it wants to compile on Windows?

 /* support windows */
 #ifdef MSW
 #define EXPORT __declspec(dllexport) extern
 #else
 #define EXPORT   extern
 #endif

 
 Yes and no. With the above hoop you define all what is needed - on the 
 other hand you could also roll it out to the build stage and instruct 
 the linker via flags or .def files about which symbols to export.
 gr~~~
 


I found the same topic regarding compilation of pdlua on Windows.

http://lists.puredata.info/pipermail/pd-list/2007-12/057637.html


To add a quick update to the topic, I think the built pdlua will not 
work on the binary package of Vanilla-Pd.

It does not have sys_register_loader() visible externally which I think 
in another discussion, Hans had mentioned he had patched for extended.

At least the symbol to that function was not found neither in pd.dll nor 
pd.lib attached to Vanilla.

--
David Shimamoto

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


[PD] Random - Different seed each time the patch is loaded

2008-09-04 Thread Ignacio Viano
I want many (let's say 10) [random] objects that give different series of
numbers each time the patch is loaded (of course, the 10 [random] give
different series from each other). I tried using [time] and [date] objects
to generate different seeds, but the same seed (different on each load) is
given to the 10 [random]. I tried using a mix of [date], [time] and
[realtime], but it's quite unreliable. Any ideas?
Thanks
Ignacio
___
Pd-list@iem.at mailing list
UNSUBSCRIBE and account-management - 
http://lists.puredata.info/listinfo/pd-list


Re: [PD] Random - Different seed each time the patch is loaded

2008-09-04 Thread IOhannes m zmölnig
Martin Peach wrote:

 Or have a single random generator inside pd that feeds all the random
 objects.

yes of course, this would be the most straight forward solution.


mfgasdr
IOhannes

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


Re: [PD] Random - Different seed each time the patch is loaded

2008-09-04 Thread Charles Henry
In a way~, it's not so straightforward.  Let's say the random
generators are identical and seeded by another identical random
generator with no further modifications.  Then, all the other random
generators are correlated--using the same sequence, but with slightly
different starting points within that sequence.

so, you need to have a map of the range of random onto itself, which
is different from the random sequence mapping.  That way, you actually
obtain seed values which are spaced far apart in the sequence.

This could be actually pretty simple, e.g.
seed=rand_max - input_from_1st_rand

Chuck

On Thu, Sep 4, 2008 at 12:39 PM, IOhannes m zmölnig [EMAIL PROTECTED] wrote:
 Martin Peach wrote:

 Or have a single random generator inside pd that feeds all the random
 objects.

 yes of course, this would be the most straight forward solution.


 mfgasdr
 IOhannes

 ___
 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


Re: [PD] Random - Different seed each time the patch is loaded

2008-09-04 Thread Derek Holzer
Would $0 instantiation variables be of use here? Or would that make each 
random generator one value away from the one beside it?

d.

Charles Henry wrote:
 In a way~, it's not so straightforward.  Let's say the random
 generators are identical and seeded by another identical random
 generator with no further modifications.  Then, all the other random
 generators are correlated--using the same sequence, but with slightly
 different starting points within that sequence.
 
 so, you need to have a map of the range of random onto itself, which
 is different from the random sequence mapping.  That way, you actually
 obtain seed values which are spaced far apart in the sequence.
 
 This could be actually pretty simple, e.g.
 seed=rand_max - input_from_1st_rand
 
 Chuck
 
 On Thu, Sep 4, 2008 at 12:39 PM, IOhannes m zmölnig [EMAIL PROTECTED] wrote:
 Martin Peach wrote:

 Or have a single random generator inside pd that feeds all the random
 objects.
 yes of course, this would be the most straight forward solution.


 mfgasdr
 IOhannes

 ___
 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
 

-- 
derek holzer ::: http://www.umatic.nl ::: http://blog.myspace.com/macumbista
---Oblique Strategy # 24:
Bridges
-build
-burn

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


Re: [PD] Random - Different seed each time the patch is loaded

2008-09-04 Thread Frank Barknecht
Hallo,
IOhannes m zm?lnig hat gesagt: // IOhannes m zm?lnig wrote:

 Martin Peach wrote:
 
  Or have a single random generator inside pd that feeds all the random
  objects.
 
 yes of course, this would be the most straight forward solution.

Only to this one problem, but it would lead to many others: Being able
to seed [random] objects separately is a very important feature. For
example a lot of the algorithmic composition in the game Spore is
relying on seeding random generators separately with known seeds
(according to the talk once posted here).

In Lua there is only one seed for all math.random() calls, and it's even
globally affecting all pd_lua objects. That's very annoying, but thank
god, there's a random.so external Lua module which fixes this.

Ciao
-- 
Frank Barknecht

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


Re: [PD] Random - Different seed each time the patch is loaded

2008-09-04 Thread Frank Barknecht
Hallo,
Derek Holzer hat gesagt: // Derek Holzer wrote:

 Would $0 instantiation variables be of use here? Or would that make each 
 random generator one value away from the one beside it?

Probably yes, but it may lead to a nice phasing effect. ;)

IOhannes' suggestion of seeing one random which seeds the other objects
is the way to go IMO.

Ciao
-- 
Frank

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


Re: [PD] Random - Different seed each time the patch is loaded

2008-09-04 Thread Charles Henry
On Thu, Sep 4, 2008 at 1:28 PM, Derek Holzer [EMAIL PROTECTED] wrote:
 Would $0 instantiation variables be of use here? Or would that make each
 random generator one value away from the one beside it?

not a bad idea--because each random generator would be far apart in
sequence--no correlation between the sequences.  However, it doesn't
solve the original problem, making them different between loads of the
patch.


 d.

 Charles Henry wrote:

 In a way~, it's not so straightforward.  Let's say the random
 generators are identical and seeded by another identical random
 generator with no further modifications.  Then, all the other random
 generators are correlated--using the same sequence, but with slightly
 different starting points within that sequence.

 so, you need to have a map of the range of random onto itself, which
 is different from the random sequence mapping.  That way, you actually
 obtain seed values which are spaced far apart in the sequence.

 This could be actually pretty simple, e.g.
 seed=rand_max - input_from_1st_rand

 Chuck

 On Thu, Sep 4, 2008 at 12:39 PM, IOhannes m zmölnig [EMAIL PROTECTED]
 wrote:

 Martin Peach wrote:

 Or have a single random generator inside pd that feeds all the random
 objects.

 yes of course, this would be the most straight forward solution.


 mfgasdr
 IOhannes

 ___
 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


 --
 derek holzer ::: http://www.umatic.nl ::: http://blog.myspace.com/macumbista
 ---Oblique Strategy # 24:
 Bridges
 -build
 -burn


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


Re: [PD] Random - Different seed each time the patch is loaded

2008-09-04 Thread Mike McGonagle
Speaking of Lua and randoms, I had read somewhere (I think on the website)
that on some platforms, their random generators will always produce the same
FIRST number, but everything else after that is random. I tested this out
on the Mac OS X, and yes, every FIRST number is the same, but everything
else beyond that isn't. The workaround for this is to just drop the first
random value you get. I don't know why this happens, but is it possible that
the same things happens in PD? I have not tested this out.

Mike


On Thu, Sep 4, 2008 at 2:56 PM, Frank Barknecht [EMAIL PROTECTED] wrote:

 Hallo,
 IOhannes m zm?lnig hat gesagt: // IOhannes m zm?lnig wrote:

  Martin Peach wrote:
 
   Or have a single random generator inside pd that feeds all the random
   objects.
 
  yes of course, this would be the most straight forward solution.

 Only to this one problem, but it would lead to many others: Being able
 to seed [random] objects separately is a very important feature. For
 example a lot of the algorithmic composition in the game Spore is
 relying on seeding random generators separately with known seeds
 (according to the talk once posted here).

 In Lua there is only one seed for all math.random() calls, and it's even
 globally affecting all pd_lua objects. That's very annoying, but thank
 god, there's a random.so external Lua module which fixes this.

 Ciao
 --
 Frank Barknecht

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




-- 
Peace may sound simple—one beautiful word— but it requires everything we
have, every quality, every strength, every dream, every high ideal.
—Yehudi Menuhin (1916–1999), musician
___
Pd-list@iem.at mailing list
UNSUBSCRIBE and account-management - 
http://lists.puredata.info/listinfo/pd-list


Re: [PD] Random - Different seed each time the patch is loaded

2008-09-04 Thread Peter Plessas
Hi, what do you think about using the (white) background hiss of your
adc~ soundcard input? Make a snapshot at different intervals, one for
each seed. (not tested myself).

good luck,
PP

* Ignacio Viano [EMAIL PROTECTED] [2008-09-04 19:11]:
 I want many (let's say 10) [random] objects that give different series of
 numbers each time the patch is loaded (of course, the 10 [random] give
 different series from each other). I tried using [time] and [date] objects
 to generate different seeds, but the same seed (different on each load) is
 given to the 10 [random]. I tried using a mix of [date], [time] and
 [realtime], but it's quite unreliable. Any ideas?
 Thanks
 Ignacio

 ___
 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


Re: [PD] Random - Different seed each time the patch is loaded

2008-09-04 Thread Derek Holzer
And you could listen for ghost voices at the same time.

;-)

d.

Peter Plessas wrote:
 Hi, what do you think about using the (white) background hiss of your
 adc~ soundcard input? Make a snapshot at different intervals, one for
 each seed. (not tested myself).
 
 good luck,
 PP
 
 * Ignacio Viano [EMAIL PROTECTED] [2008-09-04 19:11]:
 I want many (let's say 10) [random] objects that give different series of
 numbers each time the patch is loaded (of course, the 10 [random] give
 different series from each other). I tried using [time] and [date] objects
 to generate different seeds, but the same seed (different on each load) is
 given to the 10 [random]. I tried using a mix of [date], [time] and
 [realtime], but it's quite unreliable. Any ideas?
 Thanks
 Ignacio
 
 ___
 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
 

-- 
derek holzer ::: http://www.umatic.nl ::: http://blog.myspace.com/macumbista
---Oblique Strategy # 187:
Would anybody want it?

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


Re: [PD] Random - Different seed each time the patch is loaded

2008-09-04 Thread Peter Plessas
* Charles Henry [EMAIL PROTECTED] [2008-09-04 23:13]:
 On Thu, Sep 4, 2008 at 1:28 PM, Derek Holzer [EMAIL PROTECTED] wrote:
  Would $0 instantiation variables be of use here? Or would that make each
  random generator one value away from the one beside it?
 
 not a bad idea--because each random generator would be far apart in
 sequence--no correlation between the sequences.  However, it doesn't
 solve the original problem, making them different between loads of the
 patch.

Perhaps i am getting you wrong, but if i would want different behavior
each time i'd open that patch, the noise from your adc~ would do that,
bc it is surely different (thermal noise, etc) every time.
(provided you switched your dsp~ on in advance). :-)

rgrds, PP

 
 
  d.
 
  Charles Henry wrote:
 
  In a way~, it's not so straightforward.  Let's say the random
  generators are identical and seeded by another identical random
  generator with no further modifications.  Then, all the other random
  generators are correlated--using the same sequence, but with slightly
  different starting points within that sequence.
 
  so, you need to have a map of the range of random onto itself, which
  is different from the random sequence mapping.  That way, you actually
  obtain seed values which are spaced far apart in the sequence.
 
  This could be actually pretty simple, e.g.
  seed=rand_max - input_from_1st_rand
 
  Chuck
 
  On Thu, Sep 4, 2008 at 12:39 PM, IOhannes m zmölnig [EMAIL PROTECTED]
  wrote:
 
  Martin Peach wrote:
 
  Or have a single random generator inside pd that feeds all the random
  objects.
 
  yes of course, this would be the most straight forward solution.
 
 
  mfgasdr
  IOhannes
 
  ___
  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
 
 
  --
  derek holzer ::: http://www.umatic.nl ::: http://blog.myspace.com/macumbista
  ---Oblique Strategy # 24:
  Bridges
  -build
  -burn
 
 
 ___
 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


[PD] Gamepad on Windows XP

2008-09-04 Thread enrique franco
Hi,

Is there any object to connect a gamepad to PD on Windows XP? I have a
Genius MaxFire G-12U Vibration.

Thanks,

-- 
Enrique Franco
Telefono/Phone: +572 5552334 ext 388
Webpage: http://richie.idc.ul.ie/~enrique/
http://www.iua.upf.es/~ffranco/pfm.htm
___
Pd-list@iem.at mailing list
UNSUBSCRIBE and account-management - 
http://lists.puredata.info/listinfo/pd-list


Re: [PD] Random - Different seed each time the patch is loaded

2008-09-04 Thread Charles Henry
On Thu, Sep 4, 2008 at 4:29 PM, Peter Plessas [EMAIL PROTECTED] wrote:
 Perhaps i am getting you wrong, but if i would want different behavior
 each time i'd open that patch, the noise from your adc~ would do that,
 bc it is surely different (thermal noise, etc) every time.
 (provided you switched your dsp~ on in advance). :-)

 rgrds, PP

Yes, your method would work pretty well.  The individual samples of
the noise are correlated with each other (thermal noise is not white).
 But when you take a single sample at a given time without knowing the
previous values, that correlation can be ignored, and you would
generate a completely independent random number, drawn from the
distribution of the noise.  The only problem is if the noise is very
narrowly distributed, so that you only recieve one of a few possible
choices of the seed value.

Compared to using time/date:  the noise we can assume is distributed
about 0 with a Gaussian (continuous) or approximately a Binomial
(discrete) distribution.  On the other hand, time/date are distributed
uniformly.  You would have a greater variance of seed values from
using time/date than by using noise from adc~, and thus, a lesser
degree of correlation between instances.

I like your idea, because you really get a completely independent
random variable--but I would try to convince you that, for a large
number of instances, you would see some correlations in the sequences.

Chuck

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


Re: [PD] Random - Different seed each time the patch is loaded

2008-09-04 Thread Phil Stone

One trick that works in patches that have some human interaction: 
loadbang a timer, then as soon as some human-generated input happens, 
grab the interval from the timer and use that for a seed.

Of course, this is no use for completely automated setups.


Phil Stone
www.pkstonemusic.com

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


Re: [PD] Setting a variable in abstractions

2008-09-04 Thread simone-www . io-lab . org
On Thu, Sep 4, 2008 at 1:13 AM, simone-www. io-lab. org
[EMAIL PROTECTED] wrote:
 On Thu, Sep 4, 2008 at 12:31 AM, Derek Holzer [EMAIL PROTECTED] wrote:
 Hey Simone,

 the only thing I see in the patch is that you should remove the number box
 inline in the MIDI to DEGREES section. Inline GUI elements can slow down a
 patch, especially when visible. Also, do you really want the CC input to
 change the size of the font in the [text2d], because that's what it does now
 ;-)
 no it sends a 7bit value to be displayed, the font size is the second inlet

 Besides that, you may want to have a look at your system config. Linux,
 right? In that case, you should make sure that OpenGL is configured
 properly, and that you have 3d acceleration enabled, otherwise all the GEM
 stuff will be done by the CPU which could also slow things down a little or
 a lot. There's plenty of docs online for whatever distro you are using...
 ah! since i got dual head installed i had to say good bye to Compiz
 and friends, and that maybe means no OpenGL.This is due to xinerama
 not supporting it, probably i ll have to use xrandr with a virtual
 desktop size on xorg.conf cause life without dual head can be pretty
 miserable ;)
 Yet i don understand why this happens only with midi in and not in
 other situations..
 btw i can t find proper infos about how to offset gemwin on a second
 screen or to have it not showing bars and window frame
 Tech specs:
 Dell D410 1,73Ghz 1,25 Mb
 Fedora Core 8 + CCRMA rt kernel
 microkontol KORG
here we go, this issue with OpenGL has finally pushed me to trash my
old Cinerama xorg.conf and go for the newest Xrandr which is just
awesome and i have OpenGL on both screens and the patch loads on my
external screen and it runs much more smoothly and nicely!! thumbs up
!!
yet: the response from the MIDI input is not as fast as as i imagined:
what does it make it go so slow?
Rotating images shouldn t be such a big deal and since i plan to embed
this application on a small miniATX computer or similar i wonder what
can be done to address this timing issue..
Simone


 Also, try not to run GEM stuff in the same PD patch as audio stuff (I
 mentioned this during the workshop). Running separate instances of PD, one
 for audio and one for GEM, connected with [netsend] objects or OSC, should
 do the trick.

 best!
 d.

 simone-www.io-lab.org wrote:

 hi
 I hope it s fine with top posting but the issue now is drifting off-topic:
 the patch works as a charm now, thanks again, but (there is always a
 but) somehow the incoming MIDI messages are slowed down.
 I tried to monitor the MIDI in and can see how when i turn the
 rendering on all the MIDI income gets slowed down terribly.
 Is there any known issue with GEM and MIDI or anything i have to check
 on my machine?
 GEM+sending messages from within PD worked flawlessly, CPU is not
 hogged, jack runs smoothly.
 I am attaching the patch but without the font file generating the 7bit
 midi value

 --
 derek holzer ::: http://www.umatic.nl ::: http://blog.myspace.com/macumbista
 ---Oblique Strategy # 49:
 Display your talent




 --
 .wmv , .wma , .pps along with all proprietary Windows formats won t be
 accepted and/or viewed




-- 
.wmv , .wma , .pps along with all proprietary Windows formats won t be
accepted and/or viewed

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


Re: [PD] Random - Different seed each time the patch is loaded

2008-09-04 Thread Peter Plessas
* Charles Henry [EMAIL PROTECTED] [2008-09-04 23:53]:
 On Thu, Sep 4, 2008 at 4:29 PM, Peter Plessas [EMAIL PROTECTED] wrote:
  Perhaps i am getting you wrong, but if i would want different behavior
  each time i'd open that patch, the noise from your adc~ would do that,
  bc it is surely different (thermal noise, etc) every time.
  (provided you switched your dsp~ on in advance). :-)
...
 
 I like your idea, because you really get a completely independent
 random variable--but I would try to convince you that, for a large
 number of instances, you would see some correlations in the sequences.

That is right, for really large numbers and critical applications the
noise from the soundcard might not be white enough!

thanks!

PP

 
 Chuck

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


[PD] open / close patch

2008-09-04 Thread ruben patiño
hi all

i have a question

i´m trying to  open and close one patch with messages.

opening it with  pd open patch.pd and then the hole
path works fine.

basiclly  the problem comes when i want to close the
patch with the message menuclose. 

it does not close.

any idea why it happens?

also i´d like to know how to close the hole pd with a
message.

thanks a lot




  

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


Re: [PD] open / close patch

2008-09-04 Thread Mike McGonagle
Once you open the patch, it has a new name, so to speak. I attached a patch
that will close itself.

Mike


On Thu, Sep 4, 2008 at 5:02 PM, ruben patiño [EMAIL PROTECTED] wrote:

 hi all

 i have a question

 i´m trying to  open and close one patch with messages.

 opening it with  pd open patch.pd and then the hole
 path works fine.

 basiclly  the problem comes when i want to close the
 patch with the message menuclose.

 it does not close.

 any idea why it happens?

 also i´d like to know how to close the hole pd with a
 message.

 thanks a lot






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




-- 
Peace may sound simple—one beautiful word— but it requires everything we
have, every quality, every strength, every dream, every high ideal.
—Yehudi Menuhin (1916–1999), musician


test.pd
Description: Binary data
___
Pd-list@iem.at mailing list
UNSUBSCRIBE and account-management - 
http://lists.puredata.info/listinfo/pd-list


Re: [PD] open / close patch

2008-09-04 Thread Mike McGonagle
This patch will 'quit' pd altogether.

Mike


On Thu, Sep 4, 2008 at 5:02 PM, ruben patiño [EMAIL PROTECTED] wrote:

 hi all

 i have a question

 i´m trying to  open and close one patch with messages.

 opening it with  pd open patch.pd and then the hole
 path works fine.

 basiclly  the problem comes when i want to close the
 patch with the message menuclose.

 it does not close.

 any idea why it happens?

 also i´d like to know how to close the hole pd with a
 message.

 thanks a lot






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




-- 
Peace may sound simple—one beautiful word— but it requires everything we
have, every quality, every strength, every dream, every high ideal.
—Yehudi Menuhin (1916–1999), musician


test2.pd
Description: Binary data
___
Pd-list@iem.at mailing list
UNSUBSCRIBE and account-management - 
http://lists.puredata.info/listinfo/pd-list


Re: [PD] pdp_text stange behaviour

2008-09-04 Thread ydegoyon

ok, you're right,
here's the right one..

still unable to commit...

husk wrote:

ydegoyon escribió:
  

ok, it seems to work,
here it is attached



Yes, it works! many thanks.
just a warning output in my application:

* Imlib2 Developer Warning * :
This program is calling the Imlib call:

imlib_get_text_size();

With the parameter:

font

being NULL. Please fix your program.

See you soon in bcn
Husk

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

  


/*
 *   PiDiP module
 *   Copyright (c) by Yves Degoyon ([EMAIL PROTECTED])
 *
 *   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., 675 Mass Ave, Cambridge, MA 02139, USA.
 *
 */

/*  This object is a text rendering object for PDP
 *  It uses imlib2 for all graphical operations
 */

/*  Listening to :
 *  Deviants - Nothing Man
 *  Monte Cazzaza - Kick That Habit Man
 */

#include pdp.h
#include yuv.h
#include math.h
#include ctype.h
#include Imlib2.h  // imlib2 is required

#define DEFAULT_CAPACITY 10
#define DEFAULT_FONT Vera/16

static char   *pdp_text_version = pdp_text: version 0.2 : text rendering object written by [EMAIL PROTECTED];

typedef struct pdp_text_struct
{
t_object x_obj;
t_float x_f;

int x_packet0;
int x_packet1;
int x_dropped;
int x_queue_id;

t_outlet *x_outlet0;
int x_vwidth;
int x_vheight;
int x_vsize;

char **x_text_array;
int *x_xoffsets;
int *x_yoffsets;
int *x_r;
int *x_g;
int *x_b;
t_float *x_angle;
t_float x_alpha;
int *x_scroll;

int x_nbtexts;
int x_current;
int x_capacity;

/* imlib data */
Imlib_Image x_image;
Imlib_Font x_font;

} t_pdp_text;

/* add a new text : syntax : text my%20text x y */
static void pdp_text_add(t_pdp_text *x, t_symbol *s, int argc, t_atom *argv)
{
 char *pname;
 char *pdname;
 int len;

   if ( x-x_nbtexts = x-x_capacity )
   {
  post( pdp_text : sorry, maximum capacity has been reached... try resize );
  return;
   } 
   
   if ( argc  3 )
   {
  post( pdp_text : error in the number of arguments ( minimum is 3 ), argc );
  return;
   }
   if ( argv[0].a_type != A_SYMBOL || argv[1].a_type != A_FLOAT || argv[2].a_type != A_FLOAT ) {
  post( pdp_text : add : wrong arguments );
  return;
   }

   // allocate new text area
   len = strlen( argv[0].a_w.w_symbol-s_name ); 
   pdname = x-x_text_array[x-x_nbtexts] = (char *) getbytes( len+1 );
   pname = (char *) getbytes( len+1 );
   memset( pname, 0x0, len+1 );
   memcpy( pname, argv[0].a_w.w_symbol-s_name, len );
   while (*(pname))
   {
  if ( (*pname=='%')  ( isdigit(*(pname+1)) || (*(pname+1)=='%') ) )
  {
int ivalue;
int ndigits;
char  *piname;

 ndigits=0;
 piname=pname+1;
 while ( isdigit( *(piname++) ) ) ndigits++;
 
 ivalue=atoi(pname+1);

 // special case %%
 if ( ( pname != argv[0].a_w.w_symbol-s_name )  ( *(pname+1) == '%' ) )
 {
*(pdname++)=*(pname++);
pname++;
continue;
 } 
 *(pdname++)=(char)ivalue;
 pname+=ndigits+1;
  }
  else if ( !strncmp( pname, \, 1 ) ) // quotes are ignored unless %34
  { 
pname++;
  }
  else
  {
 *(pdname++)=*(pname++);
  } 
   }
   *(pdname)='\0';
   x-x_xoffsets[x-x_nbtexts] = (int)argv[1].a_w.w_float;
   x-x_yoffsets[x-x_nbtexts] = (int)argv[2].a_w.w_float;

   if ( (argc=4)  (argv[3].a_type == A_FLOAT) )
   {
  x-x_r[x-x_nbtexts] = (int)argv[3].a_w.w_float;
   }
   if ( (argc=5)  (argv[4].a_type == A_FLOAT) )
   {
  x-x_g[x-x_nbtexts] = (int)argv[4].a_w.w_float;
   }
   if ( (argc=6)  (argv[5].a_type == A_FLOAT) )
   {
  x-x_b[x-x_nbtexts] = (int)argv[5].a_w.w_float;
   }
   if ( (argc=7)  (argv[6].a_type == A_FLOAT) )
   {
  x-x_angle[x-x_nbtexts] = argv[6].a_w.w_float;
   }
   if ( (argc=8)  (argv[7].a_type == A_FLOAT) )
   {
  x-x_scroll[x-x_nbtexts] = (int)argv[7].a_w.w_float;
   }
   
   post( pdp_text : added text %s @ %d (r=%d g=%d b=%d), 
x-x_text_array[x-x_nbtexts], x-x_nbtexts,
   x-x_r[x-x_nbtexts], x-x_g[x-x_nbtexts], x-x_b[x-x_nbtexts] );

   if ( x-x_current == 

Re: [PD] Random - Different seed each time the patch is loaded

2008-09-04 Thread Charles Henry
On Thu, Sep 4, 2008 at 5:09 PM, Peter Plessas [EMAIL PROTECTED] wrote:
 * Charles Henry [EMAIL PROTECTED] [2008-09-04 23:53]:
 On Thu, Sep 4, 2008 at 4:29 PM, Peter Plessas [EMAIL PROTECTED] wrote:
  Perhaps i am getting you wrong, but if i would want different behavior
  each time i'd open that patch, the noise from your adc~ would do that,
  bc it is surely different (thermal noise, etc) every time.
  (provided you switched your dsp~ on in advance). :-)

 That is right, for really large numbers and critical applications the
 noise from the soundcard might not be white enough!

Actually, it's not the whiteness of the noise which is important.
Whiteness of noise simply means that the samples are not correlated
with each other with respect to time.  The key is the distribution of
a random variable, namely the instantaneous value of the noise at a
single point in time.

Since the noise values tend to be close to 0, the values are un-evenly
distributed.  I'm really just pointing to the advantage of using a
uniformly distributed random variable for choosing seeds.

Of course, now that you have me thinking about it :) ,  we could
transform our distribution for the noise into a uniform distribution,
like using the Box-Muller method backwards.

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