[comport] lost connection retry failing
Hi, I'm working on a Pd patch that connects to a few sensors via SLIP serial OSC. The serial implementation is based on this example : https://github.com/CNMAT/OSC/tree/master/Applications/PD
Everything works wonders and is really stable; however I run into an issue when a serial connection is lost, for instance when we I reset one of the sensors for calibration purposes. The patch is running headless on a RPI4 and the idea is "never" have to ssh in order to reload the Pd as this is running on a permanent sound installation.
I have created bind USB address on linux using the deviceID and vendorID of my sensors therefore naming on /dev/ is static (/dev/sensor_1, /dev/sensor_2, etc ...). I have also specified a large amount of retries on the [comport] object to allow the sensor to show up /dev/. But when I unplug one of the sensor, I can see [comport] loosing the connection and listing the retries:
error: [comport]: lost connection to port 9999 (/dev/sensor_1), retrying...
errors: retrying 45
I have also made sure that /dev/sensor_1 is back up on /dev/ while I can see [comport] endlessly trying to connect to it.
I think I'm running out of ideas here ... and would be grateful if someone could give me some pointers on how to either fix this issue; or finding another way around in order to ensure a dropped device will reconnect to my patch.
Thank you
tips about lightpainting?
Hi there, first excuse my engish. (french below)
Im trying to do lightpaiting in real time with, Purr Data, a webcam and a raspberry pi 4 . I've seen some videos about it but i really dont know how it works.
I've found a patch that could works, but i've got white trails instead of the real colors.
Do you know if there is a trick to keep the color? or should i use the patch for inspirate myself and create a new one ?
How do you learn PD when you are new and trying a new project ? I mean before find this patch, i was trying randoms commands to get the trails without success. I'd never thought using things like [separator] or [pix_buffer] etc...
thanks a lot for helping
Bonjour!
J'essaye de faire du lightpainting en temps réel avec Purr Data une webcam et un raspberry pi4. J'ai vu des vidéos avec l'effet que je recherchais mais je n'arrive pas à comprend comme ca fonctionne.
J'ai trouvé un patch qui pourrait marcher, mais la couleur de reste pas. Je n'ai que du blanc au lieu d'avoir la couleur de la lumière ( rouge sur la photo ).
Est ce qu'il y a une petite astuce qui me permettrait de garer la couleur d'origine? Je ne sais pas si je dois garder ce patch ou essayer d'en créer un nouveau en m'inspirant de celui la , si c'est un bonne piste ou pas!
Et mon autre question, comment vous débuter dans PD ? Avant d'avoir trouver ce patch, j'ai essayer pas mal de truc mais sans trop savoir ce que ça allait faire, et sans résultat du coup. Jamais il ne me serai venu a l'idée d'utiliser [separator] ou encore [pix_buffer]
Merci beaucoup ..je commence à désespérer
Using PD in a complex commercial hardware groovebox project
Guys thanks so much for you replies, interesting topics especially on the business side.
So to give you a bit more details about the project:
It will be an embedded linux based project, most probably ARM cpu, 16 channels of fixed instruments, and I agree with you about the originality of the concept an here we have in mind many improvements and simplified controls vs the actual and old concepts of grooveboxes to make the musicians feel musicians and not engineers and programers. Obviously its a subjective impression and test it internally by us and we will need gather many other impressions to conclude.
Indeed Organelle was the project made us thinking also about PD but it seems their platform is related to "one time pony patch" and it is not going to a more complex all in one instrument, so thats why my question is coming again, strictly as technical platform is PD reliable for this kind of project?
Also resources wise? Also related to the quality and diversity of the tools available?
Also related to the protection of the work, is there any solution to make the project "closed" ?
Camomile : An audio plugin that loads Pure Data patches
@starchild Thank you! I'm pleased these projects are useful to you.
Yes, of course, anybody can contribute by creating issues, merge requests, or writing documentation on the GitHub repositories. You should have a look at this document. In general, I just try to avoid to do things that will complicate the maintenance of the projects because I've already difficulties to find time to work on them. So, it's often better to start a discussion on a subject before starting to develop, this way we could avoid conflicts, see if contributing directly to a project is suitable or if creating a side project would be more appropriate, etc.
BTW, I keep the affiliation with the CICM because I started these projects there and it was great, now I'm working at Ircam for 2 years, so perhaps I will put a double affiliation .
Android processing and Purr data communication
Hi!
I have a new problem,
Everthing is working but not when I want to use the accelerometer of the phone, that's really weird.
Processing is receiving but not PD
Processing code:
import android.content.Context;
import android.hardware.Sensor;
import android.hardware.SensorManager;
import android.hardware.SensorEvent;
import android.hardware.SensorEventListener;
import oscP5.;
import netP5.;
import controlP5.*;
ControlP5 controlP5;
OscP5 oscP5;
NetAddress myRemoteLocation;
Context context;
SensorManager manager;
Sensor sensor;
AccelerometerListener listener;
float ax, ay, az;
void setup() {
fullScreen();
frameRate(25);
// create a new instance of oscP5.
// 12000 is the port number you are listening for incoming osc messages.
oscP5 = new OscP5(this, 12000);
myRemoteLocation = new NetAddress("192.168.137.1", 12011);
controlP5 = new ControlP5(this);
context = getActivity();
manager = (SensorManager)context.getSystemService(Context.SENSOR_SERVICE);
sensor = manager.getDefaultSensor(Sensor.TYPE_ACCELEROMETER);
listener = new AccelerometerListener();
manager.registerListener(listener, sensor, SensorManager.SENSOR_DELAY_GAME);
textFont(createFont("SansSerif", 30 * displayDensity));
}
void draw() {
background(0);
text("X: " + ax + "\nY: " + ay + "\nZ: " + az, 0, 0, width, height);
}
class AccelerometerListener implements SensorEventListener {
public void onSensorChanged(SensorEvent event) {
ax = event.values[0];
ay = event.values[1];
az = event.values[2];
print(ax);
print(ay);
print(az);
}
public void onAccuracyChanged(Sensor sensor, int accuracy) {
}
}
void mousePressed() {
/* in the following different ways of creating osc messages are shown by example */
//OscMessage myMessage = new OscMessage(int(knobValue));
//myMessage.add();
OscMessage myMessage = new OscMessage("/test");
myMessage.add(ax);
myMessage.add(ay);
myMessage.add(az);
/* send the message */
oscP5.send(myMessage, myRemoteLocation);
}
PD code:
[import mr peach] -----> [udpreceive 127.0.0.1 12000]--------->[unpackOSC]------->[routeOSC /test]---->[number]
I've already try like that too :
[import mr peach] -----> [udpreceive 127.0.0.1 12000]--------->[unpackOSC]------->[routeOSC /test]----> [unpack f f f]-------->[number]
Thanks in advance
Building a Linux Desktop
Yes and a topic that I like very much.
We're in 2020! Like I always say, we sent a spacecraft to the moon with a 2.048 MHz computer
@cheesemaster said:
-Ubuntu Studio, maybe an RME PCI card
Why RME PCI, you can find good external soundcard, I guess it depends on the computer that you will choose (more on that later). Yes I like Ubuntu Studio, good choice.
-Really only doing audio (oscillators, arrays, filtering, delays) No graphics.
Perfect, start pd with -rt -nogui
Use [pd~] only if topping 100% CPU (pd is single thread).
-Keeping the the machine quiet (low fan noise) is VERY important.
Fanless is possible, again depending on the computer you choose.
What CPU specs matter most for common audio and MIDI tasks in PD? Number of cores? Thread count? Clock speed?
Clock speed = lowest latency (you can push jack to buffer 64) without xruns. If you are not playing live (for example using ADC) you don't need low latency configuration (I am lucky and not very good at detecting latency, my setup is around 38ms (round-trip). You can detect latency using jack_iodelay.
RAM is important if you want to load samples in PD in advance (avoiding glitches).
NVMe SSD if you can.
If I run other apps (VCV rack, Carla, various Jack plugins) will those processes distribute to the other Cores?
Yes, again Pd is single thread. Others are usually better (GUI on a separated thead for example).
Does Pd benefit from a more powerful GPU card? Or will there be no difference if I use the GPU embedded in the CPU? Is it different if I launch Pd without the gui? (-nogui)
If you don't use Gem you don't need a dedicated GPU card.
Here's some ideas for you, I've been building some setup over the years:
Theremin à crayon:
Using a Surface Pro 3 running Ubuntu Studio with a "old" USB 1.1 sound card. Heavy patch using lots of software : Bitwig, SooperLooper, Guitarix and of course PD. Midi (PD), OSC (Bitwig, SooperLooper). Very quiet but the Surface gets hot (fans are kind of quiet like a good laptop).
Heavybox:
https://www.workinprogress.ca/projects/heavy-box/
Similar setup, a quiet PC using a big heat sink and a overrated power supply so the fan never start. Noctura fan on the side (expensive but quiet). Old soundcard (firewire) but I can do low latency. 8 ins/8 outs.
Biscuit box computer:
https://www.workinprogress.ca/biscuit-box-computer/
Mini-pc not quiet, not very fast in this case a cheap usb soundcard (you know +- 8$ barely better than the embedded one).
Phimatics:
A raspberry pi 2 with wolfson audio card. Using only PD with Alsa, I am getting very good result (low latency) quiest setup. But of course I need to be careful with the CPU.
JAS:
Working on a new project, I found this midi keyboard in the trash / snow. I will put Khadas VIM version 1 (ARM) with a BEHRINGER UCG102 (usb soundcard for guitar). Quiet, no fan can be run on a battery (5V). Will post the project when over.
Lattepanda:
Never worked with it, but looks very powerful. There's a price tag. Maybe for the next project.
Cheers
Somewhat nice circles using data structures with anti-aliasing implementing Xiaolin Wu circle algorithm (vanilla)
So the whole project was actually to create nice vanilla knobs. So here is the next step in the project: circle2.zip
This time, not only one circle is created, but two circles overlapping each other. And instead of drawing only the dots, a data structure line is created to fill the space in between. This is already optimized in many ways. So for example, the algorithm only runs for one quarter and the other three quarters are mirrored (If i recall correctly, this is a long time and i haven't reviewed the code again, just posting the patches). Anyhow it is already beginning to get heavy, as you can see when redrawing the circle. So a project with such knobs would also get heavy very quickly, but this depends on the number and size of the knobs.
This version already includes a version of xy, but i am not sure what version
The whole project came to a hold when i realized that it is not possible to get rid of the border with the current version of xy, as xy uses graphical arrays that hide at the top and bottom border line. To get rid of the borders, i invented colarray, where the arrays of xy could just have the color of the background or even better yet, could have line width zero, which makes them actually invisible. But i ran into some TCL errors that couldn't be resolved, when i just tried to include colarray into xy. So the next step would have been to incorporate the colarray code into xy and make a new version of xy that would have no borders and could therefor be completely invisible. But then i ran out of steem as the project went quite complex. Anyhow, this is the project so far, have fun
Dry/wet control of randomness
Hello,
With no clue, a little debutant in Pd, I'm stuck with a problem.
My idea is to create a rhythm sequencer sending a pattern to a solenoid. But i want this pattern to be alternate by randomness AND that this randomness is controlled by a distance sensor. So when someone is far from the sensor, the pattern is played at the maximum of randomness, and more someone is close to the sensor, more the pattern is played in order.
For now, I have the sequencer part working, either in random or in order. So I have two series of number (the steps position of a 16 steps pattern). But I don't understand how to chose between this two series in function of the sensor. This sensor is meant to act as a dr/wet control of the randomness. I tried with moses, spigot, but none of that worked. Or I don't know ow make it working.
Thank you for your help !
Jerome[sequencer aléatoire 2.pd](uploading 100%)
Installing PureData 32 bits on 64 bits host for the life of a project
Hi everyone,
I am comming to you today because i want to make a project live !.
This project work with pureData and some external pd object :
fluid~ , freeverb~..
My objectiv is to install a 32 bits version of pureData to make external pd work.
I tried these solutions :
Multi arch ubuntu 64 bits host
- On a 64 bits ubuntu
- add i386 arch
- update , dist-upgrade..
Then when installing : $> apt-get install puredata:i386
This package is no more available :
These packet a replacing it :
puredata-utils puredata-utils:i386 puredata-extra:i386 puredata-core:i386
puredata-core puredata-dev puredata-doc puredata-extra puredata-gui
So i installed
$> apt-get install puredata-utils:i386 puredata-extra:i386 puredata-core:i386 puredata-gui
pureData is now installed. But when i run it i have this message :
ALSA lib conf.c:3357:(snd_config_hooks_call) Cannot open shared library libasound_module_conf_pulse.so
ALSA lib control.c:954:(snd_ctl_open_noupdate) Invalid CTL hw:0
ALSA card scan error
Still i can use the debugger and hear sound..
When running my stido project using some object like :
udpReceive or udpSend...
i got this on the initialisation (you can see also all the pd objects used) :
import mrpeach/routeOSC
... couldn't create
import mrpeach/udpreceive
... couldn't create
import mrpeach/udpsend
... couldn't create
import mrpeach/packOSC
... couldn't create
import mrpeach/unpackOSC
... couldn't create
import flatspace/prepend
... couldn't create
import flatspace/prepend
... couldn't create
import moocow/sprinkler
... couldn't create
import cyclone/speedlim
... couldn't create
./libs/fluid~.pd_linux: libreadline.so.5: cannot open shared object file: No such file or directory
fluid~
... couldn't create
freeverb~
... couldn't create
beware! this is xeq 0.1, 3rd beta build... it may bite!
./
So its not working ^^
Solution 2 - Docker
I was thinking : maybe i can just make a puredata container with all the 32 bits libs, So i tried to find some puredata 32 bits image. But nothing.. And Docker is a little tricky with 32 bits container as he didn't provide any support yet.
Still its possible to run 32 bits linux on it .. i found some 32 bits images on the net, but no way how to create one..
If someone has a solution please..
I am working as a volunteer on this project because i believe on it. I have no time yet to update the pd engine for 64 bits..
This project is helping disabled people and your respons will help me so much to provide them a long term support for this software
If you wanna take a look at the project http://orguesensoriel.com
Thank you a lot,
Damien
HC-SR04 Ultrasonic Sensor with Pd (How long does a bang last?)
Hi,
I'm trying to use an HC-SR04 Ultrasonic sensor through arduino with Pure Data using Pduino and Standard Firmata. Pduino works perfectly and I am able to get data from many other sensors. This particular sensor is slightly different because it needs me to send a pulse of length 30 micro seconds at a time interval of more than 60 milliseconds to the trigger pin of the sensor, which triggers the ultrasonic waves from the transmitter. The receiver of the sensor measures the ultrasonic waves as they bounce back after reflecting from an external object to measure the distance.
My problem is that I am trying to figure out how to give a 30 microsecond pulse as an output from Pd, which leads me to ask, how long does a 'Bang' last? Is there another way to set up a pulsing mechanism where I can control the time interval of the pulse? Something like the pulseIn() function in Arduino IDE?