Installing PureData 32 bits on 64 bits host for the life of a project
@whale-av Thank you for your respons.
I tried to install pd-extended by the repo, but there are in 404 status :/
So i download pd-extended.deb to install on my 64 bits host but i miss these depedancies:
pd-extended:i386 dépend de libfftw3-3.
pd-extended:i386 dépend de libflite1.
pd-extended:i386 dépend de libftgl2 (>= 2.1.3~rc5).
pd-extended:i386 dépend de libgl1-mesa-glx | libgl1.
pd-extended:i386 dépend de libglu1-mesa | libglu1.
pd-extended:i386 dépend de libgsl0ldbl (>= 1.9).
pd-extended:i386 dépend de libice6 (>= 1:1.0.0).
pd-extended:i386 dépend de liblua5.1-0.
pd-extended:i386 dépend de libmp3lame0.
pd-extended:i386 dépend de libpng12-0 (>= 1.2.13-4).
pd-extended:i386 dépend de libquicktime2 (>= 2:1.2.2).
pd-extended:i386 dépend de libsdl1.2debian (>= 1.2.11).
pd-extended:i386 dépend de libsm6.
pd-extended:i386 dépend de libspeex1 (>= 1.2~beta3-1).
pd-extended:i386 dépend de libvorbisfile3 (>= 1.1.2).
pd-extended:i386 dépend de libx11-6.
pd-extended:i386 dépend de libxext6.
pd-extended:i386 dépend de libxv1.
pd-extended:i386 dépend de libxxf86vm1.
pd-extended:i386 dépend de ttf-de
i can also find pd-extended:i386 in the repo list.
But still these deps are missing. Should i installed them one by one ?
Edit :
After trying to install each dept its not working.. some deps can't be satisfied..
how can i installed pd-extended:i386 on 64 bits host :/
netsend
@ingox..... I was watching a good film on TV..... you would not have beaten me to posting the solution otherwise....
@youaresound The Tuio spec is horrible...... https://www.tuio.org/?specification
It seems that it expects a bundle of messages in the correct order, that fill a UDP packet.
What is more...... some messages expect a mixture of floats and integers.
So a 2D set message expects......
int32, float32(range 0-1), float32(range 0-1), float32, float32, float32
It might not be all that interested though............ as a "bundle" has to be sent..
/tuio/2Dcur source application@address
/tuio/2Dcur alive s_id0 ... s_idN
/tuio/2Dcur set s_id x_pos y_pos x_vel y_vel m_accel
/tuio/2Dcur fseq f_id
and for each bundle that changes parameters (not redundant) the fseq frame_id must be incremented. Reading, and nearly understanding some of it, I guess it should look like.....
/tuio/2Dcur source Pd
/tuio/2Dcur alive s_id0 ... s_idN
/tuio/2Dcur set s_id x_pos y_pos x_vel y_vel m_accel
/tuio/2Dcur fseq f_id
I searched my old backups...... and found this....... tuio_works.pd which seems to claim (in its name) that it was working. The send/receive names suggest that it is yours, or something we worked on previously......
David.
netsend
just thanks and no worries.. i will post a more complete version of the patch when i get it cleaned up.
this link has some more info.
https://forum.pdpatchrepo.info/topic/10384/mrpeach-osc-and-raspberry/12
"With [oscformat] you can omit the slashes (but you can also include them if you like to keep the standard OSC protocol format). If you omit them, [oscformat] will add them behind the scenes."
i've tried removing the slashes to see if that makes a difference (along with using multiple [oscformat] objects one for each part of the message), but there still seems to be an extra space in the messages sent from oscformat between list | tuio and only one space when sent from packOSC.
print: list tuio 2Dcur source localhost
print: list tuio 2Dcur alive 2
print: list tuio 2Dcur set 3 0.745 0.807 -5 -5 -16.8504
print: list tuio 2Dcur fseq 6
print: list tuio 2Dcur source localhost
print: list tuio 2Dcur alive 2
print: list tuio 2Dcur set 3 0.745 0.807 -5 -5 -16.8504
print: list tuio 2Dcur fseq 6
netsend
don't know where that coma is coming from as it is not part of the original message.
here is a simplified version. oscform.pd
i am at this point using packOSC with netsend
and comparing it to oscformat with netsend
and trying to figure out how the message is being formatted differently by those two objects.
The actual patch is sending tuio messages to another source. (part of which you helped me with a while ago.)
but i am also using netreceive and oscparse to try to gauge what the differences are.
for some reason when sending with oscformat the message that arrives in oscparse keeps the / slashes but not when sent from packOSC.
netreceive-oscparse from packOSC-netsend
print: list tuio 2Dcur source localhost
print: list tuio 2Dcur alive 2
print: list tuio 2Dcur set 3 0.145 0.227 -5 -5 -16.8504
print: list tuio 2Dcur fseq 6
netreceive-oscparse from oscformat-netsend
print: list /tuio/2Dcur source localhost
print: list /tuio/2Dcur alive 2
print: list /tuio/2Dcur set 3 0.745 0.807 -5 -5 -16.8504
print: list /tuio/2Dcur fseq 6
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.
Autosave options?
@60htz Maybe...... autosave.zip
Please test to destruction.
Once started the user is always working in the latest saved backup (for 60 seconds/backup file)...... until deciding finally to write over the original patch (if desired).
Pressing "Start" again will force another (un-programmed) backup.
Having saved over the original the job is finished.
The user will need to restart [saveme_master] to work again with the patch if autosave is required again.
Endless "undo"..... and backups still stored until purposeful deletion.
However, starting the patch again will write over the old backups, unless a new folder is specified.
If the user goes back to a saved backup they can start working again from there. The sequence of backups will start again after all of the previous backups.
That can be forced by pressing start again........ or will not happen if the user moves forwards to the last backup before the timer sets another backup.
The user can always move to any backup and start working again.
Edit-mode is maintained (on or off), but when stepping forward and back edit-mode is off, and all values stored in objects are lost (unless "init" properties are set).
It would be trivial to set edit-mode on when stepping.
David.
Uninstall from Ubuntu 16.04
@EEight It doesn't work, because it says that "El paquete «puredata» no está instalado", that puredata is not installed... isn't it rare?
anibal@anibal-ubuntu:~$ sudo apt-get purge pd
[sudo] password for anibal:
Leyendo lista de paquetes... Hecho
Creando árbol de dependencias
Leyendo la información de estado... Hecho
Nota, seleccionando «puredata-core» en lugar de «pd»
Los paquetes indicados a continuación se instalaron de forma automática y ya no son necesarios.
libgsl0ldbl ttf-dejavu-core
Utilice «sudo apt autoremove» para eliminarlos.
0 actualizados, 0 nuevos se instalarán, 0 para eliminar y 2 no actualizados.
anibal@anibal-ubuntu:~$ sudo apt-get purge puredata
Leyendo lista de paquetes... Hecho
Creando árbol de dependencias
Leyendo la información de estado... Hecho
El paquete «puredata» no está instalado, no se eliminará
Los paquetes indicados a continuación se instalaron de forma automática y ya no son necesarios.
libgsl0ldbl ttf-dejavu-core
Utilice «sudo apt autoremove» para eliminarlos.
0 actualizados, 0 nuevos se instalarán, 0 para eliminar y 2 no actualizados.
anibal@anibal-ubuntu:~$
Then I did:
anibal@anibal-ubuntu:~$ sudo apt-get purge puredata-core
Leyendo lista de paquetes... Hecho
Creando árbol de dependencias
Leyendo la información de estado... Hecho
Los paquetes indicados a continuación se instalaron de forma automática y ya no son necesarios.
libgsl0ldbl ttf-dejavu-core
Utilice «sudo apt autoremove» para eliminarlos.
Los siguientes paquetes se ELIMINARÁN:
puredata-core*
0 actualizados, 0 nuevos se instalarán, 1 para eliminar y 2 no actualizados.
Se liberarán 2.680 kB después de esta operación.
¿Desea continuar? [S/n] s
(Leyendo la base de datos ... 242946 ficheros o directorios instalados actualmente.)
Desinstalando puredata-core (0.46.7-3) ...
Purgando ficheros de configuración de puredata-core (0.46.7-3) ...
Procesando disparadores para man-db (2.7.5-1) ...
anibal@anibal-ubuntu:~$ pd
anibal@anibal-ubuntu:~$
...and I launched pd fine... The puredata-core corresponded to an earlier installation. Thanks!
Pure Data / Raspberry Pi / Realtime Audio / Permissions
THE GOAL:
I want my Raspberry Pi 2 to automatically start up the Jack server with realtime scheduling, and subsequently start Pure Data with realtime scheduling, load a patch &c. without any user intervention from a login shell.
As a performance artist working primarily with psychodrama (the technology is definitely NOT the important part here), fiddling around at a terminal right before or during a performance is kind of... psychically inconvenient. I need a box that I can plug in, give the audio output to the sound guy, and be ready to go.
PREREQUISITES:
I use Raspbian with a Linux kernel compiled with realtime goodness. I have hand-compiled Jack2 and Pure Data with realtime support in order to take advantage of this. Running a process with realtime priority requires the proper PAM directives set in /etc/security/limits.conf and related places, but that is beyond the scope of this little write-up.
Also somewhat relevant: I use a M-Audio MobilePre USB soundcard (sounds pretty awful by today's standards, but it's an extremely USEFUL box and sounds good enough for the work I do). For full-duplex sound, this requires the RasPi's USB to be set to single speed. In this configuration, I can get just under 2.9ms latency with good CPU overhead for Pure Data to run a few of my 64-voice wavetable and delay line granulators. Yeah!
THE PROBLEM:
Purely by happenstance, I had given the jackd command in my startup script the option “-s” which allows the server to ignore overruns and so on. So things seemed to be working as expected, but I noticed a lot more glitches than when I manually started up Jack and Pd from the terminal without the “-s” option. Upon removing it from my startup script, everything failed! WAH.
So I started piping STDERR and STDOUT to text files so I could read what either Jack or Pd were complaining about. As it turns out, Jack was unable to start with realtime priority due to a permissions problem. (I assume this is one of the things the “-s” options allows jackd to ignore, and thus start up with non-realtime priority. Problem is that Pure Data can’t connect to a non-realtime Jack server when its “-rt” option specified.)
Now, I had already been through the whole rigamarole of setting proper memory and priority limits for the “audio” group, to which the user “pi” belongs. So I thought, okay, I have to execute these commands as “pi”, and while simulating a login shell because the security limits in question are only set during login.
So I did this:
su -l pi -c "/usr/local/bin/jackd -R -dalsa -dhw:1,0 -p128 -n3 -r44100 -S >> /home/pi/jackd.log 2>&1 &"
This says “login as user ‘pi’ and then run the jackd command with these options, piping the outputs to this log file and run it in the background”. Well, I still got all the same errors about not being able to set realtime priority. WHYYYYYYYYY?
THE SOLUTION:
I hunted and hunted and hunted on a Very Popular Search Engine til I decided to try searching “security limits not loaded with su -l” and found this.
(Makes me think of that Talking Heads lyric, “Isn’t it weird / Looks too obscure to me”.)
So by uncommenting the line # session required pam_limits.so
in /etc/pam.d/su
everything started working as expected.
CONCLUSION:
I now know a LOT MORE about PAM and how important it is to keep in mind when and in what order scripts and other little subsystems are executed; but also that sometimes the problem is EXTREMELY OBSCURE and is to be found in some seemingly far-flung config file.
I hope this helps anybody out there working with Pure Data and the RasPi. The second generation board really packs quite a punch and can run several hundred audio grains (run by vline~ and enveloped by vline~ and cos~) simultaneously without a problem. And I'm pretty sure this is just using ONE of the 4 cores!
I'm by no means an expert Linux sysadmin, so if you have any other suggestions or corrections, please let me know! I wouldn't have been able to get this far without all the generous and helpful writeups everybody else has contributed, both within the RasPi and Pure Data communities. If you have any questions about anything I glossed over here, I'll do my best to answer them.
Envelope Curves
Exponential fades are not circles, but they do look a bit like ellipse quadrants. If that's not what you mean, you'll have to find a picture (or look here). If it is, here you go: Exponential curves on linear impulses (not dB) sound smooth and straight, because the ear translates takes a logarithm of them (as it does with frequencies) to become linear. This is called an exponential fade. By changing the base you can affect the sharpness of the fade.
Generally you want to avoid finding matches on a curve for your time & amplitude, so you'll stretch the exponential's known points to your start and end points and amplitude. Exponentials of all bases b go through the points (0,1) and (1,b), and we want them to go through (start, volstart) and (end, volend).
Crop the output by subtracting 1 from the whole function, so that b^time becomes b^time-1 (not b^(time-1) ), and those points become (0,0) and (1,b-1). Stretch the amplitude by dividing by b-1 and multiplying by volend-volstart, sending (1,b-1) to (1,1) then (1,volend-volstart). The function is now: (b^time-1)*(volend-volstart)/(b-1). Raise this clip to meet your desired amplitudes by adding volstart, so that the points are now (0,volend), (1,volend), and the function is (b^time-1)*(volend-volstart)/(b-1)+volstart.
All that's left now is stretching and clipping the input, which can be done a number of ways, but all entail turning start-end into 0-1. You can give this expression a time input from a [line] that ramps from 0 to 1, from start until end in ms. You could, of course, run that line through another function first, which still outputs from 0 to 1, and make a more complex envelope. You can bake the stretching and clipping into the expression by turning time into (time-start)/(end-start), so that as time runs from start to end, the function outputs as if running from 0 to 1.
Swept sine deconvolution
Hello All,
this is becoming even more exciting!!
"Question: Is it possible that some 'comb filter'-like effect appears when reproducing a mono signal through multiple loudspeakers for acoustic measurements?"
Assuming you are in an Airport departure concourse.
You have a big multichannel PA system that should provide voice messages to all the people in the concourse.
You will have a guy speaking to a mic and says something like "Flight xxx will depart from gate yyy".
This is a mono signal reproduced by a multi-channel system.
Comb filtering are likely to happen but this is what you would like to measure to understand if the system would work and what are the downturns on having such a big PA.
Sumidero wrote: "I saw, many years ago, a PC-XP based ISA card for acoustic measurement of loudspeakers that instead of using a sine sweep it sent short trains of frequency fixed sines, opening the record just when the wave train was passing through the microphone."
is this system you are referring to?
IF yes, MLS (Maximum Lenght Signal) measurement system have been the industry standard until the sweep sine method comes out (expecially the log swept sine).
According to my knowledge, It is a very good way of measuring IRs but it has some problems in handling the non-linearities of the reproduction and recording chain.
@Katja
I will have a look to your patch and post some comments later, thank you very much.
I had a read through the 'Hamburg' article and he actually give us the exact function for the inverse swept sine which includes the amplitude inversion (or amplitude reduction, depends how you call it).
The way it is written is a bit confusing, I know, but after a bit of thinking you can see it like that:
assuming your funstion has a development in time (t) that goes between 0 and L-1.
the inverse function including time inversal and amplitude scaling is:
x^-1(t)= L-1-t)*(w2/w1)^(-t/L-1)
so if you want to write as written on physics books where your time variable t goes between 0 and T, it is like that:
x^-1(t)= T-t)*(w2/w1)^(-t/T) where 0<t<T
the function T-t) is basically the expression of the test signal (that you find previously in the paper) where instead of n (or t) you got L-1-n (or T-t).
this T-t) is expressed like that:
T-t)= sin(((w1-T)/log(w2/w1))*((e^((T-t)/T)*log(w2/w1)))-1)
I hope it is much more understandable now; I tried to use the same way of writing it in excel.
If you look at the xls file in the zip file i posted previously the formula is written properly and there is a graph showing the result.
This is very time consuming I know but there is no rush in finishing it as it could be an important tool in the free software community, I reckon.
Have a nice weekend guys
Bassik