I have a couple ideas on where to start. What artist/recording is this?

Cylob

Is there a way to hear the track? The flash player fails with the message "
Sorry, this track or album is not available"

I would use way back machine. Thats all I can think of

wayback doesn’t seem to work. I guess not. Cylob is unreachable too

re: amp follower on filterbank

easy to cook up something straightforward like this. (i’m using 24 bands on the bark scale, but this is kind of arbitrary.)

[ https://gist.github.com/catfact/288693fa47cbd5d15f04c6452f42a7c7 ]

now, one caveat is that this is not really a “good” filterbank - supercollider doesn’t really have one out of the box. (AFAIK! would love to be corrected.)

by “good” i mean that recombining these subband signals will result in something not much like the original. and subband phase is distorted such that anything but pretty coarse analysis like this envelope following, will not be super useful. for this it’s fine. for more stringent applications there are more effortful options.


re: spec flatness

“spectral flatness” aka weiner entropy == geometric mean of power spectrum / arithmetic mean. so it’s low if the signal is “peaky” and high if it’s flat.

supercollider has a SpectralFlatness ugen to do this calculation on an FFT chain. NB that its output is linear, but in most psychoacoustic literature it is -db.

NB that also in psychoacoustics, it’s common to take weiner entropy of a subband for analysis. but the SC ugen won’t let you do this - it always takes the power spectrum of the whole signal. so i don’t think the results from literally feeding SpectralFlatness with a bandlimited signal will be very psychoacoustically meaningful (it will mostly be a function of subband total amplitude, width, placement, and of the filter rollof characteristics.)

that said, this naive “subband flatness” will do something, and can probably be sort of ad-hoc normalized per subband. probably good enough for music.

but if you literally want to get spec. flatness of many subbands, i’d consider trying to do the filtering in the frequency domain:

  • take FFT of signal
  • use PV_Copy for each subband
  • use PV_BrickWall to bandpass
  • (the tricky part) use .pvcalc to compute the weiner entropy of each subband directly. something approximately like:
{ 
    arg mags, phases;
    var mean, geomean, weiner;
    var n, y;
    
    n = mags.size;
    // return arrays, zero initially
    y = [ mags.collect({0}), phases.collect({0}) ];
    mean = mags.sum / n;
    geomean = exp(mags.collect({|m| log(m)}).sum / n);
    weiner = geomean / mean;
    y[0][0] = weiner;
    y
}

(^ this is totally untested, and i haven’t really tried this specific method. the theory is that placing the calculated value in the DC magnitude bin, then running IFFT, should give you a DC signal corresponding to that value, which can then be written to a control bus. let me know if you’ve tried this or other tricks to get .kr out of a pvcalc!)

the bad news is, this .pvcalc function will be very resource intensive. the good news is, it can be set up to only run on the relevant FFT bins for each subband, saving resources and also giving a mathematically meaningful result.

but TBH i’ve found supercollider a bit frustrating for this kind of low-level work on STFT data - this is one of many instances where its easier to just make a custom ugen if you have c++ chops. (here max/msp is actually quite nice since these days, you can put gen code in a phase vocoder subpatcher.)


re: control signals

well, once you have stuff on control busses, “recording, playback, transposing, quantizing” &c becomes a technically straightforward matter of using SC’s many tools for buffer and signal manipulation. but the creative possibilities quickly become manifold…


other analyses

spectral flatness on a wide-band signal is very useful i think. especially when combined / triangulated with other metrics like spectral centroid (which is conveniently SpecCentroid in SC) - this is an approximation of brightness, where weiner entropy is a (rough) approximation of tonality.

SpecPcile gives you a specific designated point on the cumulative distribution of the power spectrum - a measure of spectral “rolloff” that can mean different things depending on where you put that point. it’s less independent from the other two.

be aware that Pitch.kr also exists, it is an autocorrelation pitch tracker that also emits the strength of the autocorrelation as a “clarity” measure. it has its own internal frequency transform and can’t be combined with other FFT chain ugens.

and finally the third-party MCLD ugens include many more spectral analysis tools, like FFTCrest which is a different kind of “peakiness” measure (max / mean.)


i guess it’s appropriate to say that i’ve used a lot of musical techniques in this vein. for example the 2nd track on side A of my record at the door consists of several minutes of sines+noise synthesis based on a few seconds of viola sounds, analyzed and resynthesized in a highly arbitrary way. and for a couple of years most of my live pieces were similarly derived (e.g. 2014 SFEMF performance.)

6 Likes

I came up with something similar:

(
{
	var in = SoundIn.ar(0);
	var f0 = 20;
	var ff = 12000.log2;

	var ugen = LFTri;
	//var ugen = BlitB3Tri;
	// var ugen = SinOsc;

	var out = 24.collect{|n|
		var f = 2**(ff * n / 24);
		var b = BBandPass.ar(in, freq:f0*f, bw:0.5*8/24);
		var p = Tartini.kr(Lag.ar(b, 0.2), 0.99);
		// var p = Pitch.kr(Lag.ar(b, 0.2), ampThreshold:0.001, peakThreshold:0.1);
		var a = PeakFollower.kr(b, 0.9);//Amplitude.kr(b);
		ugen.ar(Lag.kr(p[0], 0.2), mul:Lag.kr(a * Lag2.kr(p[1],0.5), 0.2));
	};

	DelayC.ar(Pan2.ar(Mix.new(out)), 2, 1);
}.play;
)

The DelayC is there to mitigate feedback if you aren’t using headphones. If you are you can get rid of it, or set the delay to a small value.

2 Likes

The BandSplitter quark (https://github.com/scztt/BandSplitter.quark) should be a basically lossless crossover / band splitting filter (lossless apart from delay), and has arbitrary order. It only goes up to 8 bands, but you just have to nest the filters further to split into more bands. If someone wants to implement BandSplitter16 (or better yet, a BandSplitterN that allows arbitrary numbers of splits), I am most definitely accepting pull requests :slight_smile:.

6 Likes

so cool. Keep it coming. :slight_smile: maybe cylob will turn up

I might be the only one thats heard it,. .It sounded like a regular phrase then stretched like taffy, Perfectly. No artifacts, No spectrally sounds.

@scztt so funny, immediately after writing that post i went and found your Quark. it is very elegant, and just what i had in mind (thinking of the dyadic filterbank from the Faust libraries.)

i don’t have BLPF though - it’s an IIR of arbitrary order?

(PS: for industry work. i’ve found that dyadic filterbanks sometimes impose too much group delay with a significant number of subbands. we’ve ended up using multirate structures instead.)

1 Like

I’ve been trying to split bands using the bark scale for years in supercollider. My mind is blown! Finally! Thank you!

So, any way to tidy this up onto the ideal patch?

ERROR: binary operator ‘+’ failed.
RECEIVER:

when I execute;
~band_signal_bus = Bus.audio(s, n);
~band_amp_bus = Bus.control(s, n);

dunno. make sure s is set to Server.default or something.

shame there wasn’t a working example posted. I can’t do it. Don’t have the brains

Didn’t my example work…?

oh, apologies, i hadn’t defined n in that snippet.

here is a full and working script:

of course this is just a multiband envelope follower that happens to be bark-scaled. it doesn’t make music, let alone cylob’s music.

@frankchannel’s script also works for me, and maps things to oscillators.

(however, big caveat that Tartini requires sc3-plugins to be installed, use Pitch instead if you don’t want to install that.)

more extended musical applications are really a creative endeavor.

1 Like

Yeah, nothing that sounds like the original that I can tell. Thanks for the effort

but thank you everybody

so zebra, so what global variable is spitting out the numbers to play oscillators? You are there, just needs to play something.

Cylob must have done some other stuff to in the text

I stuck a
SinOsc.ar(~band_signal_bus, mul:Lag.kr(~band_amp_bus, 0.2));
in zebras routine.
no sound
no error

Clearly have no clue

@skee

you’re asking for a lot of things, many of which are not well defined, and in my view are really compositional parameters.

that script shows you how to make a multiband envelope follower that is psychoacoustically meaningful. i have no idea how you want to use that.

a separate part of your question is about recording and manipulating acoustic analysis results, as synthesis parameters, particularly pitch. here is a gist that demonstrates recording and playing back pitch, clarity, amplitude and flatness from a buffer:

to use:

  • hit “record” to start recording analysis params, in a loop, into a short buffer (8sec arbitrarily.)
  • manipulate pitch playback parameters using the number boxes (use arrow keys.)

of course i imagine you would want to have many buffers, manipulate loop times, and so on. this is outside the scope of the demo.

also outside the scope is how you would use the filterbank in conjunction with such processes, and of course implementing the overall compositional / performance goals.

i hope this helps illustrate some of the techniques you require. the rest of it is creative work, which i can’t accomplish for you.

there are a few issues here, the most important one being that you need an In ugen to play or read something from a bus within a SynthDef.

not totally clear to me what you’re trying to do. something like frank’s example?

assuming so, i’ve updated the first gist to attach a sine wave to each bark band, tracking pitch and amplitude within that subband. it’s an extremely weird kind of crummy vocoder!