Trying to create Variable speed delay, but buffer clears when read index is same as write index.
@ryan7585 But the behavior you describe is the expected behavior, isn't it? When the record head overtakes the play head, it's only printing the input + what the play head is reading. But the play head is only reading what's just been recorded by the record head, which is just the input, i.e. your previous feedback is lost.
I wonder whether [delwrite~] and [delread4~] with feedback and a phasor-driven delay amount would do what you want, e.g. G09.pitchshift with feedback.
Trying to create Variable speed delay, but buffer clears when read index is same as write index.
That's how I originally had patched it, but the goal is to have independent read and write heads. So I can record at 1x speed constantly, then read at whatever speed I want. So fed-back echoes get pitched up or down on each repeat and there is freedom for reverse delay, etc.
So essentially, it is unavoidable that the read head and write head will pass each other occasionally. I just need it to not glitch out when that happens.
The "equal-block" subpatch ensures that the tabread object is sent a "-1" rather than the current index, any time the read and write head are too close to each other.... you can set the size of that window inside the subpatch. maybe that "-1" is not something I should send?
It seems like no matter what I do, the array clears when the heads pass each other :/
Trying to create Variable speed delay, but buffer clears when read index is same as write index.
@ryan7585 Maybe........ I just had a cursory look..... use a single [phasor~] so that the read and write heads are always phase synced..... adding your offsets afterwards with an additional [+~ 1] for the read head (or a [-~ 1] for the write head which it looks as though you have implemented in your sub-patch but ?) to ensure that the read head is always later than the write.
Here is one that works....... but uses [ipoke~] ...... so currently 32-bit Pd only...... space_echo.pd
See - https://forum.pdpatchrepo.info/topic/13234/tape-loop-effect/8 ......
David.
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
How to send multicast audio in Pure Data?
@romulovieira-me After further reading...... yes... you probably need to tell the interface on the receiving computer to join the group.
This is useful reading........ https://tldp.org/HOWTO/Multicast-HOWTO-2.html ....
But if you ping 239.0.0.1 from your sending computer you will probably find that r-inspiron3442.local is already a group member (as osc is working).
If that is the case then [streamin~] is the problem as it never makes a request to the os to receive a multicast address.
If the ping is not returned then do a google search for "Linux '(whichever) IGMP" to find out how to join the group.
David.
[SOLVED]video still remains after disconnecting [ofelia d] script
I've modified some abstractions created by @60hz for prototyping fast with ofelia (BTW, thanks a million for your abstractions they're great! And of course a million thanks to @cuinjune for creating Ofelia!). Things seem to work OK, but there's this happening. I have the following patch (I've changed the names from [gl.draw] to [ofelia.draw] for this and other abstractions)
[ofelia.draw]
|
[ofelia.cube]
and I see a white cube in the Ofelia window. Then I make the following connections:
[ofelia.draw]
|
[ofelia.movie]
|
[ofelia.cube]
and I get a video playing in the same cube. Till now everything is fine. But if I go back to the first patch, I don't get a white cube anymore but a still from the video file from [ofelia.movie]. Here are the scripts of the abstractions (almost identical to @60hz abstractions):
[ofelia.draw] (I'm returning ofColor because I want to have all abstractions output pointers and not bangs, maybe there's a better solution for this):
ofelia d draw$0;
local c = ofCanvas(this);
local args = c:getArgs();
local depth = true;
local screenwidth;
local screenheigh;
local widthHeigh;
;
function M.new();
if args[2] == nil then depth = true;
else;
M.depth(args[2]);
end;
if ofWindow.exists then;
screenwidth = ofGetWidth();
screenheight = ofGetHeight();
end;
end;
;
function M.screensize(list);
screenwidth, screenheight = list[1], list[2];
end;
;
function M.depth(string);
if string == "3d" then;
depth = true;
else;
depth = false;
end;
end;
function M.bang();
ofSetDepthTest(depth);
ofTranslate(screenwidth*0.5, screenheight*0.5);
return ofColor(255, 255, 255);
end;
[ofelia.movie]:
ofelia d -c17 videoplayer-$0;
local canvas = ofCanvas(this);
local args = canvas:getArgs();
local videoplayer = ofVideoPlayer();
local filename, start, loop = args[1], args[2], args[3];
local loaded = 0;
;
function M.new();
ofWindow.addListener("setup", this);
if args[1] == nil then print("No file found");
else M.open(filename);
end;
if args[2] == 1 then M.play();
end;
if args[3] == nil then loop = 0;
end;
end;
;
function M.free();
ofWindow.removeListener("setup", this);
end;
;
function M.setup();
M.open(filename);
end;
;
function M.open(string);
if ofWindow.exists then;
videoplayer:close();
videoplayer:load(string);
if (videoplayer:isLoaded()) then;
print("loaded " .. string);
videoplayer:update();
end;
end;
end;
function M.url(string);
if ofWindow.exists then;
videoplayer:close();
videoplayer:load(string);
if (videoplayer:isLoaded()) then;
print("loaded " .. string);
videoplayer:update();
end;
end;
end;
function M.play() videoplayer:play() end;
function M.stop() videoplayer:stop() end;
function M.pause() videoplayer:setPaused(true) end;
function M.speed(float) videoplayer:setSpeed(float) end;
function M.frame(float) videoplayer:setFrame(float) end;
function M.volume(float) videoplayer:setVolume(float) end;
function M.loop(float);
if float == 0 then videoplayer:setLoopState(OF_LOOP_NONE);
elseif float == 1 then videoplayer:setLoopState(OF_LOOP_NORMAL);
elseif float == 2 then videoplayer:setLoopState(OF_LOOP_PALINDROME);
end;
end;
function M.get()
return ofTable (videoplayer, videoplayer:isLoaded(), videoplayer:isPlaying(), videoplayer:getCurrentFrame(), videoplayer:getTotalNumFrames(), videoplayer:getWidth(), videoplayer:getHeight());
end;
;
function M.pointer(p);
videoplayer:update();
videoplayer:bind();
return videoplayer;
end;
function M.bang();
videoplayer:update();
videoplayer:bind();
return videoplayer;
end;
Inside [ofelia.movie] there's this patch:
[ofelia d movie_script] <- this is the ofelia object that loads the script above
|
[t a a]
| |
| [outlet]
|
[ofelia d videoplayer_unbind;] <- this is one object
[function M.pointer(p); ]
[p:unbind; ]
[end; ]
and this is [ofelia.cube]:
ofelia d $0-box;
local c = ofCanvas(this);
local args = c:getArgs();
local width, height, depth, resw, resh, resd, drawmode, strokeweight = args[1], args[2], args[3], args[4], args[5], args[6], args[7], args[8];
local position, orientation, scale = ofVec3f(0, 0, 0), ofVec3f(0, 0, 0), ofVec3f(1, 1, 1);
;
function M.new();
ofWindow.addListener("setup", this);
if args[1] == nil then width = 100 end;
if args[2] == nil then height = 100 end;
if args[3] == nil then depth = 100 end;
if args[4] == nil then resw = 5 end;
if args[5] == nil then resh = 5 end;
if args[6] == nil then resd = 5 end;
if args[7] == nil then drawmode = "fill" end;
if args[8] == nil then strokeweight = 1 end;
M.setup();
end;
;
function M.free();
ofWindow.removeListener("setup", this)
end;
;
function M.setup();
box$0 = ofBoxPrimitive();
end;
;
function M.resw(float) resw = float end;
function M.resh(float) resh = float end;
function M.resd(float) resd = float end;
function M.width(float) width = float end;
function M.height(float) height = float end;
function M.depth(float) depth = float end;
function M.draw(string) drawmode = string end;
function M.stroke(float) strokeweight = float end;
function M.position(list) position = ofVec3f(list[1], list[2], list[3]) end;
function M.orientation(list) orientation = ofVec3f(list[1], list[2], list[3]) end;
function M.scale(list) scale = ofVec3f(list[1], list[2], list[3]) end;
;
function M.pointer(p);
ofSetLineWidth(strokeweight);
box$0:setPosition (position:vec3());
box$0:setOrientation (orientation:vec3());
box$0:setScale (scale:vec3());
box$0:set(width, height, depth, math.abs(resw), math.abs(resh), math.abs(resd));
if drawmode == "fill" then box$0:drawFaces() end;
if drawmode == "point" then box$0:drawVertices() end;
if drawmode == "line" then box$0:drawWireframe() end;
return p;
end;
function M.bang();
ofSetLineWidth(strokeweight);
box$0:setPosition (position:vec3());
box$0:setOrientation (orientation:vec3());
box$0:setScale (scale:vec3());
box$0:set(width, height, depth, math.abs(resw), math.abs(resh), math.abs(resd));
if drawmode == "fill" then box$0:drawFaces() end;
if drawmode == "point" then box$0:drawVertices() end;
if drawmode == "line" then box$0:drawWireframe() end;
return anything;
end;
This is a bit too much information but I think it's necessary if anyone can help. There's probably stuff I'm ignorant of. @cuinjune any hints?
Kinect V2 Data skeleton
@jameslo the ID's are generated randomly each time a new user come in the field of view. The second example is just a quick hack to make something "quickly work" but the real attempt is in the patch from the zip file (with a simple Kinect user data simulator)
@ingox the thing is I don't need to find the lowest ID, but to route the list of the ID which contain the smallest Z head position in the list. For example if I have 2 ID incoming:
print: /bodies/000000001/joints/Head 0.321555 -0.0569061 0.2 Inferred
print: /bodies/000000002/joints/Head 0.321555 -0.0569061 0.1 Inferred
then, I need to route only the list which have the smallest head z position:
print: /bodies/000000002/joints/Head 0.321555 -0.0569061 0.1 Inferred
@whale-av I guess you talk about occlusion here, the last list element is trackingState (Tracked, NotTracked or Inferred), I guess I need to think about it also but it's another step ahead.
Colored video made with pure data : Raffaella de Laurentiis
In all the following videos, only the VISUAL part is made in pure data.
Liberté - Il pleut ( a rythme is a color for your mind )
Beirut - Il pleut
Il pelut - Il Pleut
Since graphics in Pure data are parametrique, you can export high resolution videos and images. You'll need a big screen or a tool to emulate a high resolution.
Nature - Il Pleut
All video made with pure data. One of the patchs used :
How to detect a hit on the guitar strings (coming through [adc~]) and use it as a simple bang trigger
@toxonic Thank you very much for your help. Indeed you helped me out a lot with your suggestions, especially to use [bonk~].
[bonk~] is really good, since it allows me to learn specific signal patters (i.e., in my case the hit with the hand on guitar strings), and it is able to detect it in the followup microphone coming from the guitar.
This hit detection got really messy using the [fiddle~] or [sigmund~] since there was a need to filter the power in specific frequency ranges and the amplitude of certain frequencies when the very percussive hit on the guitar strings happens. The problem is really complex if one wants to discern the guitar strings hit during a regular guitar playing with many events happening at the same time.
How to detect a hit on the guitar strings (coming through [adc~]) and use it as a simple bang trigger
Greetings.
I frequently use a live guitar in my PD patches, I route it through the mic input [adc~]. But now I am facing a problem, that you might help me with.
I am interested in detecting in PD the moment of hitting the guitar strings with the hand, e.g. like using a hand to drum on the strings.
It is a very percussing sound, similar to a snare hit.
I would like to detect this hit on the guitar strings in PD (coming through [adc~]) and use it as a simple bang trigger.
It would be easy to use the [fiddle~] attack output, but I don't want the trigger on any other guitar playing event (e.g., chords, notes ...) except on this percussive hit on the strings.
Do you have any guidance on where to start to tackle this problem?
I don't have the slightest idea where to search for information regarding this topic.