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