Motion detection direction
Easy enough.
all you have to do is store the direction as an value. (for mega-complex patches you could probably get away with creating a variable (direction) and reading from that all the time, since we are using a few storage objects for the same process now)
Then bang the _storage object when appropriate (when coordinate 2 has been triggered) for a reading and if the reading reads 1 do something, or 0, do something else.
Control analog sensor data in PD?
damn godinpants, that was exactly what i needed!! damn i'm excited now, its starting to work out! i also divided the soundfiler info by 100 and multiplied it to the signal before the [pack 0 100]. that made sure it worked for the full sound file instead of just 0-44100.
i have two sensors. one sensor is the scratcher: the soundfile is played fast/slow depending on how fast i move an object closer to the sensor. I dont know if that makes sense. is it possible to have the other sensor slow down the speed of the playback??
for instance, i have a 10 second file. i made the vertical slider range from 20-100 because that's the range the signal is clearest. if i move my hand slowly closer to the sensor, the 10 second sound file plays forward. i want the other sensor to "zoom" into the vertical slider and make, for instance, the 20-30 range the range that the 1st-scratcher-sensor is working with. if my left hand is using the 2nd "zoom" sensor, and my right hand is using the 1st "scratcher" sensor, my left hand will pinpoint a section of the sound file that i want my right hand, the scratcher, to play back and forth.
Whats the best way to do that? (sorry for the long detailed messages, i just try to make sure you guys understand my situation)
Control analog sensor data in PD?
Hi! There is so much documentation online, but i still cant seem to figure this out:
I have a sharp gp2d120 sensor hooked up to my arduino. The arduino has firmata 2.0 installed so that it can communicate to PD (using pduino). I am getting a steady stream of voltage data from the sensor (as you can see from the the 4th analog pin in the screenshot). I'm trying to figure out how i can turn this data into something i can work with. Or maybe i need to learn how to work with it. Ultimately i want to control the frequency of a sound file based on the voltage output of the sensor (which is relative to the proximity of an object to the sensor).
So how can i convert this analog data into something i can work with (some data type that i can [delay] and that i can output to [dac~]? Do i need to use [mtof] to convert it to frequency? Do i need to turn it into a MIDI device somehow? [ctlin]? [tabread4]? These are just some objects that have come up after i searched for solutions, but i don't know how to execute it all.
side note: is it possible to set the sample rate of arduino in PD? the sensor works best with 10ms intervals between each sample.
PD with arduino and IR sensors
@lunchbox said:
is there any differences between the firmata and the simple messaging system? I'm also working with IR sensors, arduino connected to PD, and i need to read inputs from the arduino, so which external is better? I've tried the firmata, it works well, but i still don't get how this external works...
Yep, there is a difference. The difference is that firmata is designed to let everything happen in software, rather then on the arduino (see my attached example on the other post for an example of how to read your IR sensors)
Better is subjective. I like Pd coding better, so I use pduino and firmata.
So, to recap, burn firmata standard on your arduino, use Pduino, and code the app in pd, for easy, graphical, dynamic programming (pd-style) otherwise, interpret the messages in some other format, and do it some other way. It's up to you.
My attached example is definitely the easiest way to achieve your goals, in my opinion. You get the bonus of having pretty simple conversion from Arduino-languuage examples into pd-friendly code, rather then using some intermediary language that you have to code for on both ends (arduino interprets inputs, emits OSC or something else on serial, pd interprets OSC or something else and does stuff, blech!) instead you can just route incoming messages in pd, the same way you would with midi, a joystick, keys, or whatever.
Once you get pduino all setup, and my above patch works, try right-clicking on Pduino object, and choosing help. It actually has a pretty nice help file, which is how I figured all this out.
Knobs and sliders NDS
i don't know if anybody here has played with this at all but
http://mccormick.cx/projects/KnobsAndSlidersDS/page/download
i wanted to get in touch with the guy that did this and i can't seem to find any way to do that it looks like "obi" may have helped with the midi jammer by lending materiel or something
anyway i want to add more objects that are available to put onto the ds
now before i would have just posted this and hoped somebody knew what was going on
but i actually went into the source code and tried to figure it out
i tried to add a button but i couldn't quite get it to work
so thats why i wanted to get in touch with him or her
i have been playing with this quite a bit here is how i have it set up
macbook=>airport sharing=>NDS=>MIDIWIFI=>MIDIpipe=>battery 3
i have a screen set up taking up almost the whole ds touch screen
and 128 toggles its really wonderful to play with
i have also set up the sliders and knobs
with one patch there is something like 178 midi objects on the ds screen
but i would rather be using a bng instead of a toggle at least when using battery
maybe something where you could give an x y range that would make a box and inside the box you could get the touch screen information ala fudikaos
and also im not sure if its possible but having something like a matrix or patchbay that could be plugged in from one to another something along these lines maybe http://www.machinecollective.org/
so if anybody would know anything about how to do this i would love a push in the right direction whether it be coding help or contact info it would be greatly appreciated
Paul
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
Framenumber to timecode conversion
Hello,
please excuse my stupidity both in programming and generally in understanding PD. i've been trying to figure a way to convert a frame number (received with OSC) to a timecode but the code i tried to adapt from a matlab script by Malcolm A. MacIver that i found here http://www.mathworks.com/matlabcentral/fileexchange/loadFile.do?objectId=1116&objectType=File
involves some for...loop and i dont know how to do the same in PD... can anyone explain, please?
i guess the field part of the smpte timcode (and other bits of information) are usually not needed, for most people HH:MM:SS:FF Information will be ok... maybe with an adjustable framerate between 30 (ntsc) and 25 (pal)
greetings,
till
function smpte = dec2smpte(init, framecount, field)
% convert the smpte time from the total elapsed frames and field as an integer
% to the new smpte time
first_field=init(9);
weight=[1080000 108000 18000 1800 300 30 10 1];
ns=[];
remain=framecount;
for i=1:8
ns(i)=floor(remain/weight(i));
remain=remain- (ns(i)*weight(i));
end
if strcmp(first_field,':')
second_field='.';
else
second_field=':';
end
if field==1
field_flag=first_field;
else
field_flag=second_field;
end
smpte=[ ...
num2str(ns(1)) num2str(ns(2)) ':' ...
num2str(ns(3)) num2str(ns(4)) ':' ...
num2str(ns(5)) num2str(ns(6)) field_flag ...
num2str(ns(7)) num2str(ns(8))];
different approach here
function itc (int "framecount", float "rate", bool "ms")
{
rate=default(rate,25)
ms = default(ms, false)
drop = (rate==29.97)? true : false
rate2 = (drop==true)? 30 : rate
hours=floor((framecount/rate)/3600)%60
mins=floor((framecount/rate)/60.0)%60
secs=floor(framecount/rate)%60
milli=floor(1000*framecount/rate)%6000%1000
fmilli=framecount/rate - floor(framecount/rate)
#frames=floor(fmilli*rate2)
frames=framecount%int(rate)
dframes = (drop==false)? frames : (secs==0)&&(mins%10!=0)? floor(fmilli*rate2) + 2 : frames
return (ms==false)? (string(hours,"%02.0f")+":"+string(mins,"%02.0f")+":"+string(secs,"%02.0f")+":"+string(frames,"%02.0f")) :
\ (string(hours,"%02.0f")+":"+string(mins,"%02.0f")+":"+string(secs,"%02.0f")+":"+string(milli,"%03.0f"))
}
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
Just tried pd but....
> yes, probably. but now I'll try to run it on my Atari ST
Seriously try it if you get time one day. Oddly the Atari ST is still *THE* choice for some serious techno musicians. Why? The simplicity of how the UART is addressed and clocked gives it rock solid midi timing. It's something that seems to elude complex architectures even with the best preemptive scheduling, buffering etc. I've watched top producers take a midi file on floppy disk from their $5000 super Mac/PC systems to have it play back on an Atari for final mixdown. It's one of those analog vs digital type debacles where real experience of good ears trumps what "technically shouldn't be so". The ST lacks enough grunt for useful audio DSP, but as a midi processing hub or sequencer it could be an astonishingly powerful tool with pd if you can compile it.
>mhh... this is just a anthropomorphic vision of reality...
You got me.
>what I need to ask now is where I can find reference for all objects:
>I know that there's no menu of them and i have to type their name in those little boxes, but
>I need to know, at least, what objects I can create, typing their names, is it true?
Yeah that bothers me too. Even after using for it some time I forget the name of an atom and have to go looking for it. I often do something like "ls /usr/lib/pd/externs/ | grep pd_linux$ | less" to see if I actually have something. For windows likewise search the externals directory for .dll files
>so, I would like to have a list with the object identifier (for oscs, filters etc.), their
>details (kind of filters, slopes, ripples etc. for filters, as example ), their parameters (cutoff, Q, etc.)
>is there a documentation like this?
The help files are detailed, well written and easy to use. Once you know that such an object exists. Just right click any atom and select "help". Usually there's an example case.
Check these to find common atoms
http://puredata.hurleur.com/sujet-248-suggestions-noobs
http://ccrma.stanford.edu/courses/154/pd-reference.html
http://pure-data.sourceforge.net/documentation.php
>I know... but I still feel more confortable with a traditional language (C++, pascal), also
>for writing my personal VSTs (you know, for those weirdest things...) I think it's still easier to write "algorithms" with a textual language,
>without a graphical metaphore.
Raw code is not an expedient or practical way to make music. Having used Music(N), Csound, Nyquist (LISP/SCHEME), and all that stuff I can say this from the bottom of my heart after 15 years experience. Pd gives you two really important things from a software engineering point of view. It's modularity and clarity of interface in abstracting things just beats any C++ classes hands down for it's intended purpose - digital signal dataflows. Consequently you get better decoupling and better reuse. One of the few pitfalls for a trad programmer imho is that pd is very dirty on types, in a way it's one of the most badly typed languages I've ever experienced. Ironic for a tool called "pure data", but you get used to it's lovable idiosynchrocies vis lists, messages, numbers, arrays, symbols and generic "anys". Also it's scoping rules leave a lot to be desired, everythings global within one instance of the server unless you say $0- at the head of a name.
>But now I need to teach a course on "languages for electronic music" in classical, academic shool.
>they don't know DSP matchematics or something like,
>so I need to urgently search for use a more "abstract" instrument for doing the lessons...
You couldn't wish for a more appropriate tool. For non maths/physics students you can use the power of abstraction to build "black boxes" like synths, analysis tools and sequencers and then open them up later in the course. As Claude says, it takes about 9 months or more before you really take to PureData. Electronic music is BIG, really big, not as big as space but it's a discipline that just explodes in scope once you get into it. You can waste weeks writing externals in C, or designing a synth, or creating a composition method...you can get really lost on a random walk in d>2. The best way forward is to have a context and a goal. Teaching this course sounds like an excellent vehicle to focus your scope.
>Tried also Jmax but on Windows (required OS, because > 95% students use billgatesware ) is quite unstable
I would make it "unrequired". Put your foot down as course leader/tutor that Windows is unsuitable. In order of preference I would go with Mac, then Linux, then Win. If the students only have Windows then try Dyne:bolic ( http://dynebolic.org/ ), a minimal GNU/Linux distro that runs from a CD in RAM and comes preconfigured with PureData and a smorgasboard of other digital media tools. That said, I've seen it work really well on Windows. Once. I've no hard evidence to back this up, but I feel a disturbance in the force when Pd runs on Windows, as if a million threads cried out at once and were suddenly silenced. I don't think it likes heavily loaded machines and I guess 99% certain the reason it's unstable on Win is down to *other* things running. Hint: a music machine shouldn't double as an email server and GCHQ spyware centre. Start with a clean install and nothing else running and you may have better luck, but that will probably remain stable about as long as a schizophrenic Z-boson particle if you network it.
Play a sample
there seems to be something called [table16] that can read large soundfiles, but it still seems to be the in development stage.
for the moment, the only thing i can suggest is to cut your 20 minute file into 20 x 60 second segments,
and then use something like this:
#N canvas 0 22 751 443 10;
#X obj 114 16 table 0-Right;
#X obj 15 16 table 0-Left;
#X obj 114 36 table 1-Right;
#X obj 15 36 table 1-Left;
#X obj 114 56 table 2-Right;
#X obj 15 56 table 2-Left;
#X obj 114 76 table 3-Right;
#X obj 15 76 table 3-Left;
#X obj 114 96 table 4-Right;
#X obj 15 96 table 4-Left;
#X obj 114 116 table 5-Right;
#X obj 15 116 table 5-Left;
#X obj 114 136 table 6-Right;
#X obj 15 136 table 6-Left;
#X obj 114 156 table 7-Right;
#X obj 15 156 table 7-Left;
#X obj 114 176 table 8-Right;
#X obj 15 176 table 8-Left;
#X obj 114 196 table 9-Right;
#X obj 15 196 table 9-Left;
#X obj 114 216 table 10-Right;
#X obj 15 216 table 10-Left;
#X obj 114 236 table 11-Right;
#X obj 15 236 table 11-Left;
#X obj 114 256 table 12-Right;
#X obj 15 256 table 12-Left;
#X obj 114 276 table 13-Right;
#X obj 15 276 table 13-Left;
#X obj 114 296 table 14-Right;
#X obj 15 296 table 14-Left;
#X obj 114 316 table 15-Right;
#X obj 15 316 table 15-Left;
#X obj 114 336 table 16-Right;
#X obj 15 336 table 16-Left;
#X obj 114 356 table 17-Right;
#X obj 15 356 table 17-Left;
#X obj 114 376 table 18-Right;
#X obj 15 376 table 18-Left;
#X obj 114 396 table 19-Right;
#X obj 15 396 table 19-Left;
#X obj 296 179 soundfiler;
#X msg 296 155 read -resize /AUDIO/$1.wav \$1-Left \$1-Right;
#X obj 296 99 until;
#X obj 296 126 f;
#X obj 322 126 + 1;
#X obj 300 57 t b b;
#X msg 298 80 20;
#X msg 341 99 0;
#X msg 300 34 load audio files;
#X floatatom 298 255 5 0 0 0 - - -;
#X obj 315 278 / 60;
#X obj 316 308 int;
#X floatatom 317 339 5 0 0 0 - - -;
#X msg 314 359 set \$1-Left;
#X obj 296 391 tabread4~;
#X text 340 255 Playing position (seconds);
#X connect 41 0 40 0;
#X connect 42 0 43 0;
#X connect 43 0 44 0;
#X connect 43 0 41 0;
#X connect 44 0 43 1;
#X connect 45 0 46 0;
#X connect 45 1 47 0;
#X connect 46 0 42 0;
#X connect 47 0 43 1;
#X connect 48 0 45 0;
#X connect 49 0 50 0;
#X connect 50 0 51 0;
#X connect 51 0 52 0;
#X connect 52 0 53 0;
#X connect 53 0 54 0;