How to populate 1 array with 4 incomming number streams
Hi all,
This should be the easiest thing in the world, but I cant for the life of me figure it out.
I need to populate an array with input from four different number streams were the order of appearence of numbers in the stream puts them into an queue to bang messages from 0,1,2 etc.
A brief explanation
I presume is pretty
easy when you know how, but A brief explanation of the project might be in order
The idea is to back project onto a series of screens and give people
IR LED "paintbrushes" so they can paint with procedural graphics and
sound.
We're using "touchlib" blob tracking software (and webcams)to
differentiate between the blobs. the software assigns each blob a
numbered ID for the length of its lifetime, based on the order in
which they come into existence : so the first blob in existence is "ID
0" (until it dies, when it takes its pace in the queue), the second
is "ID 1" etc.
These IDs allow us to assign specific graphics to different blobs in
Processing, and also to give each an individual piece of audio.
Its easy with just one machine sending these messages as each ID
corresponds nicely to the order of tracks to be triggered in the
sequencer,
but we're using four separate modular machines each running touchlib
and we want the sound to be global.
We have networked the machines and each of the four graphics modules
can talk to the machine running the sound. The sound module is running
PD which receives messages from the other machines and then sends MIDI
messages to the sequencer. So PD is getting four streams of numbers -say from zero to three- which correspond to the order in which touchlib blob IDs pop into existence - (each stream local to its own machine)
these numbers trigger a fade in/out of a
mixer track in say for example Reason). Ideally the first person who enters the space will
trigger some pad sounds (fader 1 in reason say) regardless of which
screen they paint on.
that way it will work if there is only one person in the space. The
next person would trigger some percussion, and the full track would
build naturally. The alternative is to have every ID locked to a
sound, meaning it would really only work for four people in the space.
So to the question. There are 4 data streams coming into PD, literally
numbers 0 - 3 in each number box. as you can see in the
"four_machine_dilemma"patch attached.
what I need to do is fix it so that if (and only if) computer A has
sent a message triggering track 1 that computer B, or the next stream,
when it sends its own "ID number 1" is converted to ID number 2 , that
is, it occupies the next position in the global array, triggering
track two (because track 1 is occupied) even though it thinks it is
"ID number 1", and so on down the chain.
is there some way to store a boolean for the track's on state and use
it to reassign a value to the next incoming message?
Or just to fill positions in an array with the incoming messages in
the order they are received. It seems like it it should be
straight-forward but I'll be buggered blind if I can figure it out.
Hope this is not to long winded for a simple question.
Thanks in advance,
wadeorz
Midi-sequecing
nice work yohannes even if i don't have midi stuff. your patch was really inspiring me so i've posted on this forum my own array-drum machine:
http://puredata.hurleur.com/sujet-1726-drum-machine
let me know what you think
Storing symbols
Is there anyway to store symbols in a patch similar to the way that arrays store numbers, or do we have to assign a number label to the symbol and store it in an array?
For example, if I've selected certain drum sample names in my drum machine that I want to be recalled automatically next time I open this particular instance of the drum machine, how can I store the name of this drum?
What is an abstraction, and why use $0, $1 etc ??
before finding out about all this $1- and $0- stuff I'd already put together an abstraction for playing a drum sound inside a drum machine. because I knew I wanted several copies of this within the drum machine I assigned "d1" at the beginning of each send or receive object in the drum abstraction, and then did find/replace in a text editor to change it to "d2", "d3", "d4" etc to make several different copies.
Now that I realise you can just have one copy and use $1 and creation arguments to generate further copies, I have tried to use find/replace to replace "d1" with "$1-". Sure enough the replacement operation works, but when I try to open the amended abstraction again in pd, it just opens a blank canvas?!
In the text editor everything looks exactly the same except for the d1 has changed to $1- so I just can't fathom what the problem could be.
Anyone have any suggestions?
I've attached the 2 versions for reference: 'drum1' is the original with "d1", and 'drum' is the amended version with "$1-" (except you won't be able to see anything with 'drum' unless you open it in text editor!)
Fairly efficient analog drums
Booniers drum machine got me thinking about drums again so tonight I made this.
It's 3 techno drums that are quite efficient. The kick and snare contain no oscillators but use a wrapped line segment. Total DSP count - 4 multiplies and a cos. This trick is extended in the snare with a feedback around a second function which results in a chaotic band of noise around the center frequency. Becuase we use [vline~] and always start on the same phase they sound pretty tight.
best,
andy
Osculator and Pd
Thanks for all you help guys here is what i have working so far...
However when we start using this to control Gem and audio patches the computer starts to slow down and or act funny. I was thinking we could use one machine to take in the messages and use another machine to make graphics and audio.
I have connected two machines with crossover cable and with osculator open on one and this patch i made open on the other i was hoping it would work the same way when osculator and the patch are open on the same machine. but they don't it appears that osculator only sends messages locally?
does any one know how i would send osculator messages to another machine?
thanks for your help in advance let me know if i can explain this any clearer
oh yea one is a mac and the other is a pc
http://www.pdpatchrepo.info/hurleur/multi_output_success_no_errors.pd
Grid for drum machine?
Anyone know of a drum machine patch that uses a grid for toggling drum sounds on and off?
I've thought about using columns and rows of toggle objects for beats and drum sounds respectively, but I'm not sure how I'd be able to save and load patterns in this way (short of saving multiple copies of the patch).
I found a pianoroll patch which is along the lines of what I want, but only one row (note) can be toggled on each beat with this, when I'd want to have multiple triggers on each beat.
Brett
Any suggestions?
Assumptions:
The drum kit generates MIDI data.
You want to play sounds by MIDI from an external sampler/drum-box
You want to learn more about Pd and not have someone hand you your project on a plate 
-
Decode the midi - you need to create a [midiin] object and use [select] and [route] to catch the events when the pedal is pressed.
-
Create a step sequencer that inserts events in a cyclic buffer/storage system (in overwrite mode) *hard part
-
Use a toggle to switch the recording on and off with alternate pedal events.
-
Connect output of the step sequencer to a [midiout] object or to some drum synthesisers you make in Pd.
-
Add a metronome bleep so you can keep time.
-
Pick up your drum sticks...
(Note - you haven't thought about (or told us about) some still unsolved problems. A sequencer capable of making polyrythmns needs more than one concurrently running sequence, same timebase but unrelated bar lengths. Work on that first because it defines an important software engineeing decision which effects how your sequencer must work (hint: is it track based or layer based or something else? That effects how you delete events (unless you plan on playing everything right first time))