installing external libraries
hi @whale-av
sorry, i misspelled it. it's adrian moore's book "Sonic Art: an introduction to electroacoustic music composition". Here is the link for the external library: https://www.sheffield.ac.uk/usss/ussstools
i have the 64-bit Pd installed.
thank you for your help!
i have already set the paths and runned the 'find externals' option...
pd-extended included externals on windows
@youaresound Hello.....
I played around a little....
Without your batch file pd.exe runs fine, but with no libraries and this error......
Giving the full path to Pd in the batch file solves this....... but that will not be practical.
The font you selected gives unpleasant rendering on my machine.... I removed it afterwards, but it does work so you can put it back in you wish.....
I then removed the (not useful) path setting.... (it is still shown here).
You will see that "Pd documents directory" is disabled...... probably due to the -noprefs switch.
I added (first switch) -lib libdir to the batch file and now most libraries are added (but none will create), even copying your upload to other folders. I cannot be absolutely certain that windows is not keeping tabs on the changing path though.
With -noprefs -lib ibdir my other installs and portable versions of Pd are not having their prefs and paths overwritten though.
That is very good news.
Here are the libs that are still not loading..... but that is as far as I have gone for now.
Here is the updated batch file that works for me........... (at the bottom)
BUT...... the full path to the library folders needs to be specified for any object to actually create.
Just adding the extra folder does not work.
So in the batch below only cyclone will actually work even though the other object classes have been registered.
You might have ideas about why the iem libraries will not load (I think the executable needs to be specified)..
You can maybe try this new batch file yourself...... and find another tester to double-check....
BUT ANOTHER BUT ...... the path setting will be wrong...... I will try to work out how to get around that. The tcl has path variables that can maybe be set with a tcl plugin.
It is probable that removing the -noprefs switch will solve these problems, but an existing Pd user running your batch file would curse you as they tried to recover their old working Pd........
David.
pd-0.48.1_windows_xp_or_later\bin\pd.exe -path C:\Users\David\Desktop\pd-vanilla_0.48.1_for-windows_with_externals\pd-windows\pd-0.48.1_windows_xp_or_later\extra\cyclone -noprefs -lib libdir -lib cyclone -lib zexy -lib creb -lib cxc -lib iemlib -lib list-abs -lib mapping -lib markex -lib maxlib -lib mjlib -lib motex -lib oscx -lib pddp -lib pdogg -lib pmpd -lib sigpack -lib smlib -lib unauthorized -lib pan -lib hcs -lib jmmmp -lib ext13 -lib ggee -lib iem_anything -lib ekext -lib flatgui -lib chaos -lib zexy/0x260x260x7e -lib zexy/0x2e -lib zexy/0x3c0x7e -lib zexy/0x3d0x3d0x7e -lib zexy/0x3e0x7e -lib zexy/0x7c0x7c0x7e
The ultimate solution is probably to destroy the directory tree...... moving every file into the Pd /bin folder.
Build a MIDI controller with the Arduino, Firmata and Pure Data
Time to start contributing some knowledge back to the wonderful world that is the internet; today, a step by step nice and easy tutorial on getting started to building your own MIDI controllers with the arduino.
When researching for my ableton controller project, I didn’t find much out there about using firmata on an arduino to send data to software. The standard approach just seemed to be create the code in the arduino language, upload it to your board and hack one of those MIDI to USB cables as a bodge job way of getting the MIDI out of the arduino.
So why firmata and pure data? Well the whole idea of firmata is that you flash it to your arduino, and it throws out serial about whats going on with the arduino inputs and outputs, then you decide how the software treats the readings coming in and going out.
Theory out the way, lets build some controllers. You’ll need a few things…
HARDWARE:
An arduino and something to wire into it (for this i’ll be using a pot)
A USB cable for your arduino
SOFTWARE:
Arduino – http://arduino.cc/en/Main/Software
Pure Data – http://puredata.info/downloads
Firmata – http://at.or.at/hans/pd/objects.html#pduino
Something to patch your new controller into; like Reason or Ableton Live
- SETTING UP FIRMATA AND PURE DATA
Install Pure Data and create a folder to store all your patches somewhere. Unzip Firmata and add the files ‘arduino.pd’, ‘arduino-test.pd’ and ‘arduino-help.pd’ to your new Pure Data folder. The ‘arduino.pd’ file is the object that we use in PD for opening up communication with your arduino and routing it to PD. Done? Awesome, your software is almost set up.
- FLASHING FIRMATA TO YOUR ARDUINO
Install the latest version of arduino and open it up. Connect your arduino with the USB cable to your laptop (i’m using a macbook for this by the way). In the example patches, open up “Standard Firmata”, select your board (im using an arduino mega), and your serial port (look for tty.usbserial for use with a USB cable). Then compile and hit the upload button and your arduino is now ready to use firmata and communicate with Pure Data!
- WIRING UP A POT
Potentiometers are cool, and theres a great arduino tutorial of how to wire one up here: http://www.arduino.cc/en/Tutorial/Potentiometer
Basically, all you need to know is that there are three pins; your two outer pins govern voltage flow across the pot, meaning one has to be 5V and the other has to be ground. It doesn’t matter which, but your 5v pin is going to be where your pot reads maximum, so convention dictates this should be the right hand pin. The center pin needs to be connected to an analog in on the arduino and will read the value of the pot as it sweeps from ground (0v) to 5v.
All wired up? Plug it into your laptop and open Pure Data, we’re ready to get things talking.
- SETTING UP OUR PATCH
Open the example “arduino-test.pd” Pure Data patch you copied over earlier. It should look like this one…
The test patch has everything we need to open a connection and enable pins. Firstly, lets delete a bunch of stuff and make our window a bit bigger. Hit Command + E to enter edit mode in Pure Data.
Ok a quick explaination; the key component here is the ‘arduino’ object. This is being drawn from the file you copied in earlier, and is what communicated with your arduino. Here we can do everything to control the arduino from opening a connection, to receiving data.
The large grid allows us to set the mode of each pin on the arduino. Remember pins 0 and 1 are reserved for Rx and Tx. I’m using analog pin 4 for this demo, so I’ve set my pin mode for pin 4 to ‘analog’.
Now we can plug our arduino in and get a reading from the potentiometer.
- ARDUINO INTO PURE DATA
With your arduino plugged in, hit command and E to bring us out of edit mode. In our patch, click on ‘Devices’ above the arduino object and open up the pure data terminal. (That other thing that loads with PD that has all the scary code in)
The “Devices” message connected to the arduino object pings your computer to find what devices are connected and on what serial ports. Since we’re using a USB cable to connect our arduino, we’re looking for something with ‘usbserial’ in it, in this case; port 2.
Select the relevent port in the green box at the top (remember the first box is ‘0’, second is ‘1’ and so forth) and hit ‘Open’ to establish a connection. Check the terminal to see if the connection was sucessful.
Now lets check we’re getting something in. Create a number box (Command + 3) and connect it to the relevent pin on the ‘Route analog’ box at the bottom. In this case, pin 4.
One more thing; if you’re not getting any readings in, you’ll need to click on ‘pd old analog/digital controls’ and enable your pins here too. What I tend to do in my patches is just not include the large grid but make my own ‘old pd’ controls custom to what i’m enabling/disabling to save space.
Here’s what the ‘old analog/digital controls’ subpatch looks like (pin 4 enabled)…
Come out of edit mode and check that you’ve got readings. If so congratulations! If not, troubleshoot, start with making sure your usb connection is opened, make sure all the correct pins are enabled (remember you’re counting from 0 not 1 on most of these buttons in PD, it’s just the way computers work).
- SCALING READINGS TO MIDI
So we’ve got a reading and chances are it’s to 3 decimal places between 0 to 1. No problem, create a new object (Command + 1) and type “autoscale 0 127”. This allows us to scale the input to a min and max value, in this case 0 to 127 of MIDI. Next, lets get things looking nice, create a new object and type “knob”. Connect this AFTER the autoscale object. (the knob is default set to read inputs from 0 to 127. Then create another number to display the scaled MIDI data coming out, and finally a new object and type “ctlout 1”.
It should look something like this…
The second box should be outputing values from 0 – 127 now, and the knob giving a visual representation of your potentiometer.
Now lets patch it into ableton…
- PURE DATA TO ABLETON LIVE
Firstly, you’ll need to set up your macs IAC driver if you’ve not done this. Basically you’ll need to go into Audio/MIDI preferences and enable your IAC driver. Then create a new input and output. One for input to DAW and one for output from DAW. Google around for a tutorial on this, its really simple, a 30 second job.
After you’ve set up your IAC driver, go back to PD and go to preferences > MIDI Settings, and connect your IAC driver.
Open ableton and go to its MIDI preferences. Create a device listing for your IAC driver and enable its ins and outs into ableton like so…
And thats it! Create an instrument and try to assign something! I’ve got it controlling the brightness of a bass sound here.
Shout out for Facu who requested this tutorial. Hopefully it’ll help some of you looking to get into this stuff and start building things but with no idea where to start.
Pd-extended to Vanilla migrations issues. Gui freeze, console errors, etc.
Hello Dxk,
Yours are the exact instructions I tried to follow a few days ago.
As of now, I'm still a whole lot wiser. As far as I've understood, libraries that are contained in a single file are to be added to the "startup" for load at start-up. Libraries consisting of a folder with multiple, separate files should be added to "path".
First off, the Deken manager downloads the libraries to a folder called "extra", not "pd-externals" or something similar. I've got no folder called that. I couldn't access the folder through the "choose folder"-prompt, since I have to access the contents of the Pure Data application, so I had to create a desktop shortcut to which I could easily choose the "extra"-folder when adding paths to "path".
This is what I am greeted with on start-up.
And it just keeps going all the way down. It seems to go through the contents of the libraries, but gives me a failed message. I now see that it looks for the contents of the zexy library in the folder of cyclone and tries to look for the files in neighbouring folders. Why would it do that?
But, say I call up an object I know only exists in an external library, say, cyclone's [cycle~] object, I will get this:
The first few lines show that it's trying to look for the library contents in my main folder (users/marc). I can't see why it would try that. It then tries the paths, fails, but then succeeds.
This is what my "startup" and "path" folders look like, respectively:
And the contents of the "extra" folder:
Thank you, in advance.
Pure Data noob
Ok...... So I have been meaning to do this for a very long time......
I don't think it is the perfect "show_me_dollars" and so I will change it from time to time.
3rd attempt.........
show_me_dollars.zip
Here is a really terrifying screenshot, but I have also tried to explain it in words.
In many ways I think words ( below the screenshot) are easier to understand.
David.
Dollar $ variables in Pure Data patches.
A dollar variable is a thing that can be given a new value.
The new value can be a float or a symbol.
- If the Dollar variable is in an [object] box
A Pd patch can be saved and used inside another patch. We then call it an abstraction.... and it is just like a programming sub-routine.
If you want to use it many times then you have a problem, that they are all the same, so if you put an object [receive woof] they will all receive any message that you send with [send woof].
That might well be what you want to do.
But what if you want to send the message to only one of them?
You can give it an [inlet], but your patch will get messy, and what if your patch needs to make its own mind up about which abstraction it wants to send the message to, maybe depending on which midi note it received?
The solution is to give the abstraction arguments... some parameters that define it and make it different to the other copies.
For example [my_abstraction]
Let’s give it some arguments [my_abstraction 5 9 woof]
Inside the abstraction, as it is created (you open its parent patch) the dollar variables will be replaced. Wherever you see $1 written IN AN OBJECT it has been replaced by the number 5.
Number 5 because 5 is the first argument and has actually replaced the $1. You still see $1, but if you bang a [$1] object it will output 5.
[f $2] will output 9
[symbol $3] will output woof
So if you have an object [receive $1-$3] then it has now become [receive 5-woof]
And if you want to send it a message from outside, from another patch or abstraction, you will need to use [send 5-woof]
Every Pd patch, which remember includes your abstractions, also has a secret number. The number is unique and greater than 1000. As Pd opens each patch it gives it the number, increased by one from the last number it gave.
That number will replace $0 as the patch is created. You can find out what the number is by banging a [$0] object and connecting its output to a number box, or [print] object.
$0 can be used in any object as part of the name or the address, which means that a message cannot escape from the abstraction. A sub-patch like [pd my-subpatch] will be given the same number.
But from outside your abstraction you don’t know what it will be when the patch is created, so it is not useful. (A lie, you can find out, but as it can change every time you open your patch it is not worth the bother).
Use it to send messages within your patch [send $0-reset] to [receive $0-reset] for example, because the message is absolutely unique to its window, so you know it cannot interfere with other abstractions.
Use it also for objects like [delwrite~ $0-buffer 100] or for an array name [array $0-array] so that in each abstraction they have a different name and you will not have problems with their being "multiply defined"...... as each name can only exist once in your patch.
- If the Dollar $ variable is in a [message( box
Dollar $ variables are also replaced, but not as the patch is created (drawn by Pd as you open it).
Dollar zero $0 has no meaning in a message box. It will produce a zero if the message is banged, but that is it.
It is a mistake, a patching error, to put a $0 in a message box.
$1 $2 $3 $4 etc. in a message box are replaced by incoming atoms (individual floats or symbols or whatever) when they arrive. $1 will be replaced by the first atom in the list, $2 the second etc.
So if you have a message box [$1 $2 $3( ..... and you send into it a list [3 48 lala( .....then it will output 3 48 lala
That is not really very useful.
But it is actually very powerful.
Make a list in a message box........ [33 12 wav(
And bang it into a message box [open my-track$2-$1.$3( and you will get the output.........
open my-track12-33.wav
Which could be just the message that you want to send to [soundfiler]
P.S. If the first item in the incoming list is a symbol then it will be dropped causing errors.
You can fix that by making the message a list by passing it through the object [list].
Unfortunately only messages starting with a float are automatically recognised as lists.
Ewolverine 4 U
New version 7 (currently testing)
- added automatic loosening of minimum fitness limit for the case that a population of sounds gets stuck in a local maximum in the fitness landscape (really nerdy jabbering, but trust me, it's useful ^^)
- added automatic "jumping" out of local maximums after a certain number of fruitless climbing-trials
EWOLVERINE v.7 by Henry Dalcke.pd
plans:
• bugfix: prevent a newly audible sound from being selected after manually stopping the target drive
• simulated annealing in target drive mode: span "temperature" value onto fitnesslandscape and decrease step length (modwheel) and probability value in the splice-pattern-generator the closer the fitness gets to optimal fitness value
• interactive mode: automatic narrowing of the range of generated parameter values around a mean value that's derived from the repeated selection of similar values of individual parameters throughout the generations (increases the number of similar sounds per generation that are located around a certain coordinate in parameter space; increases the likelihood of the generation of the desired sound in a smaller amount of time)
• stop-condition for automatic stopping of target drive
• make default settings for modwheel-position, splice-pattern-generator's probability, anti-stuck and allowed minimum fitness value in target drive adjustable from GUI
• adjustable MIDI output message blocker (useful for instruments with a fixed MIDI implementation, for instance: If you want to breed a bass drum in a drum synth with multiple instruments, you may not want to ruin the parameter adjustments of the snare drum meanwhile you're selecting for good bass drums)
• storage for self-created splicer patterns (maybe in connection to the MIDI output message blocker)
• low-value-weighted probability for the generation of MIDI-CC-values in new populations; switchable per MIDI-CC either manually or randomly (increases the probability for the generation of short attack and decay values in synth's envelopes)
• bigger populations for each sound-set: 4 more random sounds per set (A/B) to select from
• discontinuous MIDI messaging interrupted by assignment switching CC events (special build for FM-Heaven) - low priority
• possibility to interpolate between new random population's sounds to smoothly re-direct the modwheel-morphing path while morphing
• selection-history recorder that one can use to re-load the selected sounds of each past generation
• a visualizer that generates a "tree of life" from directions (keys C,D,E,F) and steplengths (modwheel) of formerly selected individuals and their respective distances to their parent sounds
RaspberryPi audio cutoff
I have a PD-extended sketch running on a RaspberryPi (RPI) that plays wav's from 32+ tabread4 array's. They can be selected via OSC messages sent over network. I noticed that every so often the audio would cutout. The following is a recording from PD on the RPI. The cutout is heard clearly at 22seconds and 50 to 54 seconds. This happens with both the internal sound card of the RPI and when using a USB soundcard.
For comparison here is a similar graph from running the same sketch on OSX. The waveforms differ because the tabread4 arrays played are a bit random. But the graph shows that the sway from the 0 middle line is much more on the RPi than OSX.
To attempt to resolve I have to be certain the sketch DAC is given a volume of around 0.5. But perhaps someone knows better what is going on and could advise me?
Sketch elements:
form extended to vanilla
Ok, I've followed your instructions. Deken is ok.
Then I installed the first library (zexy/2.2.6svn). Is it the right one?
Then I tried to install Gem and Cyclone, as well. This is how my Pd folder under /User/Library/ looks like.
As you can see, I get error both for cyclone and Gem.
I put this line in the Startup Flag field:
-lib zexy/zexy -lib cyclone/cyclone -lib Gem/Gem
Is it correct?
If I want to use a zexy object like "nop", I have to write zexy/nop inside the object, even if I loaded library on StartUp putting -lib zexy/zexy in the flag field. If I only write "nop" inside the object I get an error.
I'm testing it both in 32 and 64 bit.
Many thanks,
G
having trouble running guitar/mic line into pd
@Wolf-Breath Hello there......
The symptoms that you describe are those of Pd struggling because of incorrect audio settings. It is not your fault, they are not easy to set up initially.
The quickest way to get it working (and you would have the advantage of using the computers other audio connections at the same time, or even multiple asio soundcards) would be to use Asio4all......... http://www.asio4all.com/
I am assuming that you are using windows (FL and reaper)?
(FROM HERE TO........... "END" BELOW SHOULD HELP WITH YOUR CURRENT DRIVER AS WELL!)
Make sure you select ASIO in the Media window first.
Then in your Media/Audiosettings window choose Asio4all (or your asio driver for your Focusrite if you don't want to use Asio4all) as your soundcard and set the channels (number of channels) that you want to use (total including your computer soundcard). Don't worry if you set too many, as Pd will just drop any that don't actually exist.
Set Pd something like this.......
If you have problems then set the samplerate to match your soundcard, the delay higher (try 30 or more for example and then gradually decrease it to reduce the latency) and try a higher block size although that should not be necessary. Ticking the callbacks box allows Pd to communicate better with the soundcard. Then go back to choosing your soundcard again. The setup you see above gives 2ms latency which is excellent. (END)
Now you should have a little green icon for the asio4all driver in your taskbar (if it is red then there are settings to be changed to make it work).
Click that to open asio4all settings and you should see something like this........ If not then click the "spanner"at the bottom right corner.
Choose which inputs and outputs you want to use, and count down the list of active ins and outs making a note of their order in the list (ins and outs separately). They will be numbered [dac~ 1] etc. in the same order in Pd.
Good luck, and come back here if you are still struggling....
You might find that Pd is still struggling because of your old settings. If so then start Pd with no audio from a batch file using the -noaudio flag, before you do the above........ see below.....
David.
If you don't know how to use a batch file then try this before you start setting up your soundcard. It will reset the sound settings so that Pd responds properly again!! http://forum.pdpatchrepo.info/topic/9250/pd-will-not-start
Or make your own like this.....
It will open Pd and load the directory in which the patch Minx_Run.pd can be found, load the readsf~ directory and then turn off audio, turn on asio, turn off midi and load the patch Minx_Run.pd......
Later, when all of your settings are correct you can have different setups depending upon which soundcards you have connected, like this...........
how does [list drip] actually work?
it's a recursive thing: I'll walk through part of an example:
say the list has 5 elements.
The list comes in, and goes into the open spigot.
so at this point the [t a a a a] is sending a list of 5 elements. the following is what happens to the right [list-split] at this moment:
the first 2 elements of the list are sent back to the upper trigger, and go back into the spigot, where they are split again into lists of length 1. element 1 goes back into the upper trigger and out of the outlet, and then the second does as well.
All of this happens before the list of 5 elements is even sent to the left [list split], because of the trigger. A similar thing occurs:
the last 3 elements of the 5-element list are sent to the upper trigger and into the open spigot, and then the first element of that is split off and sent out the outlet. Then the last 2 elements are sent through the spigot and split, and are sent out in order.
The crucial thing to understand is the recursive nature; it has to do with the depth-first message passing in pd.
The first half of the list is split off before the second half, and sent to be split in half again before the second half of the original list is even processed. So it goes the first half of the first half of the first half, etc. until the first element is sent to the outlet. Then it goes back up the "stack" to the second halves of the lists that it missed in doing the first half every time (this happens because of the triggers). So after the first element is sent, the second element is sent. After that, elements 3 and 4 (in a list since they weren't even processed to be split yet) are split and sent out in order. then elements 5-8, which are still in a list, are sent back and processed in the same manner.
Hopefully that's somewhat clear..
(rambling extra stuff:)
From a "computer science" perspective, you could say that you process the first half and put the second half on a "stack" , and then go into the first half, split it in half, put the second half on the "stack", etc. And then after the 1st element is put out, repeat that process for each thing on the top of the stack until you end up with 1 element:
in "pseudocode" (with a datatype "list" and an assumed stack):
function splitlist (list inlist) {
list firsthalf;
list secondhalf;
if length(inlist) == 1 then {
output(inlist); -- pass the element
if stack exists then {
secondhalf = popstack(); -- get the next thing on the stack
splitlist(secondhalf); -- call the function recursively
}
} else {
firsthalf, secondhalf = split(inlist); -- split the list, pass to variables
pushstack(second half); --- push the second half onto the stack
splitlist(firsthalf); -- call the function recursively
}
}
I think that in reality most of this is taken care of in the computer's call stack, though not completely sure on how the memory for the lists is dealt with