1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 77 78 79 80 81 82 83 84 85 86 87 88 89 90 91 92 93 94 95 96 97 98 99 100 101 102 103 104 105 106 107 108 109 110 111 112 113 114 115 116 117 118 119 120 121 122 123 124 125 126 127 128 129 130 131 132 133 134 135 136 137 138 139 140 141 142 143 144 145 146 147 148 149 150 151 152 153 154 155 156 157 158 159 160 161 162
|
class:: Concat
summary:: Concatenative Cross-Synthesis on Live Streams
related:: Classes/Concat2
categories:: UGens>GranularSynthesis
Description::
Implementation of concatenative sound synthesis based on matching four features from a control input to the database generated from a source input. The control determines which frames of the source get played back, and you can change the weighting of features to refine your matching criteria (ie, make rms the most heavily weighted to have amplitude as the most important criteria). You can also modulate the match length, being the amount of source played back for a match, the feature weightings, and freeze the database collection to work with a collected sample from the source.
Refs- see the publications of Schwarz, Sturm, Casey amongst others.
classmethods::
method::ar
argument::control
audio rate input, acts as control
argument::source
audio rate input, source for cross-synthesis
argument::storesize
size of source store sample buffer in seconds
argument::seektime
Time in seconds into the past to start searching for matches
argument::seekdur
Time in seconds from seektime towards the present to test matches
argument::matchlength
Match length in seconds (this will be rounded to the nearest FFT frame)
argument::freezestore
Stop collecting novel source input, keep store (database) fixed
argument::zcr
Weight for zero crossing rate feature
argument::lms
Weight for log mean square amplitude feature
argument::sc
Weight for spectral centroid feature
argument::st
Weight for spectral tilt feature
Examples::
code::
b = Buffer.read(s,"sounds/a11wlk01.wav");
//match only on amplitude from audio in
(
SynthDef(\concat1, {arg bufnum, matchlength=0.01, freeze=0;
var concat, control, input;
control= SoundIn.ar;
input=PlayBuf.ar(1,bufnum,BufRateScale.kr(bufnum), loop:1);
concat= Concat.ar(control,input,1.0,1.0,1.0,matchlength,freeze,0.0,1.0,0.0,0.0);
Out.ar(0,Pan2.ar(concat,0.0))}).add;
)
a=Synth(\concat1,[\bufnum, b.bufnum]);
a.set(\freeze, 0);
a.set(\matchlength, 0.01);
//synthesis controls audio in- beat box, then the synth drives bits of audio rhythmically
(
{
var concat, control, input;
control= SinOsc.ar(0.5)*Saw.ar(SinOsc.kr(LFNoise0.kr(MouseY.kr(0.01,1),3,4.5),0,50,MouseY.kr(120,500)));
input=SoundIn.ar;
concat= Concat.ar(control,input,4.0,4.0,4.0,MouseX.kr(0.0,0.5),0,0.5,1.0,0.5,0.0);
Out.ar(0,Pan2.ar(concat,0.0))}.play
)
//audio in controls synthesis, low latency, match by ZCR and spec centroid
(
{
var concat, control, input, amp;
input= SinOsc.ar(2)*
Mix(Gendy3.ar(3,5,1.0,1.0,(Array.fill(5,{LFNoise0.kr(1.3.rand,1,2)})*MouseY.kr(100,3780,'exponential')),MouseY.kr(0.01,0.05),MouseY.kr(0.001,0.016),5,mul:0.1));
control=SoundIn.ar;
amp=Amplitude.ar(control);
concat= Concat.ar(control,input,1.0,1.0,1.0,MouseX.kr(0.0,0.1),0,1.0,0.0,1.0,1.0);
Out.ar(0,Pan2.ar(10*concat*amp,0.0))}.play
)
//granulator
(
{
var concat, control, input;
control= Saw.ar(SinOsc.kr(LFNoise0.kr(MouseY.kr(0.01,1),3,4.5),0,10,MouseY.kr(12,100)));
input=PlayBuf.ar(1,b.bufnum,BufRateScale.kr(b.bufnum), loop:1);
concat= Concat.ar(control,input,2.0,2.0,2.0,MouseX.kr(0.01,0.1),0,MouseY.kr(0.0,1.0),1.0,0.5);
Out.ar(0,Pan2.ar(concat,0.0))}.play
)
b = Buffer.read(s,"sounds/break2");
//beat resynthesis match by ZCR and spec centroid
(
SynthDef(\concatexample2, {arg bufnum, freeze=0;
var concat, control, input, amp;
input= SoundIn.ar;
control=PlayBuf.ar(1,bufnum,BufRateScale.kr(bufnum), loop:1);
amp=Amplitude.ar(control);
concat= Concat.ar(control,input,5.0,5.0,5.0,MouseX.kr(0.0,0.1),freeze,MouseY.kr(0.0,1.0),0.0,1.0);
Out.ar(0,Pan2.ar(10*concat*amp,0.0))
}).add;
)
a=Synth(\concatexample2,[\bufnum, b.bufnum]);
a.set(\freeze, 1); //set this on or off to stay with a set of collected sounds
a.set(\freeze, 0); //set this on or off to stay with a set of collected sounds
::
|