Puredata, Jack and multi channel audio (only 2 channels showing, not 4)
I am trying to get the four channels available from puredata into the Jack audio server. I have selected 4 channels in the audio output settings.
For some reason, Jack only appears with 2. Anyone know why this is the case and how I might go about getting the other two channels appear? I am trying to achieve this so I can send audio from puredata to different speakers in a bluetooth syste (two seperate bluetooth modules, with a stereo channels).
The same thing happens with pipewire- only two channels are available in the virtual audio stream. Ive also attached photos for both of these audio servers. Help would be greatly appreciated.
The channels DO appear in pulseaudio however, and I have included pictures of this
Thanks for your help. Below photos demonstrating some of the settings. I am running linux mint
pd media settings
the four channels setup to go to ALSA: jack
there are only two channels appearing in Jack from puredata, not four
however, the channels do appear in pulseaudio volume control
but also does not appear in pipewire
CPU load with Purr-Data and GEM
Hi there,
I started dealing with GEM and implemented a very simple patch that simply plays back a video. When I run this patch with pd-gem the playback is all good. But with purr-data the playback stutters since the CPU load is too high. Please find attached screenshots of the patch and atop while running the patch with purr-data and pd-gem.
The pd version with purr-data and pd-gem is slightly different, but I assume that this is not the root cause. So, what is the problem with purr-data and how can I solve it?
Thank you in advance!
Andre
-- purr-data --
Purr-Data 2.19.3
Pd version 0.48.0
GEM version 0.94
-- pd-gem --
Pd version 0.52.1
GEM version 0.94
espd - tutorial
Hi all!
I had some time during vacations and I wanted to try running Miller's espd version. Here's a small tutorial.
The development board I bought: ESP32-LyraT > Mouser | Aliexpress
INSTALL ESP-IDF (IoT development framework)
mkdir ~/esp && cd ~/esp
git clone -b v4.4.2 --recursive https://github.com/espressif/esp-idf.git
cd esp-idf
./install.sh esp32
INSTALL ESP-ADF (audio development kit)
cd ~/esp && git clone --recursive https://github.com/espressif/esp-adf.git
SETUP ENV VAR
export ADF_PATH=~/esp/esp-adf && . ~/esp/esp-idf/export.sh
ESPD
download espd: http://msp.ucsd.edu/ideas/espd/
cd espd
git clone https://github.com/pure-data/pure-data.git pd
cd pd
git checkout 05bf346fa32510fd191fe77de24b3ea1c481f5ff
git apply ../patches/*.patch
Edit main/espd.h put your wifi credentials and the IP of the computer that will control espd:
#define CONFIG_ESP_WIFI_SSID "..."
#define CONFIG_ESP_WIFI_PASSWORD "..."
#define CONFIG_ESP_WIFI_SENDADDR "...."
mv sdkconfig.lyrat sdkconfig
idf.py build
idf.py -p /dev/ttyUSB0 flash (hold boot and then press reset on lyrat)
idf.py -p /dev/ttyUSB0 monitor (Ctrl+] to exit)
HOST
- open pd installed on (SENDADDR)
- open test-patch/host-patch.pd
If connected this message (ESPD: sendtcp: waiting for socket) will stop and you will see the mac address in the host patch.
1- click on [send pf begin-new poodle .<
2- click on [line 0, auto< to send the defined patch (esp-patch.pd)
3 - click [send pd end-new<
4 - connect headphone, play with [send f 440< and [send f 660<
Custom patch:
- Use mono [dac~ 1] only
- Add this to your patch:
- in host-patch.pd change [read your-patch< -> [text define patch] redo step 1 to 3
TODO
Would love to play more with the code, right now I am not able to load complex vanilla patch. Also using the AUX (or built-in microphone) would be awesome (but I'm wondering about the round-trip latency (would it be under 15ms)).
I'm trying to build filters with [pole~] [zero~],but I'm so confused with the factorization of the two-zero transfer function:
I tryed to use Cross multiplication and Conjugate roots to factor the transfer function of two-zero feed-forward filter but...I can‘t get the result like :
(1-Z1z^-1)(1-Z2z^-2) on p362.
The name of the book is Designing Audio Effect Plugins in C++
Same function can be found here but no explation about how to factor:https://ccrma.stanford.edu/~jos/filters/Two_Zero.html
GEM: Transparent-before-opaque draws strangely
I'm sure there's an explanation for this, but I'm having trouble imagining what it is.
This patch is drawing first a green cube with low opacity (90% transparent), and then drawing a red cube with high opacity (10% transparent). I would have expected the more-opaque red color to dominate -- you would see mostly the red cube, with faint bits of green sticking out in places.
Instead, we see through the green transparent parts all the way to the black background, and the red is visible only outside those bounds.
Am I right in thinking this is really weird?
Let's say in the real world you have a large green glass cube, empty in the middle, mostly transparent, and you put a small opaque red cube inside it. The red cube will block the background. But in this patch, if you do the same thing by reducing the red cube's size to, say, 0.1, then the red cube disappears!
By contrast, if you reverse the transparency (opaque green, transparent red), then you get an expected result.
[alpha]'s help file does mention that opaque elements should be drawn before transparent ones, but that would seem to require some fancy tap dancing if the objects' alpha values will change -- in this patch, I would have to flip the positions of the two drawling chains depending on the value of the top-right toggle. I guess the easiest way would be with separate [gemhead]s and switch their rendering order?
I still think it's weird.
hjh
Colored things - and pixels
Data structures always. The first, the blue one, is the result of a stack overflow..
banging [switch~] performs audio computations offline!
According to block~ help, if you bang [switch~] it runs one block of DSP computations, which is useful for performing computations that are more easily expressed as audio processing. Something I read (which I can't find now) left me with the impression that it runs faster than normal audio computations, i.e. as if it were in control domain. Here are some tests that confirm it, I think: switch~ bang how fast.pd
The key to this test is that all of the bangs sequenced by [t b b b b] run in the same gap between audio block computations. When [switch~] is banged, [osc~] fills array1, but you can see that element 63 of array1 changes after [switch~] is banged. Furthermore, no logical time has elapsed. So it appears that one block of audio processing has occurred between normal audio blocks. [bang~] outputs when that accelerated audio block processing is complete.
This next test takes things further and bangs [switch~] 10 times at control rate. Still, no logical time elapses, and [bang~] only outputs when all 10 bangs of [switch~] are complete. [rzero_rev~ 0] is just an arcane way of delaying by one sample, so this patch rotates the contents of array1 10 samples to the right. switch~ bang how fast2.pd
(There are better ways to rotate a table than this, but I just needed something to test with. Plus I never pass up a chance to use [rzero_rev~ 0] )
Finally, I've seen some code that sends a 1 to [switch~] and then sends 0 after one block of processing. In this test you can see that one block of audio is processed in one block of logical time, i.e. the normal way. switch~ bang how fast3.pd
But that second test suggests how you could embed arbitrary offline audio processing in a patch that's not being run with Pd's -batch flag or fast-forwarded with the fast-forward message introduced in Pd 0.51-1. Maybe it's an answer to two questions I've seen posted here: Offline analysis on a song and Insant pitch shift. Here's a patch that writes 20s of 440 Hz to a file as fast as possible (adapted from @solipp's patch for the first topic). You just compute how many blocks you need and bang away. write440File.zip
Here's another that computes the real FFT of an audio file as fast as possible: loadFFT.zip
But as with any control rate processing, if you try to do too much this way, Pd will fall behind in normal audio processing and stutter (e.g. listen to the output while running that last patch on a >1 minute file). So no free lunch, just a little subsidy.
Contribute to better Pd Documentation
As a Puredata teacher in a fine art school since 10years (and many workshops in China) the only solution for me to make pd "usable" by my students, was to distributed my own puredata version modified with translated help files from an "computer-scientist" to an "artist" point of view, and with many extra things.
@whale-av said:
Maybe adding a "Documentation" link to the console help menu would be a good first move....?
I agree, if only clickable link could be added to console.
The doc subfolder names are not enticing..... "3.audio.examples" really could be "3.digital.audio.tutorial" for example.
I don't think there is even a link to it in the "HTML Manual" which becomes "PD Documentation" when it is opened.
All very confusing though as the Pd.doc folder is mostly a patching tutorial that complements the Floss manual.
I agree, the documentation could a bit more explicit and well organised. I simply don't use it and added mine.
Finally, Here is an example of my pd version that I throw to students now to have a chance to keep them in the game:
-
I am using ceammc a lot, and added some objets and a simple theme:
-
I added a template for every new patches and some personnal icons to ceammc bar:
-
Here is my Intro-help.pd (accessible from any right clic in a patch)
-
I added my own fast prototyping ofelia abstractions:
-
The right click show all the objects (also have auto-completion of course)
I think right-click on objects should propose "Online Reference" that lead to an online up-to-date documentation... or wiki.
Debugging Externals With Xcode 12
For anyone interested, I was able to figure out how to do it using the original guide for earlier Xcode versions. The mistake I was making was to attach the full package of Pure Data to the debugging scheme as the executable. The correct way of doing it is to link the actual executable file as described below.
In Xcode (this is v 12.3):
- Create a new debugging scheme
- Edit the new scheme:
- In the Executable drop-down menu, select Other...
- Find the executable for pd (e.g. /Applications/Pd-0.51-3.app/Contents/Resources/bin/pd)
The settings for the scheme should look like this (notice the setting for Launch - Automatically)
- Build and run the external. This will start Pd. The actual debugging will begin when you instantiate the external object inside a patch.
In my case, I added a breakpoint inside the bang() method. Upon receiving the bang, the breakpoint is reached:
ceammc PureData distribution v2021.04 and ceammc v0.9.3 is out
We are happy to announce ceammc PureData distribution v2021.04 and library of externals v0.9.3.
Main features:
- preset interpolation
- [speech.flite~] realtime text to speech object
- [ui.filter] and [ui.filter~] added
- experimental [ui.faust~] and [lang.faust~]
- [ui.midi] - display for incoming midi messages
- [ui.button] - output on mouse down/up
- midi.* objects: [midi.clock], [midi.kbd] (virtual keyboard), [midi.sustain], [midi.vrand] etc.
- [array.plot] object
- conv.bits2* - helper objects for sequencing to convert lists of 1 and 0 to notes
download:
https://github.com/uliss/pure-data/releases/tag/v2021.04
verbose Changelog:
https://github.com/uliss/pure-data/blob/ceammc/ceammc/CHANGELOG.md