Playing sound files based on numbers/sets of numbers?
I'm quite new to PD so I'll try to explain this the best I can, hope you'll understand what I mean! I need this for a project, but I feel like it's too complicated for a beginner like me to understand without proper guidance, and I haven't found a tutorial that deals with something like this yet. Please, if you can't help me, maybe you could direct me to a tutorial that deals with the things I need to understand to get this done. Please, you'd help a lot!
So, here it is. Basically, say you type in a set of numbers into a program (Word, for example) and you want to use those numbers to start up certain audio files (via PD) subsequently and then loop the whole thing. Each number corresponds to one audio file, but the files don't play until you hit enter, which is when all the files corresponding to the numbers you typed in should play, in the order in which you typed in the corresponding numbers. Basically, it's supposed to be a melody that sounds differently depending on what numbers/sets of numbers (2, 3 or 4 digit combinations) you typed in before you hit enter, which should work as a "bang" of sorts for the audio files.
Do I even need an external program for this (I'm assuming I do), or could I just be typing numbers with a PD project open and it would still work when I hit enter? If I need another program, how do I connect PD to it and make it play the files based on the numbers I typed in?
Please, if you could offer any advice or direct me to an appropriate tutorial, I would very much appreciate it! I'm very new to this and kind of lost, not sure how to put this idea into words, but I hope you got the gist of it. I realize this might be very complicated for a beginner, but any kind of help is welcome! Thank you very much in advance!
GEM error
I know this has been asked a few hundred thousand times- i know because i've been reading everything i can find. But most of the documentation and posts are apparently outdated, or don't seem to work for me.
I had been learning pure data for a few weeks about a year ago using pd extended, but noticed that the libs haden't been updated for a long time, so when i got back into it yesterday i decided to start with the nonextended version.
At first i didn't realize that Gem isn't a standard library, so downloaded it, installed, eventually found that someone suggested to go to edit/preferences/startup, make a new entry and just type "gem" and add it. I did that, restarted. The log window still shows a lot of error messages, it looks like PD is searching for two files:
gem.dll
Gem.m_i386
There are a lot of lines that indicated tried and failed for both, but eventually i see "succeeded" for gem.dll, but not for Gem.m_i386.
Anyway i 'put' an object called gemwin and two messages, create and destroy and link them both to gemwin after creating a new project, then switch to run mode ctrl-e and click on create. Nothing happens. It should make a black, empty gem window, but it doesn't.
In the log window, there are no entries added after clicking on create/destroy, i don't know what i'm doing wrong, can someone suggest what to do?
I've been reading for hours, a lot of pages suggest where to look, but have dead links, or the suggestion didn't help, any ideas?
I pasted below the full startup log (the full log using the "all" option).
Thanks:)
Rob T
------------------ done with main ----------------------
input channels = 2, output channels = 2
Default font: DejaVu Sans Mono
tried ./Gem.m_i386 and failed
tried C:/Users/me/AppData/Roaming/Pd/Gem.m_i386 and failed
tried C:/Program Files (x86)/Common Files/Pd/Gem.m_i386 and failed
tried C:/Program Files (x86)/pd/extra/Gem.m_i386 and failed
tried ./Gem.dll and failed
tried C:/Users/me/AppData/Roaming/Pd/Gem.dll and failed
tried C:/Program Files (x86)/Common Files/Pd/Gem.dll and failed
tried C:/Program Files (x86)/pd/extra/Gem.dll and failed
tried ./Gem/Gem.m_i386 and failed
tried C:/Users/me/AppData/Roaming/Pd/Gem/Gem.m_i386 and failed
tried C:/Program Files (x86)/Common Files/Pd/Gem/Gem.m_i386 and failed
tried C:/Program Files (x86)/pd/extra/Gem/Gem.m_i386 and failed
tried ./Gem/Gem.dll and failed
tried C:/Users/me/AppData/Roaming/Pd/Gem/Gem.dll and failed
tried C:/Program Files (x86)/Common Files/Pd/Gem/Gem.dll and failed
tried C:/Program Files (x86)/pd/extra/Gem/Gem.dll and succeeded
GEM: Graphics Environment for Multimedia
GEM: ver: 0.93.3
GEM: compiled: Nov 10 2011
GEM: maintained by IOhannes m zmoelnig
GEM: Authors : Mark Danks (original version)
GEM: Chris Clepper
GEM: Cyrille Henry
GEM: IOhannes m zmoelnig
GEM: with help by Guenter Geiger, Daniel Heckenberg, James Tittle, Hans-Christoph Steiner, et al.
GEM: found a bug? miss a feature? please report it:
GEM: homepage http://gem.iem.at/
GEM: bug-tracker http://sourceforge.net/projects/pd-gem/
GEM: mailing-list http://lists.puredata.info/listinfo/gem-dev/
GEM: compiled for SIMD architecture: SSE2 MMX
GEM: using SSE2 optimization
The Pd window filtered 40 lines
The Pd window filtered 41 lines```
Variable delay patch - need help
Hi,
The attached patch dsdelay is supposed to be a variable delay line with a moving write point. vd~ uses a moving read point which is acceptable for most applications but not what I am working on. I have implemented my moving write point delay line in MATLAB and it works reasonably well. However I am experiencing issues with PD implementation.
The patch uses a table to store the delay line values and is supposed to use a circular delay line method (i.e. the read/write points shift with time instead of the actual elements of the delay line). The intention is that the read point shifts along the delay line by one sample per sample, and the write point does the same whilst the delay is not being altered. The write point uses a simple two point extrapolation to allow writing at fractional table indices.
I'm having two problems:
1. I can't find a satisfactory method of wrapping signal values in an arbitrary range. I want to be able wrap a signal value between 0 and 44100 for example, but using
|
[/~ 44100]
|
[wrap~]
|
[*~ 44100]
|
gives rise to rounding errors which create artifacts in the output. This is why in the current state, the output is intermittent rather than continuous.
2. For some reason the 2 point extrapolation seems to be not working correctly. I'm getting a ring modulation type effect on the output. In MATLAB the addition of the two point extrapolation helped to minimise artifacts when the delay time was being altered. Altering the delay time gives rise to horrible artifacts at the moment though.
Any pointers on how to get this working properly would be greatly appreciated.
Thanks
Ben
Compiling externals on OSX
Hi, I tried Icoon's and Enrico's methodes but it doesn't work.
I copied the code from Johannes (helloworld) in a new C file in XCode. Then I did what enrico explains ; but when I type "make", the terminal answers a lot of errors. I probably forgot something, but what?
cc -arch i386 -arch ppc -DPD -O2 -Wall -W -Wshadow -Wstrict-prototypes -Wno-unused -Wno-parentheses -Wno-switch -I../../src -o helloworld.o -c helloworld.c
helloworld.c:11:19: error: m_pd.h: No such file or directory
helloworld.c:12: error: syntax error before ‘*’ token
helloworld.c:12: warning: type defaults to ‘int’ in declaration of ‘helloworld_class’
helloworld.c:12: warning: data definition has no type or storage class
helloworld.c:14: error: syntax error before ‘t_object’
helloworld.c:14: warning: no semicolon at end of struct or union
helloworld.c:15: warning: type defaults to ‘int’ in declaration of ‘t_helloworld’
helloworld.c:15: warning: data definition has no type or storage class
helloworld.c:16: error: syntax error before ‘*’ token
helloworld.c:17: warning: function declaration isn’t a prototype
helloworld.c: In function ‘helloworld_bang’:
helloworld.c:18: warning: implicit declaration of function ‘post’
helloworld.c:11:19: error: m_pd.h: No such file or directory
helloworld.c:12: error: syntax error before ‘*’ token
helloworld.c:12: warning: type defaults to ‘int’ in declaration of ‘helloworld_class’
helloworld.c:12: warning: data definition has no type or storage class
helloworld.c:14: error: syntax error before ‘t_object’
helloworld.c:14: warning: no semicolon at end of struct or union
helloworld.c:15: warning: type defaults to ‘int’ in declaration of ‘t_helloworld’
helloworld.c:15: warning: data definition has no type or storage class
helloworld.c:16: error: syntax error before ‘*’ token
helloworld.c:17: warning: function declaration isn’t a prototype
helloworld.c: In function ‘helloworld_new’:
helloworld.c:22: error: ‘x’ undeclared (first use in this function)
helloworld.c:22: error: (Each undeclared identifier is reported only once
helloworld.c:22: error: for each function it appears in.)
helloworld.c:22: error: syntax error before ‘)’ token
helloworld.c: In function ‘helloworld_setup’:
helloworld.c:26: warning: implicit declaration of function ‘class_new’
helloworld.c:26: warning: implicit declaration of function ‘gensym’
helloworld.c:27: error: ‘t_newmethod’ undeclared (first use in this function)
helloworld.c:27: error: syntax error before ‘helloworld_new’
helloworld.c:30: warning: implicit declaration of function ‘class_addbang’
helloworld.c: In function ‘helloworld_bang’:
helloworld.c:18: warning: implicit declaration of function ‘post’
helloworld.c: In function ‘helloworld_new’:
helloworld.c:22: error: ‘x’ undeclared (first use in this function)
helloworld.c:22: error: (Each undeclared identifier is reported only once
helloworld.c:22: error: for each function it appears in.)
helloworld.c:22: error: syntax error before ‘)’ token
helloworld.c: In function ‘helloworld_setup’:
helloworld.c:26: warning: implicit declaration of function ‘class_new’
helloworld.c:26: warning: implicit declaration of function ‘gensym’
helloworld.c:27: error: ‘t_newmethod’ undeclared (first use in this function)
helloworld.c:27: error: syntax error before ‘helloworld_new’
helloworld.c:30: warning: implicit declaration of function ‘class_addbang’
lipo: can't figure out the architecture type of: /var/folders/Wl/WlZVlPp0Hvu7Q99UrPbdWE+++TI/-Tmp-//ccig9hRY.out
make: *** [helloworld.d_fat] Error 1
flaco
Newb needs Help! crash on compute audio.
hello thanks for the info for DIO,
Everytime I click the DIO it gives me a different set of values.
audio I/O error history:
seconds ago error type
1.32 unknown
1.32 unknown
audio I/O error history:
seconds ago error type
1.61 unknown
1.61 unknown
audio I/O error history:
seconds ago error type
2.12 unknown
2.12 unknown
audio I/O error history:
seconds ago error type
2.35 unknown
2.35 unknown
audio I/O error history:
seconds ago error type
2.55 unknown
2.55 unknown
audio I/O error history:
seconds ago error type
2.77 unknown
2.77 unknown
audio I/O error history:
seconds ago error type
2.97 unknown
2.97 unknown
audio I/O error history:
seconds ago error type
3.20 unknown
3.20 unknown
audio I/O error history:
seconds ago error type
4.38 unknown
4.38 unknown
audio I/O error history:
seconds ago error type
5.13 unknown
5.13 unknown
Do you think upgrading to Snow Leopard with help?
thank you for you time
Aqu4
Different ways of Implementing Delay Loops
Ta Toxonic - I'll take a look at the patch tonight. Good of you to take the time. Apologies if I've misunderstood though, but I think what you're describing is not quite what I mean: The pitch shift is separated out from the delay time - you're running a pitch shift effect into a separate delay line, which is not going to give the same effect. The delay time will not shorten as the pitch rises. I'll take a look at your patch tonight though as I may have misunderstood what you're getting at.
Maelstorm - thanks also. I understand why the pitch changes on a delay pedal. The pitchshifter patch was a bit of a red herring - though of course it's the same principle. The difference between what you're (both, I think) talking about and what I'm talking about is the way that the pitch changes.
Assuming a stable C tone playing into the delay:
With the standard simple PD delay set up, if you move the read point of a vd~ then you get a glissando as it accellerates, a constant pitch change as it moves at constant speed. So if you turn the knob to change the delay time in the middle of a tone you start with a constant pitch (C), then get a rise of pitch, then it levels out at a new pitch (as you turn then stop turning the knob),
_
___/
If you feed back into the delay, the glissando is repeated as the read speed changed while the write speed was constant:
_ _ _ _
/ |/ |/ |/ |
The effect I'm looking to emulate on the other hand is more akin to changing the speed of a phasor~ reading an array - the pitch change is not a blip, but a stable interval's transposition - eg: you turn the knob, the pitch of the repeats rise by a given interval and stays at that pitch as it repeats (now more quickly):
______
___/
If you play a constant C tone, then speed up the delay until it is a major third higher, you get a major third diad (until the delay dies away), rather than a C tone with a repeating squiggle overlaid.
The effect is the same as you get by speeding up a tape loop delay (though the pedal I'm trying to imitate is a digital delay) which is why I think the rate of the write and read heads are being increased by the same amount.
[edit, just tried to make this clearer and removed a couple of errors]
Different ways of Implementing Delay Loops
It sounds to me like the problem your having is just a result of feeding back into the pitch shifter (or even using a pitch shifter at all). If you just feed it back into the delay, you should get the effect of a delay pedal. The pitch shifting comes because as you shorten the delay line, the delay playback head moves up the delay line, essentially reading it faster for that moment (or vice versa). And of course, reading it faster causes the pitch to go up. If you feed that back into the delay line, that moment of pitching up will repeat until the delay dies out, and it doesn't keep pitching up with each delay. The record head stays at a constant rate.
Different ways of Implementing Delay Loops
I've been trying to emulate a delay pedal I have, but having no luck.
The effect I'm after is a stable interval's pitch change when you change the delay time - you can tune the sound going around the delay loop up or down by a stable number interval by shortening or lengthening the delay time - just as you could tune sample playback by changing the rate of a phasor~ reading an array.
If I use a vd~ reading from a delay line (as in the rotating tape head pitch shifter example, but with added recirculating feedback) I can get pitch change effects (pretty great pitch change effects tbh) but they're unstable - they keep rising or falling in pitch with each circulation as they get pitch shifted each time they go around the loop.
I figured one way to implement the effect would be to change the write speed and the read speed by the same amount (I'd guess this is how the pedal is doing it)- But I have no idea how to change the delay write speed in PD.
I thought of changing sample rate using block~ in a subpatch with the delay line but that doesn't seem to give the desired results (or in fact any sound at all - so I'm guessing you can't upsample a delay line).
Any ideas???
Saturation
ok, it should be here build/winxp-pd-0.4.03/saturator.dll
You need to copy that and help-saturator~.pd to your PD's path. If you have PD-Extended you should automatically have on in your user's folder
Application Data/Pd
Then you have to add "saturator" to your startup in order to load the classes. You can do this manually by creating a [saturator] object. If everything works properly you should see this in PD's console:
saturator: saturator~, saturator_vu~, saturator_thresh~
For linux you have to build it. You can do this by running the command "make" in the unzipped folder. Then copy saturator.pd_linux to PD's path and at it to the startup.
Arduino and pure data
Hello. I'm trying to use Arduino with Puredata using the Firmata Library. I downloaded Firmata and installed the library as instructed in the readme, and then loaded 'AnalogFirmata' from the library examples. When I try to compile this example (or any of the others) I receive a string of error statements. Code and errors listed below. Any suggestions?
Code:
/* This firmware supports as many analog ports as possible, all analog inputs,
* four PWM outputs, and two with servo support.
*
* This example code is in the public domain.
*/
#include <Firmata.h>
#include <Servo.h>
/*==============================================================================
* GLOBAL VARIABLES
*============================================================================*/
/* servos */
Servo servo9, servo10; // one instance per pin
/* analog inputs */
int analogInputsToReport = 0; // bitwise array to store pin reporting
int analogPin = 0; // counter for reading analog pins
/* timer variables */
extern volatile unsigned long timer0_overflow_count; // timer0 from wiring.c
unsigned long nextExecuteTime; // for comparison with timer0_overflow_count
/*==============================================================================
* FUNCTIONS
*============================================================================*/
void analogWriteCallback(byte pin, int value)
{
switch(pin) {
case 9: servo9.write(value); break;
case 10: servo10.write(value); break;
case 3:
case 5:
case 6:
case 11: // PWM pins
analogWrite(pin, value);
break;
}
}
// -----------------------------------------------------------------------------
// sets bits in a bit array (int) to toggle the reporting of the analogIns
void reportAnalogCallback(byte pin, int value)
{
if(value == 0) {
analogInputsToReport = analogInputsToReport &~ (1 << pin);
}
else { // everything but 0 enables reporting of that pin
analogInputsToReport = analogInputsToReport | (1 << pin);
}
// TODO: save status to EEPROM here, if changed
}
/*==============================================================================
* SETUP()
*============================================================================*/
void setup()
{
Firmata.setFirmwareVersion(0, 2);
Firmata.attach(ANALOG_MESSAGE, analogWriteCallback);
Firmata.attach(REPORT_ANALOG, reportAnalogCallback);
servo9.attach(9);
servo10.attach(10);
Firmata.begin();
}
/*==============================================================================
* LOOP()
*============================================================================*/
void loop()
{
while(Firmata.available())
Firmata.processInput();
if(timer0_overflow_count > nextExecuteTime) {
nextExecuteTime = timer0_overflow_count + 19; // run this every 20ms
for(analogPin=0;analogPin<TOTAL_ANALOG_PINS;analogPin++) {
if( analogInputsToReport & (1 << analogPin) )
Firmata.sendAnalog(analogPin, analogRead(analogPin));
}
}
}
Error Statements:
/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()':