i’ve been toying with an idea but i’m not sure it can be done so i’m asking point blank cause i’m lost.
I would like to make a patch that can be used in several nearby laptops. each machine is running the same patch. each machine is generating a steady sine wave beep (short envelope) at a random frequency. at the same time, it’s listening/pitch detection. whenever it detects a pitch from a neighbouring machine, it compares it to its own and adjusts in small increments. would they actually self-correct to the point of converging on the same pitch? would they get confused by their own tone and never get there? pointers? ideas?
It depends on how you’re going about this and what the aesthetic impetus is.
Suppose you’re doing this with built in laptop speakers/microphones or even an external speaker/mic for each machine. You run some UGens for playing tones along with another set of UGens for pitch tracking. Maybe an onset detector starts a laptop’s pitch analysis, it stores that as a target frequency and adjusts toward that at some rate you decide on (you could maybe use a Lag Ugen) and then as the frequency moves toward the target, when it plays another tone, it does a sample and hold (probably with the Latch UGen) on the current value so the output sine tone doesn’t change frequency as it’s playing.
This method will introduce the question of what you want to do about feedback. You could make some sort of condition to block input pitch tracking while the machine is playing a tone, or not. There’s an aesthetic choice.
You could also send frequency messages through OSC instead of having the laptops do pitch analysis of audio.
You could also use one machine with a number of different generators and spatialize the audio. This begs the question of “why do pitch tracking on a digital sine wave” because all you have to do is measure period and it’ll give you almost the exact same result as sharing raw frequency values, just with more work and a very slightly larger margin of error (this is honestly speculation, there might not be any error at all). It kind of just depends on the compositional decisions you make and the priorities you have.
I think the problem you’d have is (1) each laptop will mostly hear itself, and (2) pitch detection on polyphonic sources, especially with tones that are very close, is extremely difficult (most pitch detectors / all the ones in SC now are basically for monophonic signals).
BUT actually, this might be to your advantage: in the scenario you’re describing, if it worked well then you’d just have a bunch of laptops playing the same sine tone, which isn’t so interesting. If it works LESS THAN well, then you have a bunch of laptops slewing sine tones around trying to find each other but unable to do so accurately - this sounds much more interesting, sonically