Interfacing PD with the Arduino ... how?
i got a problem in uploading the file to the board. ( I have press play, same error found. When I press upload to I/O, below error found)
anyone can help?
thx
////////////////////////////
/Applications/arduino-0012/hardware/libraries/Firmata/Firmata.h:61: error: typedef 'callbackFunction' is initialized (use __typeof__ instead)
/Applications/arduino-0012/hardware/libraries/Firmata/Firmata.h:61: error: 'byte' was not declared in this scope
/Applications/arduino-0012/hardware/libraries/Firmata/Firmata.h:61: error: expected primary-expression before 'int'
/Applications/arduino-0012/hardware/libraries/Firmata/Firmata.h:64: error: typedef 'sysexCallbackFunction' is initialized (use __typeof__ instead)
/Applications/arduino-0012/hardware/libraries/Firmata/Firmata.h:64: error: 'byte' was not declared in this scope
/Applications/arduino-0012/hardware/libraries/Firmata/Firmata.h:64: error: 'byte' was not declared in this scope
/Applications/arduino-0012/hardware/libraries/Firmata/Firmata.h:64: error: 'byte' was not declared in this scope
/Applications/arduino-0012/hardware/libraries/Firmata/Firmata.h:64: error: 'argv' was not declared in this scope
/Applications/arduino-0012/hardware/libraries/Firmata/Firmata.h:81: error: 'byte' has not been declared
/Applications/arduino-0012/hardware/libraries/Firmata/Firmata.h:81: error: 'byte' has not been declared
/Applications/arduino-0012/hardware/libraries/Firmata/Firmata.h:86: error: 'byte' has not been declared
/Applications/arduino-0012/hardware/libraries/Firmata/Firmata.h:87: error: 'byte' has not been declared
/Applications/arduino-0012/hardware/libraries/Firmata/Firmata.h:88: error: 'byte' has not been declared
/Applications/arduino-0012/hardware/libraries/Firmata/Firmata.h:90: error: 'byte' has not been declared
/Applications/arduino-0012/hardware/libraries/Firmata/Firmata.h:91: error: 'byte' has not been declared
/Applications/arduino-0012/hardware/libraries/Firmata/Firmata.h:91: error: 'byte' has not been declared
/Applications/arduino-0012/hardware/libraries/Firmata/Firmata.h:91: error: 'byte' has not been declared
/Applications/arduino-0012/hardware/libraries/Firmata/Firmata.h:95: error: 'byte' has not been declared
/Applications/arduino-0012/hardware/libraries/Firmata/Firmata.h:95: error: 'callbackFunction' has not been declared
/Applications/arduino-0012/hardware/libraries/Firmata/Firmata.h:96: error: 'byte' has not been declared
/Applications/arduino-0012/hardware/libraries/Firmata/Firmata.h:97: error: 'byte' has not been declared
/Applications/arduino-0012/hardware/libraries/Firmata/Firmata.h:98: error: 'byte' has not been declared
/Applications/arduino-0012/hardware/libraries/Firmata/Firmata.h:98: error: 'sysexCallbackFunction' has not been declared
/Applications/arduino-0012/hardware/libraries/Firmata/Firmata.h:98: error: 'void FirmataClass::attach(int, int)' cannot be overloaded
/Applications/arduino-0012/hardware/libraries/Firmata/Firmata.h:95: error: with 'void FirmataClass::attach(int, int)'
/Applications/arduino-0012/hardware/libraries/Firmata/Firmata.h:99: error: 'byte' has not been declared
/Applications/arduino-0012/hardware/libraries/Firmata/Firmata.h:104: error: 'byte' does not name a type
/Applications/arduino-0012/hardware/libraries/Firmata/Firmata.h:105: error: ISO C++ forbids declaration of 'byte' with no type
/Applications/arduino-0012/hardware/libraries/Firmata/Firmata.h:105: error: expected ';' before '*' token
/Applications/arduino-0012/hardware/libraries/Firmata/Firmata.h:107: error: 'byte' does not name a type
/Applications/arduino-0012/hardware/libraries/Firmata/Firmata.h:108: error: 'byte' does not name a type
/Applications/arduino-0012/hardware/libraries/Firmata/Firmata.h:109: error: 'byte' does not name a type
/Applications/arduino-0012/hardware/libraries/Firmata/Firmata.h:110: error: 'byte' does not name a type
/Applications/arduino-0012/hardware/libraries/Firmata/Firmata.h:112: error: 'boolean' does not name a type
/Applications/arduino-0012/hardware/libraries/Firmata/Firmata.h:115: error: 'callbackFunction' does not name a type
/Applications/arduino-0012/hardware/libraries/Firmata/Firmata.h:116: error: 'callbackFunction' does not name a type
/Applications/arduino-0012/hardware/libraries/Firmata/Firmata.h:117: error: 'callbackFunction' does not name a type
/Applications/arduino-0012/hardware/libraries/Firmata/Firmata.h:118: error: 'callbackFunction' does not name a type
/Applications/arduino-0012/hardware/libraries/Firmata/Firmata.h:119: error: 'callbackFunction' does not name a type
/Applications/arduino-0012/hardware/libraries/Firmata/Firmata.h:122: error: 'sysexCallbackFunction' does not name a type
In function 'void setup()':
Problem compiling external on Windows
Alberto,
I figured it out. I made a few changes to your makefile, though:
1. added a path to m_pd.h
2. changed "rm -f $*.o ../$*.dll" to "rm -f $*.o $*.dll"
(the .dll file wasn't being removed from the working directory)
3. forced DEST to the pd/extra directory
4. removed CSYM since it's not being used
5. removed "current: pd_win"; changed "pd_win: $(NAME).dll" to "all: $(NAME).dll"
6. removed non-win stuff
7. removed the clean and install targets for right now
Hopefully these changes make it easier for the complete newbie. Anyway, with enormous thanks to AlbertoZ, here's a mini-tutorial for using my makefile.
1. if you're using pd-extended, save this as "m_pd.h" (into the same directory with
helloworld.c). If you're using pd-vanilla, you can skip this step.
2. save this code as "mk.mk" (into the same directory with helloworld.c):
# mk.mk -- invoke with "make -f mk.mk"
NAME = helloworld
PDPATH = "c:/Progra~1/pd"
LDFLAGS = --export-dynamic -shared
WININCLUDE = -I $(PDPATH)/src
WINCFLAGS = -DPD -DNT -W3 -WX -Werror -Wno-unused \
-mms-bitfields -Wno-parentheses -Wno-switch \
-O6 -funroll-loops -fomit-frame-pointer
all: $(NAME).dll
.SUFFIXES: .dll
.c.dll:
gcc $(WINCFLAGS) $(WININCLUDE) -c -o $*.o $*.c
gcc $(LDFLAGS) -o $*.dll $*.o $(PDPATH)/bin/pd.dll
strip --strip-unneeded $*.dll
cp $*.dll $(PDPATH)/extra
rm -f $*.o $*.dll
2. modify the PDPATH variable if needed to reflect the actual location of pd on your
system (MSYS will interpret c:/Program Files/pd as C:/Program, so use
c:/Progra~1/pd instead)
3. if you're using pd-extended, remove line 6 (WININCLUDE = -I $(PDPATH)/src) and
remove $(WININCLUDE) from line 14.
4. close all pd windows if any are open
5. in MSYS, navigate to the directory with helloworld.c and type: make -f mk.mk
(type make -s -f mk.mk if you want to hide the lengthy shell response)
6. the shell should respond with something like:
gcc -DPD -DNT -W3 -WX -Werror -Wno-unused -mms-bitfields -Wno-parentheses
-Wno-switch -O6 -funroll-loops -fomit-frame-pointer -I "c:/Progra~1/pd"/src -c -o
helloworld.o helloworld.c
gcc --export-dynamic -shared -o helloworld.dll helloworld.o
"c:/Progra~1/pd"/bin/pd.dll
strip --strip-unneeded helloworld.dll
cp helloworld.dll "c:/Progra~1/pd"/extra
rm -f helloworld.o helloworld.dll
7. a new helloworld.dll file should be saved into the pd/extra folder, and you should be
able to create the "helloworld" object in a new pd window.
Good luck!
middlepedal
Problem compiling external on Windows
Great tutorial, very detailed!
Thanks for this addition..
Sorry for coming later on this subject but I'll try to add few lines about
compiling externals in Win without going through MSVC Express
edition (by the way: what are the limitations of the express edition
w.r.t. the full package?).
Even if MSVC offers an integrated environment for developing there
can be some good reasons for giving a try to the old-man "unix" way of
compiling, which in windows is best represented by MINGW32 and
cygwin. Both offers linux-like environments (i.e. command line tools)
for compiling and other shell tasks which, sometimes, in windows are
a pain in the ass.
There are at least three good reasons for giving a look at mingw:
- gives strong linux compatibility on external compilation
(almost same command lines arguments etc.) - there is the possibility to use makefiles in an almost straightforward way
(with minor modifications to linux makefiles). - no dependency on expensive MS programs (except for the
small, bug-free Operating System
I did this exercise by porting the E. Lyon "LyonPoutpourry" externals for win
(http://www.sarc.qub.ac.uk/~elyon/LyonSoftware/Pd/). Give a look at
the win source package: inside there is a makefile for darwin (MAC)
linux and win. I added the latter, and as you can see the modifications
are minor.
----------- 1. Prelude: compilation environment ------------------
First of all we have to set once for all the compilation environment.
Let's forget for the moment cygwin and concentrate on mingw32 (http://www.mingw.org/). The following is taken from (H.C. Steiner's wiki http://www.puredata.org/docs/developer/mingw)
Download the MinGW package installer and run it:
(http://prdownloads.sourceforge.net/mingw/MinGW-5.1.1.exe)
Choose the Candidate distribution. Install the defaults and add the g++ compiler, g77 compiler, and MinGW make or you can just download my MinGW install, MinGW-Pd.tar.bz2, and uncompress it so that its installed into C:\MinGW.
Then we need MSYS which is a shell (an interpreter of the commands, like a
colorful dos prompt
http://prdownloads.sourceforge.net/mingw/MSYS-1.0.10.exe
Now you will be using the MSYS shell that was installed from the MSYS installer. You can launch it from the Desktop shortcut or Start -> Programs -> MinGW -> MSYS -> msys
----------- 2. Allegro: compilation trial ------------------
a. open MSYS
b. at the prompt type:
cd c:
(or the drive you whish to go for the pd external compilation)
c. go to the external directory (note the backslashes instead of slashes !),
mine is external-compiling. Inside I have helloworld.c
cd alberto/backup/PureData_Archive/patches/AlbertoZ/external-compiling/
d. copy m_pd.h (from the PD distribution directory) into external-compiling
(or whatever is its name)
e. type:
gcc -c helloworld.c -o helloworld.o
f. type:
ld -export_dynamic -shared -o helloworld.dll helloworld.o c:/Programmi/pd039e
xt4/bin/pd.dll
(this is the linker step. note that I linked to a particular version of pd.dll - 0.39 extended test 4, so probably (I'm not sure about this) the external will
run on 0.39 only. Can someone confrm this?)
g. If everything was ok then you should have a helloworld.dll in your
directory. Move it on the extra folder of your pd distribution
(I assume that extra folder is in the pd predefined path) and make a
new patch with the helloworld object. Again, if everything is correct,
you should have a "Hello world!!" printed on the console.
----------- 3. Adagio: makefile ------------------
A makefile can be used for compilation. Even if a simple helloworld
application does not need it, complex programs may do.
The makefile.win is attached with this post. Modify it according to your
path in
Make sure you have
helloworld.c
m_pd.h
makefile.win
in your directory. Now type at MSYS prompt:
make -f makefile.win
This will automatically produce:
the object, the linker step (the dll) and will copy the helloworld.dll
in the extra folder of you pd distribution (overwriting the existing one .
----------- 4. Allegro con brio: conclusions ------------------
Why not give a try to the old-man compilation on Win?
----------- 5. Minuetto: greetings ------------------
I apologize if I said some crap somewhere, just let me know if it
doesn't work. Have fun!
Best regards,
Alberto
Problem compiling external on Windows
Hey,
thanks to everyone who responded to my posts both here and in the mailing list. Since then, I've figured out how to compile externals written in C using Microsoft Visual C++ 2005. There's more to document, however, such as how to compile externals using some of the other Windows compilers (Borland, djgpp, etc.), and also how to compile externals written in C++ in Windows. But one thing at a time.
one little thing to note... steps 4 and 7 may seem a little roundabout, but they account for the fact that MSVC sometimes has trouble with spaces in directory names (eg. C://Program Files/). If anyone knows how to override this behavior, post a reply, and I'll try to simplify the steps accordingly.
Updated June 29, 2007:
use [b]C://Progra~1/[/b] instead of [b]C://Program Files/[/b],
use [b]C://Docume~1/[/b] instead of [b]C://Documents and Settings/[/b], etc.
So, without further ado...
How to compile a pd external written in C using Microsoft Visual C++ 2005:
Compared to Windows, linux offers a much more user-friendly environment for compiling pd externals. However, with a little patience, a usable environment can be set up in Windows, and the good news is that everything you need is available for free. There are several reputable Windows-compatible C/C++ compilers out there, but here I'll discuss compiling externals with Microsoft Visual C++ 2005 (MSVC for short).
1. Download and Install Microsoft Visual C++ 2005 Express Edition.
a. Click the link above, then click Go! in the Visual C++ box.
b. Run vcsetup.exe to install the program
(the setup wizard should guide you through the process).
2. Download [url=http://download.microsoft.com/download/7/7/3/7737290f-98e8-45bf-9075-85cc6ae34bf1/VS80sp1-KB9267
]Visual C++ 2005 Express Service Pack 1.
a. Click the link above to download the Service Pack.
b. Run VS80sp1-KB926748-X86-INTL.exe to install the program.
3. Create a new project:
a. Open Visual C++.
b. Open the New Project window (Ctrl+Shift+N).
c. In the Project Types pane, select Visual C++.
d. In the Templates pane, select emptyproj.
e. Enter object name (helloworld).
f. Leave Create directory for solution unchecked, and click OK.
4. Import the pd header file:
a. Get m_pd.h here, or, using pd-vanilla (not pd-extended):
1. Open Windows Explorer or My Computer.
2. Navigate to the pd/src/ directory on your system.
3. Open m_pd.h in a text editor (file type is: C/C++ header).
b. Select all (Ctrl+A).
c. Copy selection to the clipboard (Ctrl+C).
d. Back in Visual C++, open the New File window (Ctrl+N).
e. In the Categories pane, select General.
f. In the Templates pane, select Text File, and click Open.
g. Copy the contents of m_pd.h into the editor window (Ctrl+V).
h. Open the Save File As Window (Ctrl+S).
i. Save as m_pd.h.
j. From the File Menu, select Move m_pd.h into; select helloworld.
5. Write the source code for the external in C.
a. Open the New File window (Ctrl+N).
b. In the Categories pane, select General.
c. In the Templates pane, select Text File, and click Open.
d. Write your source code in the editor window.
The following example is taken from the tutorial by Johannes M. Zmoelnig.
#include "m_pd.h"
static t_class *helloworld_class;
typedef struct _helloworld {
t_object x_obj;
} t_helloworld;
void helloworld_bang(t_helloworld *x)
{
post("Hello world !!");
}
void *helloworld_new(void)
{
t_helloworld *x = (t_helloworld *)pd_new(helloworld_class);
return (void *)x;
}
void helloworld_setup(void) {
helloworld_class = class_new(gensym("helloworld"),
(t_newmethod)helloworld_new,
0, sizeof(t_helloworld),
CLASS_DEFAULT, 0);
class_addbang(helloworld_class, helloworld_bang);
}
6. Save and import the source code into the project:
a. Open the Save File As Window (Ctrl+S).
b. Save as helloworld.c.
c. From the File Menu, select Move helloworld.c into; select helloworld.
7. Access the pd library file:
a. Open Windows Explorer or My Computer.
b. Navigate to the pd/bin/ directory on your system.
c. Right-click on pd.lib (file type is: Object File Library) and select Copy.
d. Navigate to the C://TEMP/ directory on your system.
e. Paste the copy of pd.lib in the C://TEMP/ directory (right-click or Ctrl-V).
8. Set configuration properties:
a. Set configuration type to .dll:
1. Back in Visual C++, open the helloworld Property Pages window (Alt+F7).
2. In the left pane, select Configuration Properties >> General.
3. In the right pane, under Project Defaults, click on
Configuration Type, and select Dynamic Library (.dll)
(using the arrow on the right).
b. Add MSW to preprocessor definitions:
1. In the left pane, select
Configuration Properties >> C/C++ >> Preprocessor.
2. In the right pane, type MSW in the Preprocessor Definitions field.
c. Tell compiler which language to use:
1. In the left pane, select
Configuration Properties >> C/C++ >> Advanced.
2. In the right pane, select Compile As.
3. Select Compile as C Code (/TC) by clicking the arrow on the right.
d. Tell linker where to find pd.lib:
1. In the left pane, select Configuration Properties >> Linker >> Input.
2. In the right pane, select Additional Dependencies and enter
C://TEMP/pd.lib.
e. Tell linker to export the setup function:
1. In the left pane, select
Configuration Properties >> Linker >> Command Line.
2. In the right pane, type
/export:helloworld_setup in the Additional options field.
3. Click OK.
9. Compile and link:
a. Use the Build Solution command (F7).
10. Copy the new helloworld.dll file into pd.
a. Open Windows Explorer or My Computer.
b. Navigate to the
My Documents/Visual Studio 2005/Projects/helloworld/Debug/
directory on your system.
c. Right-click on helloworld.dll (file type is: Application Extension)
and select Copy.
d. Navigate to the pd/extra directory on your system.
e. Paste the copy of helloworld.dll in the pd/extra directory
(right-click or Ctrl-V).
11. Test the external in pd.
a. the external should now be a useable object in pd.
b. open a new pd patch and try to create a helloworld object.
c. add a bang to the left inlet and test it out.
d. if the main pd console window displays "Hello world !!",
the external has succeeded.
Hope this helps!
-- middlepedal
Problem compiling external on Windows
I'm having trouble getting the helloworld external to compile properly on Windows.
The main resource is apparently this: HOWTO write an External for puredata, and some previous posts on this topic are here: Compiling new external, Max/MSP microtuning externals to convert to pd
Bear with me, because working with the C compiler is still rather mysterious to me, so I may be making some obvious mistakes. I've installed the djgpp compiler, and followed all the instructions as best as I could. I'm working on XP. I put "m_pd.h" (from the pd/src/ folder) and "helloworld.c" in the same folder and from that directory on the command line (in a DOS "Command Prompt" window) typed:
gcc -c helloworld.c -o helloworld.o
As far as I can tell, this successfully produced the "helloworld.o" object file in the same directory as the "helloworld.c" file. Then I typed:
ld -export_dynamic -shared -o helloworld.dll helloworld.o -lc -lm
Which, as I understand, is the "linking" step, and the only difference between this command and the command for linux is that ".pd_linux" is replaced with ".dll". Anyway, the compiler responded with:
c:/progra~1/djgpp/bin/ld.exe: -shared not supported
So, not having any other ideas, I tried omitting the -shared flag:
ld -export_dynamic -o helloworld.dll helloworld.o -lc -lm
That produced this response:
c:/progra~1/djgpp/bin/ld.exe: warning: cannot find entry symbol xport_dynamic; defaulting to 000018d0
helloworld.o:helloworld.c:(.text+0x1e): undefined reference to `post'
helloworld.o:helloworld.c:(.text+0x37): undefined reference to `pd_new'
helloworld.o:helloworld.c:(.text+0x60): undefined reference to `gensym'
helloworld.o:helloworld.c:(.text+0x79): undefined reference to `class_new'
helloworld.o:helloworld.c:(.text+0x96): undefined reference to `class_addbang'
Why is -shared not supported and what can I do to fix that? I tried Microsoft Visual C++ Express Edition, but found the interface bewildering. I don't think I could even find the words "compile" and "link" in any menu...
Then I looked in the "0.README" file located in the pd/doc/6.externs/ directory, and found this line (in reference to the 3 example enternals in that folder):
To compile, type "make pd_linux", "nmake pd_nt", "make pd_irix5" or "make pd_irix6".
If I wanted to compile these, where would I even type this? Is "nmake" an actual command?
Then I tried poking around the GNU info files, and saw some vague information about "binutils" and "dlltool" but it is so beyond me right now that I'm turning here. Could someone please enumerate the steps required to take the C source file "helloworld.c" and make it into a usable object in pd without skipping any steps? I (and I'm sure many others) would greatly appreciate that.
Thanks in advance!
Compiling new external
i have similar problem, like your suggest i try to compile and the message that return to me is this: (i have ubuntu 7.04)
viniciolindo@ASUSPRO70V:~/pd-wii$ sudo gcc -c wiimote.c -o wiimote.o
wiimote.c:24:19: error: stdio.h: Nessun file o directory
wiimote.c:25:20: error: unistd.h: Nessun file o directory
wiimote.c:26:24: error: sys/select.h: Nessun file o directory
wiimote.c:27:33: error: bluetooth/bluetooth.h: Nessun file o directory
wiimote.c:29:18: error: math.h: Nessun file o directory
wiimote.c:31:21: error: wiimote.h: Nessun file o directory
wiimote.c:47: error: expected specifier-qualifier-list before 'wiimote_t'
wiimote.c: In function 'wiimote_debug':
wiimote.c:89: error: 't_wiimote' has no member named 'connected'
wiimote.c:89: error: 't_wiimote' has no member named 'wiimoteID'
wiimote.c:90: error: 't_wiimote' has no member named 'wiimoteID'
wiimote.c:91: error: 't_wiimote' has no member named 'toggle_acc'
wiimote.c:93: error: 't_wiimote' has no member named 'toggle_ir'
wiimote.c:95: error: 't_wiimote' has no member named 'toggle_nc'
wiimote.c:98: error: 't_wiimote' has no member named 'acc_zero'
wiimote.c:98: error: 't_wiimote' has no member named 'acc_zero'
wiimote.c:98: error: 't_wiimote' has no member named 'acc_zero'
wiimote.c:98: error: 't_wiimote' has no member named 'acc_one'
wiimote.c:98: error: 't_wiimote' has no member named 'acc_one'
wiimote.c:98: error: 't_wiimote' has no member named 'acc_one'
wiimote.c:99: error: 't_wiimote' has no member named 'nc_acc_zero'
wiimote.c:99: error: 't_wiimote' has no member named 'nc_acc_zero'
wiimote.c:99: error: 't_wiimote' has no member named 'nc_acc_zero'
wiimote.c:99: error: 't_wiimote' has no member named 'nc_acc_one'
wiimote.c:99: error: 't_wiimote' has no member named 'nc_acc_one'
wiimote.c:99: error: 't_wiimote' has no member named 'nc_acc_one'
wiimote.c: At top level:
wiimote.c:107: warning: 'struct wiimote_btn_mesg' declared inside parameter list
wiimote.c:107: warning: its scope is only this definition or declaration, which is probably not what you want
wiimote.c: In function 'wiimote_btn':
wiimote.c:110: error: 't_wiimote' has no member named 'btn_atoms'
wiimote.c:110: error: 't_wiimote' has no member named 'btn_atoms'
wiimote.c:110: error: dereferencing pointer to incomplete type
wiimote.c:111: error: 't_wiimote' has no member named 'btn_atoms'
wiimote.c:111: error: 't_wiimote' has no member named 'btn_atoms'
wiimote.c:111: error: dereferencing pointer to incomplete type
wiimote.c:112: error: 't_wiimote' has no member named 'outlet_btn'
wiimote.c:112: error: 't_wiimote' has no member named 'btn_atoms'
wiimote.c: At top level:
wiimote.c:128: warning: 'struct wiimote_acc_mesg' declared inside parameter list
wiimote.c: In function 'wiimote_acc':
wiimote.c:130: error: 't_wiimote' has no member named 'toggle_acc'
wiimote.c:134: error: dereferencing pointer to incomplete type
wiimote.c:134: error: 't_wiimote' has no member named 'acc_zero'
wiimote.c:134: error: 't_wiimote' has no member named 'acc_one'
wiimote.c:134: error: 't_wiimote' has no member named 'acc_zero'
wiimote.c:135: error: dereferencing pointer to incomplete type
wiimote.c:135: error: 't_wiimote' has no member named 'acc_zero'
wiimote.c:135: error: 't_wiimote' has no member named 'acc_one'
wiimote.c:135: error: 't_wiimote' has no member named 'acc_zero'
wiimote.c:136: error: dereferencing pointer to incomplete type
wiimote.c:136: error: 't_wiimote' has no member named 'acc_zero'
wiimote.c:136: error: 't_wiimote' has no member named 'acc_one'
wiimote.c:136: error: 't_wiimote' has no member named 'acc_zero'
wiimote.c:147: error: 't_wiimote' has no member named 'acc_atoms'
wiimote.c:147: error: 't_wiimote' has no member named 'acc_atoms'
wiimote.c:148: error: 't_wiimote' has no member named 'acc_atoms'
wiimote.c:148: error: 't_wiimote' has no member named 'acc_atoms'
wiimote.c:149: error: 't_wiimote' has no member named 'acc_atoms'
wiimote.c:149: error: 't_wiimote' has no member named 'acc_atoms'
wiimote.c:150: error: 't_wiimote' has no member named 'outlet_acc'
wiimote.c:150: error: 't_wiimote' has no member named 'acc_atoms'
wiimote.c: At top level:
wiimote.c:155: warning: 'struct wiimote_ir_mesg' declared inside parameter list
wiimote.c: In function 'wiimote_ir':
wiimote.c:159: error: 't_wiimote' has no member named 'toggle_ir'
wiimote.c:162: error: 'WIIMOTE_IR_SRC_COUNT' undeclared (first use in this function)
wiimote.c:162: error: (Each undeclared identifier is reported only once
wiimote.c:162: error: for each function it appears in.)
wiimote.c:164: error: dereferencing pointer to incomplete type
wiimote.c:166: error: 't_wiimote' has no member named 'ir_atoms'
wiimote.c:166: error: 't_wiimote' has no member named 'ir_atoms'
wiimote.c:167: error: 't_wiimote' has no member named 'ir_atoms'
wiimote.c:167: error: 't_wiimote' has no member named 'ir_atoms'
wiimote.c:167: error: dereferencing pointer to incomplete type
wiimote.c:168: error: 't_wiimote' has no member named 'ir_atoms'
wiimote.c:168: error: 't_wiimote' has no member named 'ir_atoms'
wiimote.c:168: error: dereferencing pointer to incomplete type
wiimote.c:169: error: 't_wiimote' has no member named 'ir_atoms'
wiimote.c:169: error: 't_wiimote' has no member named 'ir_atoms'
wiimote.c:169: error: dereferencing pointer to incomplete type
wiimote.c:170: error: 't_wiimote' has no member named 'outlet_ir'
wiimote.c:170: error: 't_wiimote' has no member named 'ir_atoms'
wiimote.c: At top level:
wiimote.c:177: warning: 'struct wiimote_nunchuk_mesg' declared inside parameter list
wiimote.c: In function 'wiimote_nunchuk':
wiimote.c:181: error: dereferencing pointer to incomplete type
wiimote.c:181: error: 't_wiimote' has no member named 'nc_acc_zero'
wiimote.c:181: error: 't_wiimote' has no member named 'nc_acc_one'
wiimote.c:181: error: 't_wiimote' has no member named 'nc_acc_zero'
wiimote.c:182: error: dereferencing pointer to incomplete type
wiimote.c:182: error: 't_wiimote' has no member named 'nc_acc_zero'
wiimote.c:182: error: 't_wiimote' has no member named 'nc_acc_one'
wiimote.c:182: error: 't_wiimote' has no member named 'nc_acc_zero'
wiimote.c:183: error: dereferencing pointer to incomplete type
wiimote.c:183: error: 't_wiimote' has no member named 'nc_acc_zero'
wiimote.c:183: error: 't_wiimote' has no member named 'nc_acc_one'
wiimote.c:183: error: 't_wiimote' has no member named 'nc_acc_zero'
wiimote.c:194: error: dereferencing pointer to incomplete type
wiimote.c:194: error: 'WIIMOTE_NUNCHUK_BTN_C' undeclared (first use in this function)
wiimote.c:195: error: dereferencing pointer to incomplete type
wiimote.c:195: error: 'WIIMOTE_NUNCHUK_BTN_Z' undeclared (first use in this function)
wiimote.c:196: error: 't_wiimote' has no member named 'outlet_nc_btn'
wiimote.c:196: error: dereferencing pointer to incomplete type
wiimote.c:198: error: 't_wiimote' has no member named 'nc_acc_atoms'
wiimote.c:198: error: 't_wiimote' has no member named 'nc_acc_atoms'
wiimote.c:199: error: 't_wiimote' has no member named 'nc_acc_atoms'
wiimote.c:199: error: 't_wiimote' has no member named 'nc_acc_atoms'
wiimote.c:200: error: 't_wiimote' has no member named 'nc_acc_atoms'
wiimote.c:200: error: 't_wiimote' has no member named 'nc_acc_atoms'
wiimote.c:201: error: 't_wiimote' has no member named 'outlet_nc_acc'
wiimote.c:201: error: 't_wiimote' has no member named 'nc_acc_atoms'
wiimote.c:203: error: 't_wiimote' has no member named 'nc_stick_atoms'
wiimote.c:203: error: 't_wiimote' has no member named 'nc_stick_atoms'
wiimote.c:203: error: dereferencing pointer to incomplete type
wiimote.c:204: error: 't_wiimote' has no member named 'nc_stick_atoms'
wiimote.c:204: error: 't_wiimote' has no member named 'nc_stick_atoms'
wiimote.c:204: error: dereferencing pointer to incomplete type
wiimote.c:205: error: 't_wiimote' has no member named 'outlet_nc_stick'
wiimote.c:205: error: 't_wiimote' has no member named 'nc_stick_atoms'
wiimote.c: At top level:
wiimote.c:219: warning: 'union wiimote_mesg' declared inside parameter list
wiimote.c: In function 'wiimote_callback':
wiimote.c:223: error: dereferencing pointer to incomplete type
wiimote.c:224: error: 'WIIMOTE_MESG_STATUS' undeclared (first use in this function)
wiimote.c:225: error: dereferencing pointer to incomplete type
wiimote.c:225: error: 'WIIMOTE_BATTERY_MAX' undeclared (first use in this function)
wiimote.c:226: error: dereferencing pointer to incomplete type
wiimote.c:227: error: 'WIIMOTE_EXT_NONE' undeclared (first use in this function)
wiimote.c:230: error: 'WIIMOTE_EXT_NUNCHUK' undeclared (first use in this function)
wiimote.c:232: error: 't_wiimote' has no member named 'wiimote'
wiimote.c:232: error: 'WIIMOTE_RW_REG' undeclared (first use in this function)
wiimote.c:232: error: 'WIIMOTE_RW_DECODE' undeclared (first use in this function)
wiimote.c:236: error: 't_wiimote' has no member named 'nc_acc_zero'
wiimote.c:237: error: 't_wiimote' has no member named 'nc_acc_zero'
wiimote.c:238: error: 't_wiimote' has no member named 'nc_acc_zero'
wiimote.c:239: error: 't_wiimote' has no member named 'nc_acc_one'
wiimote.c:240: error: 't_wiimote' has no member named 'nc_acc_one'
wiimote.c:241: error: 't_wiimote' has no member named 'nc_acc_one'
wiimote.c:244: error: 'WIIMOTE_EXT_CLASSIC' undeclared (first use in this function)
wiimote.c:247: error: 'WIIMOTE_EXT_UNKNOWN' undeclared (first use in this function)
wiimote.c:252: error: 'WIIMOTE_MESG_BTN' undeclared (first use in this function)
wiimote.c:253: error: dereferencing pointer to incomplete type
wiimote.c:255: error: 'WIIMOTE_MESG_ACC' undeclared (first use in this function)
wiimote.c:256: error: dereferencing pointer to incomplete type
wiimote.c:258: error: 'WIIMOTE_MESG_IR' undeclared (first use in this function)
wiimote.c:259: error: dereferencing pointer to incomplete type
wiimote.c:261: error: 'WIIMOTE_MESG_NUNCHUK' undeclared (first use in this function)
wiimote.c:262: error: dereferencing pointer to incomplete type
wiimote.c:264: error: 'WIIMOTE_MESG_CLASSIC' undeclared (first use in this function)
wiimote.c: At top level:
wiimote.c:272: warning: 'union wiimote_mesg' declared inside parameter list
wiimote.c: In function 'wiimote_callback_0':
wiimote.c:272: warning: passing argument 2 of 'wiimote_callback' from incompatible pointer type
wiimote.c: At top level:
wiimote.c:273: warning: 'union wiimote_mesg' declared inside parameter list
wiimote.c: In function 'wiimote_callback_1':
wiimote.c:273: warning: passing argument 2 of 'wiimote_callback' from incompatible pointer type
wiimote.c: At top level:
wiimote.c:274: warning: 'union wiimote_mesg' declared inside parameter list
wiimote.c: In function 'wiimote_callback_2':
wiimote.c:274: warning: passing argument 2 of 'wiimote_callback' from incompatible pointer type
wiimote.c: At top level:
wiimote.c:275: warning: 'union wiimote_mesg' declared inside parameter list
wiimote.c: In function 'wiimote_callback_3':
wiimote.c:275: warning: passing argument 2 of 'wiimote_callback' from incompatible pointer type
wiimote.c: At top level:
wiimote.c:276: warning: 'union wiimote_mesg' declared inside parameter list
wiimote.c: In function 'wiimote_callback_4':
wiimote.c:276: warning: passing argument 2 of 'wiimote_callback' from incompatible pointer type
wiimote.c: At top level:
wiimote.c:277: warning: 'union wiimote_mesg' declared inside parameter list
wiimote.c: In function 'wiimote_callback_5':
wiimote.c:277: warning: passing argument 2 of 'wiimote_callback' from incompatible pointer type
wiimote.c: At top level:
wiimote.c:278: warning: 'union wiimote_mesg' declared inside parameter list
wiimote.c: In function 'wiimote_callback_6':
wiimote.c:278: warning: passing argument 2 of 'wiimote_callback' from incompatible pointer type
wiimote.c: At top level:
wiimote.c:279: warning: 'union wiimote_mesg' declared inside parameter list
wiimote.c: In function 'wiimote_callback_7':
wiimote.c:279: warning: passing argument 2 of 'wiimote_callback' from incompatible pointer type
wiimote.c: In function 'wiimote_setReportMode':
wiimote.c:292: error: 'WIIMOTE_RPT_STATUS' undeclared (first use in this function)
wiimote.c:292: error: 'WIIMOTE_RPT_BTN' undeclared (first use in this function)
wiimote.c:293: error: 't_wiimote' has no member named 'toggle_ir'
wiimote.c:293: error: 'WIIMOTE_RPT_IR' undeclared (first use in this function)
wiimote.c:294: error: 't_wiimote' has no member named 'toggle_acc'
wiimote.c:294: error: 'WIIMOTE_RPT_ACC' undeclared (first use in this function)
wiimote.c:295: error: 't_wiimote' has no member named 'toggle_nc'
wiimote.c:295: error: 'WIIMOTE_RPT_EXT' undeclared (first use in this function)
wiimote.c:298: error: 't_wiimote' has no member named 'connected'
wiimote.c:300: error: 't_wiimote' has no member named 'wiimote'
wiimote.c:300: error: 'WIIMOTE_CMD_RPT_MODE' undeclared (first use in this function)
wiimote.c: In function 'wiimote_reportAcceleration':
wiimote.c:308: error: 't_wiimote' has no member named 'toggle_acc'
wiimote.c: In function 'wiimote_reportIR':
wiimote.c:314: error: 't_wiimote' has no member named 'toggle_ir'
wiimote.c: In function 'wiimote_reportNunchuck':
wiimote.c:320: error: 't_wiimote' has no member named 'toggle_nc'
wiimote.c: In function 'wiimote_setRumble':
wiimote.c:326: error: 't_wiimote' has no member named 'connected'
wiimote.c:328: error: 't_wiimote' has no member named 'wiimote'
wiimote.c:328: error: 'WIIMOTE_CMD_RUMBLE' undeclared (first use in this function)
wiimote.c: In function 'wiimote_setLED':
wiimote.c:339: error: 't_wiimote' has no member named 'connected'
wiimote.c:341: error: 't_wiimote' has no member named 'wiimote'
wiimote.c:341: error: 'WIIMOTE_CMD_LED' undeclared (first use in this function)
wiimote.c: In function 'wiimote_doConnect':
wiimote.c:361: error: 'bdaddr_t' undeclared (first use in this function)
wiimote.c:361: error: expected ';' before 'bdaddr'
wiimote.c:364: error: 'bdaddr' undeclared (first use in this function)
wiimote.c:364: error: 'BDADDR_ANY' undeclared (first use in this function)
wiimote.c:369: error: 't_wiimote' has no member named 'wiimote'
wiimote.c:370: error: 't_wiimote' has no member named 'wiimoteID'
wiimote.c:374: error: 't_wiimote' has no member named 'wiimote'
wiimote.c:375: error: 't_wiimote' has no member named 'wiimoteID'
wiimote.c:379: error: 't_wiimote' has no member named 'wiimote'
wiimote.c:380: error: 't_wiimote' has no member named 'wiimoteID'
wiimote.c:384: error: 't_wiimote' has no member named 'wiimote'
wiimote.c:385: error: 't_wiimote' has no member named 'wiimoteID'
wiimote.c:389: error: 't_wiimote' has no member named 'wiimote'
wiimote.c:390: error: 't_wiimote' has no member named 'wiimoteID'
wiimote.c:394: error: 't_wiimote' has no member named 'wiimote'
wiimote.c:395: error: 't_wiimote' has no member named 'wiimoteID'
wiimote.c:399: error: 't_wiimote' has no member named 'wiimote'
wiimote.c:400: error: 't_wiimote' has no member named 'wiimoteID'
wiimote.c:404: error: 't_wiimote' has no member named 'wiimote'
wiimote.c:405: error: 't_wiimote' has no member named 'wiimoteID'
wiimote.c:413: error: 't_wiimote' has no member named 'wiimote'
wiimote.c:417: error: 't_wiimote' has no member named 'wiimote'
wiimote.c:417: error: 'WIIMOTE_RW_EEPROM' undeclared (first use in this function)
wiimote.c:420: error: 't_wiimote' has no member named 'acc_zero'
wiimote.c:421: error: 't_wiimote' has no member named 'acc_zero'
wiimote.c:422: error: 't_wiimote' has no member named 'acc_zero'
wiimote.c:423: error: 't_wiimote' has no member named 'acc_one'
wiimote.c:424: error: 't_wiimote' has no member named 'acc_one'
wiimote.c:425: error: 't_wiimote' has no member named 'acc_one'
wiimote.c:428: error: 't_wiimote' has no member named 'connected'
wiimote.c: In function 'wiimote_discover':
wiimote.c:441: error: 't_wiimote' has no member named 'connected'
wiimote.c: In function 'wiimote_doDisconnect':
wiimote.c:449: error: 't_wiimote' has no member named 'connected'
wiimote.c:451: error: 't_wiimote' has no member named 'wiimote'
wiimote.c:454: error: 't_wiimote' has no member named 'wiimoteID'
wiimote.c:455: error: 't_wiimote' has no member named 'connected'
wiimote.c: In function 'wiimote_new':
wiimote.c:466: error: 'bdaddr_t' undeclared (first use in this function)
wiimote.c:466: error: expected ';' before 'bdaddr'
wiimote.c:471: error: 't_wiimote' has no member named 'outlet_btn'
wiimote.c:472: error: 't_wiimote' has no member named 'outlet_acc'
wiimote.c:473: error: 't_wiimote' has no member named 'outlet_ir'
wiimote.c:474: error: 't_wiimote' has no member named 'outlet_nc_btn'
wiimote.c:475: error: 't_wiimote' has no member named 'outlet_nc_acc'
wiimote.c:476: error: 't_wiimote' has no member named 'outlet_nc_stick'
wiimote.c:479: error: 't_wiimote' has no member named 'toggle_acc'
wiimote.c:480: error: 't_wiimote' has no member named 'toggle_ir'
wiimote.c:481: error: 't_wiimote' has no member named 'toggle_nc'
wiimote.c:483: error: 't_wiimote' has no member named 'connected'
wiimote.c:484: error: 't_wiimote' has no member named 'wiimoteID'
can you help me? sorry for my english
Clearing delay lines
you might need to use a set up that involves using two (or more) separate delay lines and swapping back and forth between them at the moment you want to 'clean' the delay. here's how it would work:
assume two delwrite~ obects with delay lines named a and b. matching these two delwrite~s are two delread~s. each of these four objects can be 'turned on' or 'muted' (using the method supplied above by giair). muting a delwrite~ object technically means muting the audio going into to the object.
the initial state of the patch would [delwrite~ a] and [delread~ a] turned on and [delwrite~ b] and [delread~ b] muted. when you want to clear the delay line, you would mute [delwrite~ a] and [delread~ a]. at that point you can turn on the 'b' delay line objects. you can switch back and forth between your two delay lines cleanly if you wait an amount of time greater than the length of the delay.
in the case that your delay time is longer than the time you want to wait, you would have to use another delay line. the downside of this is that the control gets a little bit more complicated. if this is something you might apply, check miller puckette's book (pdf available on his website i think) and look at the chapter on polyphonic synthesizers. polyphonic synths require some form of voice allocation and you might be able to use some of pd's voice allocation support to help manage your delay lines, because it is a fairly similar process.
i hope this made sense. i don't think it's as confusing as it sounds, but it is hard to put into words. if you understand what i mean, but aren't sure how to implement it, i could probably post an example; just let me know.
--zac