Dry wet control - how to implement ?
Thanks. This is a part of a bigger patch using the pd reverb
I'm getting considerably lots of clicks and pops.
do you see if I'm doing something wrong in my patch?
(I control the dry wet using a fsr reading from arduino)
A bug just for @jameslo on his expensive holiday
@jameslo That's a very interesting approach. I need to find some headphones to listen properly (feedback on laptop).
I find it difficult to source the appropriate words for what you have achieved...!
It seems stable with small arrays...... negligible cpu load.... 0%
Increasing the loop length after setting a high rate for the [phasor~] to the right inlet increases the load (on 3 cores - so for Pd and wish) on my machine to the point of a Pd hang..... otherwise, setting a long loop first, it seems to stay stable, but with a high load.
I wonder if there is an I/o bottleneck.
I reach just under 13% cpu but as that is an average over 8 cores it is pretty much 100% on a single core. It is the loop length that seems pertinent so keeping that constrained can avoid a hang..... but yes, it is heavy; brother.
As you have adapted from the c++ and used [value] I doubt that you have introduced any doubling or tripling of messages so it is probably as good as it gets...... unless there are more bangs to one of the [value] than necessary.
As it is a producer of echoes, maybe something could be relaxed? as latency is not a problem.
Also "echoes" as opposed to "repeats" used to have the "human" "quality" of degeneration for each cycle on analog tape so audio fidelity is less important....... aliasing etc. disappearing below the degeneration "threshold".
But as the work is being done at control rate there are probably no shortcuts available.
Another approach could maybe be writing 2 longer audio files and flip-flopping between 2 read heads (players)..... at a cost of loss of instant control and increased latency....... but with latency still within the timeframe of an "echo"
Great work...... your coding experience has proven useful within the constraints of a Pd patch..... rather than "externally".
It really is quite "something"
David.
Trying to create Variable speed delay, but buffer clears when read index is same as write index.
jameslo--- unfortunately that still has the same issue.... the echoes cut out when the heads pass
Can I suggest a specific scenario to test---
I am running it with the play speed at 0.7, feedback around 50%, with a live microphone on input 1. I snap my fingers near the microphone, and it begins echoing, with each echo at a slower speed and lower pitch... then every time the heads pass and the edge~ sends a bang, the echoes cease
I should also mention, I am running this on a Raspberry 4 model B with 2G RAM, using pd-L2Ork.... Trying to create a physical device with it eventually. that shouldnt effect something like this though, right?
Netreceive 3000 / Send2Pd on strike?
It looks like you forgot to call your functions at then end of your script. So simply adding those lines before print make it work for me:
audioOn();
setVolume();
Netreceive 3000 / Send2Pd on strike?
Hi,
trying to figure this out too. Followed the same tutorial. Nothing happens.
I am on OSX 10.14.6 Mojave running Pd 0.51-4
netstat -a --->
tcp46 0 0 *.hbci *.* LISTEN
tcp4 0 0 localhost.51108 localhost.51109 ESTABLISHED
tcp4 0 0 localhost.51109 localhost.51108 ESTABLISHED
tcp6 0 0 localhost.51108 *.* LISTEN
tcp6 0 0 localhost.51108 *.* LISTEN
tcp4 0 0 localhost.51108 *.* LISTEN
tcp4 0 0 192.168.100.86.51101 dj-in-f95.1e100..https ESTABLISHED
Python code:
import os
#write code here
def send2Pd (message=''):
# os.system("echo '" + message + "' | pdsend 3000")
#quoted out above and replaced with:
os.system("echo '" + message + "' | /Nicklas/Applications/Pd-0.51-4.app/Contents/Resources/bin/pdsend 3000")
def audioOn():
message = '0 1;' #Id = 0 (DSP), message=1 (turn it on)
send2Pd(message)
def setVolume():
vol = 80 #Set volume value (0-100)
message = '1' + str(vol) + ';' # make a string for use with psend
send2Pd(message)
print ("send to Pd done?")
Pd code
N-ply-window-opener and aligner (linux version)
Just killing time while I wait for something else, so I thought I would share this, which is quite useful to open and layout multiple windows at once.
#!/bin/sh
#requires: wmctrl, xdpyinfo
#wmtrcl syntax: wmctrl -r:{which window to move} -e 0,x off-set,y off-set,width,height
#variables:
#windows=the number of windows to open
#per=the percent of the screen height each window should take up
#slp=how long to wait (in seconds) before opening the next window (float) which can be adjusted according to your computer speed
#dir=the directory you want to open in each window
windows=5
per=0.75
slp=0.1
dir="/root/HOME"
screenwidth=`xdpyinfo | grep dimensions | sed -r 's/^[^0-9]*([0-9]+x[0-9]+).*$/\1/' | cut -d'x' -f1`
screenheight=`xdpyinfo | grep dimensions | sed -r 's/^[^0-9]*([0-9]+x[0-9]+).*$/\1/' | cut -d'x' -f2`
width=$(echo "$screenwidth / $windows - 6" | bc)
height=$(echo "$screenheight*$per" | bc)
xoffset=0
COUNTER=0
while [ $COUNTER -lt $windows ]; do
rox "$dir"
sleep 0.25
wmctrl -r:ACTIVE: -e 0,"$xoffset",0,"$width","$height"
sleep "$slp"
let COUNTER=COUNTER+1
xoffset=$(echo "$screenwidth / $windows * $COUNTER" | bc)
done
exit 0
So...
- !-check the code first to see if you approve, if you do then set it to executable
- set the parameters: number of windows, % screen height, path to the directory to open, and time to wait before opening each one.
- then put it in a good location, ex. in your pd-externals maybe, or ~/ somewhere
- send a link to it to your desktop...
then - at a click it opens and lays out across the screen that many copies of the set directory.
I use this constantly to better align my brain, work, and focus.
p.s. Puppy Linux users seem to like it...as it's been viewed over there a 1,000+ times on their forum.
May you find it useful.
Note: one thing that works well...is save multiple copies of it with different "number of windows" parameters, ex. 2, 3, 4, then send links to all of them to your desktop. So you can align your current view to your current state of mind.
Peace through Music.
Love through Sharing.
-s
mouse position and app superpositions
@pluxite In linux and probably OSX you can use ggee's shell external to run xdotool getmouselocation
, just bang it with a metro. It's output is not fun to parse and limitations of ggee/shell mean it will be easier to just write a simple bash script like eval $(xdotool getmouselocation --shell), echo $X $Y
, call this script (using the full path) instead of the command itself and you get a simple list of xy coordinates. xdotool can also do other fun things like send mouse or keyboard commands to other windows or screens.
Edit: Not sure what I was thinking, the heat must be getting to me, much simpler. Separating two commands with a comma fails with ggee/shell since it sends them too quickly, the first command is not done when the second arrives and it also opens a new shell for the second command so even with a delay the $X and $Y variables will not be set in this new shell. Simple solution is just to replace the comma with &&, now it is a single command, the echo command is only executed if the first succeeds.
Pd (LibPd) <-> JACK client: pd2jack
Another new release for pd2jack (v0.1.9):
https://github.com/GModal/pd2jack
New with v0.1.9, enabling interactive mode (-i) interprets a "live stream" of parameter pairs (in the console), which are passed on as "param" messages to the Pd patch. These work like the startup "parameter pairs," except for:
- No quotes are required
- Passed in real time during run
- Each pair is terminated with a newline
A stream of pairs might look something like this:
1 89
1 88
1 87
1 86
3 2180
3 2200
3 2221
3 2241
3 2261
4 19
NOTE: this has some cool implications -- a separate GUI application can act as a front-end, and "pipe" data into pd2jack.
So ANY GUI api could be used...just convert any input to parameter pairs and print them to the console. This isn't a crazy as it sounds -- two applications connected with a pipe are separate processes, and if the numeric char strings aren't actually printed to the console (the are not, with pipe), the CPU load is pretty small.
Here's a example of how it's invoked:
./revUI | pd2jack -i -p rev_i.pd
(where revUI is the GUI, and pd2jack is running the "rev_i.pd" patch in interactive mode.)
Simple video demo:
There are other options for IPC with Pd (netsend, netreceive & some custom objects) and piping the console might feel like a hack, but it is simple and quick. An additional method (sockets?) might be added to pd2jack in the future...(yeah, I'm thinking maybe a plugin interface).
It's also been suggested this mode might be useful for people with disabilities. I've also successfully piped the output of pd2jack to a speech synthesis module, sending text via Pure Data's [print] object, as well as any info output in "verbose" mode. Of course, that could probably be done in a normal "headless" Pure Data.
Interactive Mode Special Commands (w/ "@" prefix)
Interactive mode also includes a set of special cmds, for controlling some internal operations. Each of these cmds is preceeded with an "at" symbol (@), to differentiate the cmds from the parameter stream. Here's a list:
- @openPatch <name> : load a different patch into the LibPd space (closes current patch first).
- @closePatch : closes the current patch
- @reopenPatch : reopens the last valid patch (patch can be closed or already open)
- @im_sleepTime <int> : sleep time (ms, 5-500) between data fetches for interactive mode.
Invoking "@reopenPatch" on an already open patch will reload the patch.
I expect more cmds will be added in the future.
Reverb
@Claire080499 There are various ways to fake reverb through the control side, they generally do not sound much like reverb but within the context of a song they can achieve the same goal. This sort of trickery was common back when computers could not do real time reverb but often had reasonably capable realtime synthesis or sampling abilities. The most basic approach was just to duplicate the track with decreased pitch and volume and increased decay, from there you can add duplicate tracks with slightly delayed note information to get echos, filtering to making it less clear, options are endless and very idiosyncratic to the sound you are trying to add "reverb" too. Doing that most basic approach in pd with your drum machine would only take having a second drum tuned lower with very little volume and a long decay triggered by the same sequence, and you can use [pipe] to delay the midi to add echos as well. Researching into how they faked it on the old Tracker sequencers and on the old hardware synth chips will give you some ideas.
Starting a Pure Data Wiki (Database/Examples Collection)
Just to give an idea of the kind of resource I'm talking about; here is a rough version of the kind of entry that I can put together just using my bookmarks. Nothing too technical, just a collection of useful stuff put together in one place.
Reverb
Reverberation (or reverb) is the effect generated by many copies of a sound with different delays summing together due to reflections off the boundaries of a space. In contrast to echo, the individual copies are not distinguishable but overall effect typically makes the sound richer or fuller.
Pure Data Vanilla comes with three reverb examples in the extras; in Help>Browser they should appear under ‘Externals’.
freeverb~ is a PD external offering ‘studio-quality Schroeder/Moorer reverb’
https://puredata.info/downloads/freeverb
(example usage: https://guitarextended.wordpress.com/2012/01/24/reverb-effect-in-pure-data/)
Examples:
- Tom Erbe’s reverb patches
(allpass, Schroeder, Moorer, Moore, Gerzon/Stautner/Puckett, Dattorro)
http://tre.ucsd.edu/wordpress/?p=625 - Choucroute FX by coloscope
https://patchstorage.com/la_choucroute_fx/
Tremolo/reverb effect : “harmonic tremolo” found in early 1960s amps. - 282~ reverb (Ursa Major SST-282) by acreil / whale-av
https://forum.pdpatchrepo.info/uploads/files/1516212572597-working.zip - Freeverb Vanilla
https://github.com/derekxkwan/pd-vfreeverb
Derekxkwan’s cleanup of Katja Vetter's Pd-vanilla freeverb abstraction - ELSE library
https://github.com/porres/pd-else
Contains [mono.rev~], [stereo.rev~], [echo.rev~], [giga.rev~], [free.rev~]
PD Forum discussion of the subject: https://forum.pdpatchrepo.info/topic/11622/reverberation
Further reading:
https://www.soundonsound.com/techniques/springs-plates-buckets-physical-modelling
Sound on Sound ‘Synth Secrets’ article on Reverb
See also: Delay/Echo, Resonators, Convolution