Frank Barknecht's Collision-detection patch
hi all, doing a little 2d collision detection here very simple and i found frank' patch here: [html]http://www.mail-archive.com/pd-list@iem.at/msg06087/collision-detection.pd[/html]
if you run the patch asis, the collision detection occurs only when the middle of the smaller circle hits the outside of the bigger circle...
i can see the variable the changes this.
i.e. i want the collision detection to occur when the outside of the smaller circle hits the outside of the bigger circle.
if im not clear i can attempt a rephrase, but any help on this matter would be greatly appreciated...
im sure its a number box somewhere but i cant see where
thank you.
Changing length of beats/steps/something......?
The reason why it's not working until you open [wrap~]'s help window is because audio needs to be turned on. The help patch does this automatically with:
[loadbang]
|
[; pd dsp 1(
So I'll try to explain how this patch works. It's based on using a master [phasor~] object for everything to sync to. I used beats per minute because Hz is the same thing as cycles per second. By dividing bpm by 60, you get beats (cycles) per second. It's just easier math (to me) than using ms, and it's more musically intuitive anyway.
The signal for the [phasor~] is multiplied by the beat division, scaling its range. So if you want the beat divided into four subdivisions (16th notes), it will be scaled up from 0-1 to 0-4. [wrap~] takes a signal and wraps it around so that it falls within a range of 0-1, so 2.3 will become .3, etc. It essentially just gives you the fractional part of a number. Sending the scaled up [phasor~] output to this results in a ramp that is synced to the subdivision. This is then subtracted by .5 to scale the range from -.5 to .5, just so there are some zero-crossings.
[zerox~] is used to detect the zero-crossings. It doesn't seem to have a helpfile, and I'm not sure what the difference between the to outputs are. I just know they very briefly spit out a 1 when crossing zero. [edge~] detects sudden jumps in a signal and outputs a bang, which is used to drive the counter.
It's just occured to me that [zerox~] detects zero-crossings going up and down, and I designed the patch with the idea that it should only detect signals crossing downward. So it's actually going twice as fast as it should! Dividing the bpm by 120 instead of 60 should remedy that.
Hope that helps.
Effects processor/instrument/sampler looper thing
ok well
to get everything going i usually am wearing headphones just to test it out
press 1 and 5 to turn on the dsp and get the effects line going
press L to load a wav sample
k to analyze the sample
turn up the volume on the sample looper boombox
now depending on wether or not the the enable reaction box or enable BPM box is connected to the box directly to the left will connect it to a specific bpm or it will react to incoming or playing sound
after switching from box to box i find it makes me turn the boombox on and off so just press 5 and 1 twice
so now turn the filter bank on by pressing F
start talking or making some noise
press the space bar
until you hear whatever sound being frozen then make some sort or loop
press F again when you are done and wait until you see
the loop appear in the odisto array
then press A to analyze that loop turn up the volume in the glitch section
the choice of reaction and BPM has to be the same as the boombox for it to work
correctly
if you use the bpm the green vslider next to the volume will set it
but its not really bpm as much as it is just a way of timing
pressing loop (H) will just make the sections of the loop keep playing over and over
the delay can be used by plugging the bng into the hslider or plugging the ranom box into the hslider if you just plug the bng into it though you would have to manually set the delay amount
in order for the panning to really get interesting you can connect the top bng in the panningreact box to the metro 250 then connect that metro 250 to the bng right below it you can set the speed with the panning speed hslider
the panning yellow box with the car mod index sliders changes the different panning you can turn on by pressing (3)
on both the wah and pitch vslider the inside slider is for the actual amount of wah or pitch change and the outside vslider is for the speed at which it changes if it is turned on (6,7,8,9)
the random pitch (i) random wah is pretty fun for messing round with or you could just manually set the amount of change
the distortion doesn't have to be turned on in oder for it to work only for the slider to give it some power
the shaper gives you amount, depth, limit, and gain controls
and the ASD/size/global
attack/sustain/decay size and global amplitude
the ASD can be used for shaping the sound and the global can be used for a volume control
at this point i would hope this is making a little more sense if not just ask i really just wanted to see if anybody else would use something like this
im also going to post a 6 channel simple looper that i have been messing with that i am starting to like
any input would be awesome
paul
Analyse sound files and environment
@rubini said:
- How to analyse sound files from one directory? BPM and average Freq. of sound signal.
If you have easily detectible accents in your sound file (i.e. a staccato melody with heavy accents on the beats, or percussive samples) you can use [bonk~] to detect those, then connect it to a BPM detector. I have attached this patch that I use for detecting tap-tempo. If you connect the bang object that is used to determine the tempo to the outlet of [bonk~], I believe you can get the BPM.
For getting the frequency you can use [fiddle~]. See its help file for detailed info.
I assume you need such a patch for analyzing your audio input in real-time, if not, it is better to make all of the analysis in advance, and change the parameters of your patch in the way you want anytime you load a new sound file...
Sample Player
Hi
I have some newbie questions about Pd. I wanted to write a Patch which is based on this one:
http://puredata.hurleur.com/sujet-643-sample-player
The mentioned Sample Player has 2 Sliders which control the Start-/End-Loop position which is the exact thing what i was looking for.
What i want to do?
I want to make a patch, a sample player. When i press a button i want to loop the actual sample position according to the key i have pressed.
I give you an example. I load a loop which is 120 BPM fast. I set somewhere my tempo. When i press "a" it starts looping 1/4th at the actual play position.
For this sort of thing. The Sample Player seems to be perfect. But now there are the difficulties.
How can i set the tempo right? I figured out how to calculate the tempo for any note length.
How can i get my keyboard entries into the software?
And lust but not least. How can i get the Patch to act how i would like.
I know...dumb question you know too. But maybe there is someone who knows one answer.
Many, many thanks.
Simple sequence detection?
I'm fairly new to PD and am having trouble figuring out how to do something quite simple. I want to be able to get a bang whenever a certain sequence of two tones is heard by PD. I'm using fiddle~ to do the pitch detection and am able to detect single tones, but I want to be able to detect a sequence. For example, if I detect a pitch 61 followed by pitch 74, I want to output a bang. If I detect pitch 61 followed by any other value, I don't want any output.
In C, I would write something like:
if ((current_value == 74) && (last_value == 61)) do_something();
How do I do this in PD?
BPM object or something like it?
What I've done when trying to write my own drummachine :
- accept bpm input (e.g. a number box) and convert that
bpm value to the corresponding ms value to trigger a metro - to work with divisions of the base bpm i just divide or
multiply the base ms value with the correct factor
In the meantime i have about 8 different patches i use regularly. Most
of them however, excepta few, have their timing in ms, since that seems
just more natural in pd (all time related objects deal with ms). Therefore
i created a "masterclock" patch where i can tap tempo and convert between
ms <-> bpm. Those values can be sent to all other patches.
One more thing, when starting with pd i also found the millisecond thing very
bizare. In the meantime, i've started to think myself more in milliseconds than in bpm .
I hope this helps (a little)...
Domien
Using messages to set properties of other things
ayeee
I've got a metronome triggering slices of a breakbeat and I've set up a way to shift every second metronome bang using a delay object and spigot objects. By altering the delay you can create more or less of a swing to the metronome bangs. However obviously you can only delay the bang so much before it appears in sync with the next bang and this is based the tempo that your working at.
so...
I'd like to use the tempo to calculate a range for the delay.
i.e
If the tempo was 120BPM then the metronome will be 'BANG'ing every 500 ms
so the rage for the delay would be from 0 ms to something less than 500 ms (lets say 450)
If the tempo was 240BPM the metronome will be 'BANG'ing every 250ms
so the range of the delay would be from 0 ms to say 250 ms ( so.... like ..... 225)
so yeah
I'd like to generate the minium and maximum for a vertical slider based on the tempo at run time
hmmmmmm.....
I hope that's kiind of clearer but looking back it's quite long winded
I'm sorry.
let me know if it still doesn't make any sense.
Thank youuuuu
Iain
Any slicers or offset samplers in PD?
i think there are plenty of methods of doing it.
lets say we had a tempo of 180 bpms
each bar would be 1.33 seconds.
lets say that we didnt really need to slice every transient(is that the name for it?)
but we wanted to simply take a preciesly cut amen and loop it and sync it but cutting it into 8 parts
then we sould have figure out an algorithm like.. 1.33/8(?)to get how many ms the 1/8 segments are(??) sorry nmy math might be wrong but you get the idea.
and if the tempo decreases or increases just scale the tempo change up or down where 1.33 was t he bar length at 180bpm...
Sukebe waraii
I like that track, kept me interested and made me smile, and when it finished I wanted to listen to it again - I've listened to it about 5 times this evening. Good work!
I've been trying to make similar sounds. I'm working on doing more live stuff with Pd, it's mighty fun, I can spend hours twiddling with midi knobs making freaky noises. I think I spend too much time fiddling with the knobs and not enough time enhancing my patches - I've not got much to show for the last six months of Pd-ing.
At first I was mapping each midi knob to a single control of the patch, but poorly thought out - in one patch I have 4 breakbeats, and I had 4 knobs mapped to the bpm control of each beat - "bpm 1", "bpm 2", "bpm 3", "bpm 4" - and it was a nightmare trying to get anything to sound good with it. Now I am trying to have more useful controls - "master bpm", "second pair/first pair bpm ratio", "pair 1 bpm spread", "pair 2 bpm spread". Still having 4 knobs to control the 4 bpms, but in a more musically useful way. Like a mathematical change of basis or change of coordinate system.
Another way I am trying to make live performance easier is using algorithmic processes - instead of controlling every beat I control aspects of a process that generates the beats - instead of being the drummer and the bassist and whatever else I am more of a conductor or director, controlling "jitteryness" or "density" or whatever. These processes can have a random part, so the live performance takes on a new element of reacting to the unpredictable output.