Wednesday, May 20, 2015

SpQ15 Max: resynthesizing w/ poly~

sigmund~ peaks @npeak 1
unpack i f f    (gives you index number, frequency, amplitude of that peak)
cycle~    (resynthesizes as sine tone)
*~  (adjusts gain)  (multiply two floats from unpack)
can add tapin~/tapout~ pair with an argument of the delay time in ms, before the dac

then, change to 10 peaks instead of 1 in sigmund~
cycle~ object switches among the 10 peaks really fast, sounds kind of swarmy

ENTER poly patcher

MAKE SUBPATCHER:
in 1 AND in 2
2 flonum boxes, one into cycle~ and one directly into R inlet of *~
cycle~
*~
out~1

Inlets are frequency and amplitude information, out~ gives you a signal.

IN ORIGINAL PATCH:
poly~ subpatcherfilename Poly

Insert this where cycle~ and *~ were before.  Now you have a nice 1-voice poly.

How do you do this with 10 peaks/voices rather than just one?

input message into poly~ that's voices $1, connect to left inlet, can put numbox and input however many voices you want

you can put open $1 message into same left inlet, and whichever integer you put into the number box, it'll open the sub patcher for that voice

**this is like a vocoder, you can understand his voice repeat back even with cycle~ and 10 voices!**
**just for fun, throw a spectroscope on the incoming signal and on the re-synthesized signal**

You can also change number of peaks coming out of sigmund~.

target$1 message is third important message into poly~--tells poly~ to send frequency to whichever voice--target 0 sends to every voice, target 1 sends just to voice 1--all the other voices will remain static on their last perceived frequency

To map multiple peaks into multiple voices:
in sigmund~, make it 2 peaks, and have 2 voices in poly~
make + 1, to make sure the index number matches with the voice number
place + 1 between index number (coming out of unpack) and target
NOW you need to re-order the patch cords to make sure peak 1 is mapped to voice 1--instead of unpack i f f, make it unpack f f i, put message above it that's $2 $3 $1--so that you get frequency, amplitude, and then index coming out of unpack, and you can put the index number through the +1, so now the target # is changed first before new amplitude and frequency inputted

now, can put input menu into sigmund~ for peak, and you can feed it integers to determine the number of peaks it finds--NO MORE than 20, probably a good idea to set limits on number input for number of voices, or else it will likely crash (note: today it was crashing on 7 or 8 voices)--if you make an integer box and feed it into the npeak menu and the number of voices, you can change them both at the same time

**poly~ is also set up to receive MIDI notes**

It's meant for replicating, so all the sub patches of the voices will be the same, but you can have them set up to randomly choose various pathways, so each voice will select different pathways.  You could feed a saw~ and a cycle~ each into a *~ object and then into a selector~ 2 object, and it will choose between those--add a third inlet, directly into the selector~ 2, and you can put a numbox in there (0 means nothing gets selected, 1 means the first, 2 means the second UGen).  That way, you can manually select each voice for target $1 and the kind of wave you want coming out, and it will be predetermined.

Tracks object tries to keep track of which partial is which, instead of putting whatever's loudest in voice 1 and next loudest in voice 2, etc.

No comments:

Post a Comment