Re: [PD] external object becoming a message box after saving

2007-01-16 Thread Hans-Christoph Steiner


Thanks to this thread, I think I fixed the problem with cyclone too...

.hc

On Jan 11, 2007, at 5:53 AM, ugur guney wrote:


On 1/10/07, IOhannes m zmoelnig <[EMAIL PROTECTED]> wrote:
hi.

first off: please _always_ reply to the pd-list and not just me; the
list is not just a way to get into contact with others, but also a way
to learn things "passively" (e.g. by lurking on the list or by reading
the archives)...

# Sorry, I used to use my bands google groups mail-list and there  
when I click reply the mail is sent to the list, not the individual  
I'm replying. I did'nt realized that I was not sending to the list.  
Next time I'll pay attention to whom I sent and select reply-all.


ok, unfortunately your make excerpt didn't tell me enough, since you
should have done a "make clean" before. (only the linking stage is
executed since the compilation of additive~.o is already up-to-date).

miller's pd is compiled with M$VC-6 (i think), you have to tell gcc  
that

you are linking against such library.

try to use the "-mms-bitfields" cflag to gcc when _compiling_ your  
external.

and tell us what happens.

# I select clean in the project menu. This time there is a new line  
in the make excerpt.


Compiler: Default compiler
Building Makefile: "C:\Dev-Cpp\Projects\pdexternal\Makefile.win"
Executing  make...
mingw32-make -f "C:\Dev-Cpp\Projects\pdexternal\Makefile.win" all
gcc.exe -c additive~.c -o additive~.o -I"C:/music/pd.miller.40-2/ 
src"  -mms-bitfields


dllwrap.exe --output-def libadditive.def --implib libadditive.a  
additive~.o  -L"C:/music/pd.miller.40-2/lib" c:/music/pd.miller. 
40-2/bin/pd.lib   -o additive.dll


dllwrap.exe: no export definition file provided.
Creating one, but that may not be what you want

Execution terminated
Compilation successful

# I think after adding -mms-bitfields flag to the compile command  
the strange error dissappeared! I saved, moved, created the  
[additive~] object many times, and it works as it supposed to be!

# Thank you very much!
# What means this -mms-bitfields flag? I looked at the gcc's manual  
but it isn't in the list there.
http://gcc.gnu.org/onlinedocs/gcc-3.4.6/gcc/Option- 
Summary.html#Option-Summary

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





Computer science is no more related to the computer than astronomy is  
related to the telescope.  -Edsger Dykstra



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


Re: [PD] external object becoming a message box after saving

2007-01-11 Thread ugur guney

On 1/10/07, IOhannes m zmoelnig <[EMAIL PROTECTED]> wrote:


hi.

first off: please _always_ reply to the pd-list and not just me; the
list is not just a way to get into contact with others, but also a way
to learn things "passively" (e.g. by lurking on the list or by reading
the archives)...



# Sorry, I used to use my bands google groups mail-list and there when I
click reply the mail is sent to the list, not the individual I'm replying. I
did'nt realized that I was not sending to the list. Next time I'll pay
attention to whom I sent and select reply-all.

ok, unfortunately your make excerpt didn't tell me enough, since you

should have done a "make clean" before. (only the linking stage is
executed since the compilation of additive~.o is already up-to-date).



miller's pd is compiled with M$VC-6 (i think), you have to tell gcc that

you are linking against such library.

try to use the "-mms-bitfields" cflag to gcc when _compiling_ your
external.
and tell us what happens.



# I select clean in the project menu. This time there is a new line in the
make excerpt.

Compiler: Default compiler
Building Makefile: "C:\Dev-Cpp\Projects\pdexternal\Makefile.win"
Executing  make...
mingw32-make -f "C:\Dev-Cpp\Projects\pdexternal\Makefile.win" all
gcc.exe -c additive~.c -o additive~.o -I"C:/music/pd.miller.40-2/src"
-mms-bitfields

dllwrap.exe --output-def libadditive.def --implib libadditive.a additive~.o
-L"C:/music/pd.miller.40-2/lib" c:/music/pd.miller.40-2/bin/pd.lib   -o
additive.dll

dllwrap.exe: no export definition file provided.
Creating one, but that may not be what you want

Execution terminated
Compilation successful

# I think after adding -mms-bitfields flag to the compile command the
strange error dissappeared! I saved, moved, created the [additive~] object
many times, and it works as it supposed to be!
# Thank you very much!
# What means this -mms-bitfields flag? I looked at the gcc's manual but it
isn't in the list there.
http://gcc.gnu.org/onlinedocs/gcc-3.4.6/gcc/Option-Summary.html#Option-Summary
-ugur-
___
PD-list@iem.at mailing list
UNSUBSCRIBE and account-management -> 
http://lists.puredata.info/listinfo/pd-list


Re: [PD] external object becoming a message box after saving

2007-01-10 Thread Anders Friberg



Hans-Christoph Steiner wrote:


Strange, this is happening with the cyclone/toxy objects too.  I 
wonder what's causing it...
I had the same problem with the cyclone/switch object in the 38.4 
pd-extended on windows.

/Anders



.hc

On Jan 9, 2007, at 2:50 PM, ugur guney wrote:


# Hi list!
# I'm trying to learn how to write externals (after being able to 
link and compile the source codes thanks to Yvan Vander Sanden's 
tutorial) and come up with a strange behavoir: The object [additive~] 
turns into a messege box [additive~( (and sometimes its borders are 
totally erased or sometimes pd crashes) after saving the patch (but 
not everytime). Maybe I made a mistake that I couldn't find. What 
might be the reason of such an error?
# Here is the code I've written. The object should be post the number 
of incoming bangs and the time after creation (when dsp is on) and 
compiled .dll file is attached.

-ugur-

#include "m_pd.h"

static t_class *additive_tilde_class;

typedef struct _additive_tilde {
  t_object x_obj;

  t_int bangtime;
  t_float time;
} t_additive_tilde;

void additive_tilde_bang(t_additive_tilde *x)
{
  post("you banged %d times. time: %f", x->bangtime++, x->time);
}

t_int *additive_tilde_perform(t_int *w)
{
  t_additive_tilde *x = (t_additive_tilde *)(w[1]);
  t_sample   *out = (t_sample *)(w[2]);
  int   n =(int)(w[3]);

  while (n--)
  {
*out++ = x->time;
x->time += 1.0f/44100;
  }

  return (w+4);
}

void additive_tilde_dsp(t_additive_tilde *x, t_signal **sp)
{
  dsp_add(additive_tilde_perform, 3, x,
  sp[0]->s_vec, sp[0]->s_n);
}

void *additive_tilde_new(t_floatarg f)
{
  t_additive_tilde *x = (t_additive_tilde *)pd_new(additive_tilde_class);
  x->time = f;
  x->bangtime =  0;
  outlet_new(&x->x_obj, gensym("signal"));

  return (void *)x;
}

__declspec (dllexport) void additive_tilde_setup(void)
{
  additive_tilde_class = class_new(gensym("additive~"),
(t_newmethod)additive_tilde_new,
0, sizeof(t_additive_tilde),
CLASS_DEFAULT,
A_DEFFLOAT, 0);

  class_addmethod(additive_tilde_class,
(t_method)additive_tilde_dsp, gensym("dsp"), 0);

  class_addbang(additive_tilde_class, additive_tilde_bang);
}

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





As we enjoy great advantages from inventions of others, we should be 
glad of an opportunity to serve others by any invention of ours; and 
this we should do freely and generously. - Benjamin Franklin





___
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] external object becoming a message box after saving

2007-01-10 Thread IOhannes m zmoelnig
hi.

first off: please _always_ reply to the pd-list and not just me; the
list is not just a way to get into contact with others, but also a way
to learn things "passively" (e.g. by lurking on the list or by reading
the archives)...

ugur guney wrote:
> C:\MinGW\bin>gcc -v
> Reading specs from ../lib/gcc/mingw32/3.4.2/specs
> Configured with: ../gcc/configure --with-gcc --with-gnu-ld --with-gnu-as
> --host=
> mingw32 --target=mingw32 --prefix=/mingw --enable-threads --disable-nls
> --enable
> -languages=c,c++,f77,ada,objc,java --disable-win32-registry
> --disable-shared --e
> nable-sjlj-exceptions --enable-libgcj --disable-java-awt --without-x
> --enable-ja
> va-gc=boehm --disable-libgcj-debug --enable-interpreter
> --enable-hash-synchroniz
> ation --enable-libstdcxx-debug
> Thread model: win32
> gcc version 3.4.2 (mingw-special)
> 
> # But I did not compiled PD by myself. I downloaded Puckette's version
> 40-2 and linked to its pd.lib file.
> # Both in this pd version and in PD-extended 0.39-2-test6 similar errors
> occured using the same .dll file.
> # I compiled using both CodeBlocks and DevC++ IDE's. DevC++ outputs the
> compilation commands:
> 
> Compiler: Default compiler
> Building Makefile: "C:\Dev-Cpp\Projects\pdexternal\Makefile.win"
> Executing  make...
> mingw32-make -f "C:\Dev-Cpp\Projects\pdexternal\Makefile.win" all
> dllwrap.exe --output-def libadditive.def --implib libadditive.a
> additive~.o  -L"C:/music/pd.miller.40-2/lib"
> c:/music/pd.miller.40-2/bin/pd.lib   -o additive.dll
> 
> dllwrap.exe: no export definition file provided.
> Creating one, but that may not be what you want
> 
> Execution terminated
> Compilation successful 
> 
> since you have a .dll, you are on windows right?
> which windows?
> 
> 
> # And I'm using WindowsXP SP2
> -ugur-
> 



ok, unfortunately your make excerpt didn't tell me enough, since you
should have done a "make clean" before. (only the linking stage is
executed since the compilation of additive~.o is already up-to-date).

miller's pd is compiled with M$VC-6 (i think), you have to tell gcc that
 you are linking against such library.

try to use the "-mms-bitfields" cflag to gcc when _compiling_ your external.
and tell us what happens.


mfg.asdr.
IOhannes

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


Re: [PD] external object becoming a message box after saving

2007-01-10 Thread IOhannes m zmoelnig
ugur guney wrote:
> # Hi list!
> # I'm trying to learn how to write externals (after being able to link
> and compile the source codes thanks to Yvan Vander Sanden's tutorial)
> and come up with a strange behavoir: The object [additive~] turns into a
> messege box [additive~( (and sometimes its borders are totally erased or
> sometimes pd crashes) after saving the patch (but not everytime). Maybe
> I made a mistake that I couldn't find. What might be the reason of such
> an error?

according to previous reports of this error it is likely to be a missing
compiler|linker flag somewhere.

which compiler are you using to compile your external.
which compiler was used to compile pd? (or: which version of pd are you
linking against?)


> # Here is the code I've written. The object should be post the number of
> incoming bangs and the time after creation (when dsp is on) and compiled
> .dll file is attached.

since you have a .dll, you are on windows right?
which windows?

mf.adsr
IOhannes

> -ugur-

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


Re: [PD] external object becoming a message box after saving

2007-01-09 Thread Hans-Christoph Steiner


Strange, this is happening with the cyclone/toxy objects too.  I  
wonder what's causing it...


.hc

On Jan 9, 2007, at 2:50 PM, ugur guney wrote:


# Hi list!
# I'm trying to learn how to write externals (after being able to  
link and compile the source codes thanks to Yvan Vander Sanden's  
tutorial) and come up with a strange behavoir: The object  
[additive~] turns into a messege box [additive~( (and sometimes its  
borders are totally erased or sometimes pd crashes) after saving  
the patch (but not everytime). Maybe I made a mistake that I  
couldn't find. What might be the reason of such an error?
# Here is the code I've written. The object should be post the  
number of incoming bangs and the time after creation (when dsp is  
on) and compiled .dll file is attached.

-ugur-

#include "m_pd.h"

static t_class *additive_tilde_class;

typedef struct _additive_tilde {
  t_object x_obj;

  t_int bangtime;
  t_float time;
} t_additive_tilde;

void additive_tilde_bang(t_additive_tilde *x)
{
  post("you banged %d times. time: %f", x->bangtime++, x->time);
}

t_int *additive_tilde_perform(t_int *w)
{
  t_additive_tilde *x = (t_additive_tilde *)(w[1]);
  t_sample   *out = (t_sample *)(w[2]);
  int   n =(int)(w[3]);

  while (n--)
  {
*out++ = x->time;
x->time += 1.0f/44100;
  }

  return (w+4);
}

void additive_tilde_dsp(t_additive_tilde *x, t_signal **sp)
{
  dsp_add(additive_tilde_perform, 3, x,
  sp[0]->s_vec, sp[0]->s_n);
}

void *additive_tilde_new(t_floatarg f)
{
  t_additive_tilde *x = (t_additive_tilde *)pd_new 
(additive_tilde_class);

  x->time = f;
  x->bangtime =  0;
  outlet_new(&x->x_obj, gensym("signal"));

  return (void *)x;
}

__declspec (dllexport) void additive_tilde_setup(void)
{
  additive_tilde_class = class_new(gensym("additive~"),
(t_newmethod)additive_tilde_new,
0, sizeof(t_additive_tilde),
CLASS_DEFAULT,
A_DEFFLOAT, 0);

  class_addmethod(additive_tilde_class,
(t_method)additive_tilde_dsp, gensym("dsp"), 0);

  class_addbang(additive_tilde_class, additive_tilde_bang);
}

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





As we enjoy great advantages from inventions of others, we should be  
glad of an opportunity to serve others by any invention of ours; and  
this we should do freely and generously. - Benjamin Franklin



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


[PD] external object becoming a message box after saving

2007-01-09 Thread ugur guney

# Hi list!
# I'm trying to learn how to write externals (after being able to link and
compile the source codes thanks to Yvan Vander Sanden's tutorial) and come
up with a strange behavoir: The object [additive~] turns into a messege box
[additive~( (and sometimes its borders are totally erased or sometimes pd
crashes) after saving the patch (but not everytime). Maybe I made a mistake
that I couldn't find. What might be the reason of such an error?
# Here is the code I've written. The object should be post the number of
incoming bangs and the time after creation (when dsp is on) and compiled
.dll file is attached.
-ugur-

#include "m_pd.h"

static t_class *additive_tilde_class;

typedef struct _additive_tilde {
 t_object x_obj;

 t_int bangtime;
 t_float time;
} t_additive_tilde;

void additive_tilde_bang(t_additive_tilde *x)
{
 post("you banged %d times. time: %f", x->bangtime++, x->time);
}

t_int *additive_tilde_perform(t_int *w)
{
 t_additive_tilde *x = (t_additive_tilde *)(w[1]);
 t_sample   *out = (t_sample *)(w[2]);
 int   n =(int)(w[3]);

 while (n--)
 {
   *out++ = x->time;
   x->time += 1.0f/44100;
 }

 return (w+4);
}

void additive_tilde_dsp(t_additive_tilde *x, t_signal **sp)
{
 dsp_add(additive_tilde_perform, 3, x,
 sp[0]->s_vec, sp[0]->s_n);
}

void *additive_tilde_new(t_floatarg f)
{
 t_additive_tilde *x = (t_additive_tilde *)pd_new(additive_tilde_class);
 x->time = f;
 x->bangtime =  0;
 outlet_new(&x->x_obj, gensym("signal"));

 return (void *)x;
}

__declspec (dllexport) void additive_tilde_setup(void)
{
 additive_tilde_class = class_new(gensym("additive~"),
   (t_newmethod)additive_tilde_new,
   0, sizeof(t_additive_tilde),
   CLASS_DEFAULT,
   A_DEFFLOAT, 0);

 class_addmethod(additive_tilde_class,
   (t_method)additive_tilde_dsp, gensym("dsp"), 0);

 class_addbang(additive_tilde_class, additive_tilde_bang);
}


additive~.dll
Description: Binary data
___
PD-list@iem.at mailing list
UNSUBSCRIBE and account-management -> 
http://lists.puredata.info/listinfo/pd-list