White noise source for glitch percussion/rhythm

Hi all

I’m really getting into (trying to recreate) ambient soundscapes with glitchy percussion (yeh, I’m old :smiley: ). How do you do it? Obviously, noise is the source, but to my ears, the following - with apologies for vaguely subjective adjectives - sounds too warm and soft. I’m aiming for very brittle and immediate (very very short) sparks of white noise, but even with ADSR values of zero, it still sounds enveloped.

use_synth :noise

cutpat = knit(60,1, 130,1, 90,2)
slppat = knit(1,2,0.5,2)

live_loop :popz do
  tick
  use_synth_defaults cutoff: cutpat.look, amp: 2, release: 0
  play 100
  sleep slppat.look * 0.4
end

A secondary question might be, with density - how low can you go?

PD-Pi

2 Likes

Fascinating! It sounds pretty sharp to me, but when I record a .wav and open it in Audacity, it does indeed appear to ramp up and down for a couple milliseconds. I wonder if there’s something in the SuperCollider synthdef code that might explain this?


[description: image of a very short segment of a noisy waveform, with a smooth attack and decay]

Thanks, it does definitely sound enveloped. I could be wrong, but I think I recall that the human threshold for envelope detection is around 10ms? Is there a default AR envelope around <10ms in the synthdef I wonder? Or just my ears getting old :smiley:

PD-Pi

This is above my pay grade, but I’m curious. The synth definition shows an attack of 0ms. I don’t really know Clojure/Overtone code, but the env line looks like the key here:

(defsynth sonic-pi-noise
   [amp 1
    ;; [more parameters here...]
    attack 0
    sustain 0
    decay 0
    release 1
    ;; [more parameters here...]
    out_bus 0]
   (let [decay_level (select:kr (= -1 decay_level) [decay_level sustain_level])
         amp         (varlag amp amp_slide amp_slide_curve amp_slide_shape)
         amp-fudge   0.9
         ;; [more parameters here...]
         snd         (rlpf (white-noise) cutoff-freq res)
         env         (env-gen (core/shaped-adsr attack decay sustain release attack_level decay_level sustain_level env_curve) :action FREE)
         snd         (* amp-fudge snd env)]

     (out out_bus (pan2 snd pan amp))))

It’s using a function called shaped-adsr, defined within Sonic Pi’s codebase. Seems like it could be responsible, but I don’t see anything that’s obviously smoothing out the attack.

You know, it could also be an effect of Sonic Pi’s built-in limiter, as documented in the language reference under set_mixer_control!. But I don’t have time to do any more tests right now. If you have a chance to try bypassing it, I’d be curious to know what you find.

Thanks for looking at this - it’s beyond my pay grade too, and I have zero experience with Clojure, but thanks for the links. I haven’t dug deep enough into those synthdefs but maybe I should. Or I could try writing my own - I’ve been meaning to for a while, as I do have some experience with SC.

Thanks again friend

PD-Pi

An enveloped sample slice works waaay better (for me) than my earlier approach.

live_loop :glts do
  hat = [:hat_zan, :hat_metal, :hat_gem, :hat_star].choose
  use_sample_defaults sustain: rrand(0, 0.02), finish: 0.02, amp: 2
  dens = [1,1,1,1,4,6].choose
  density dens do
    sample hat, beat_stretch: 1 #smaller values get VERY glitchy
    sleep [0.25, 0.5].choose
  end
end

PD-Pi

Definitely dig the 2nd version. Very glitchy and sharp.
Think I want to play with this one, but don’t have time tonght.

Okay, you thief of sleep! I didn’t have time, but I got sucked in anyway. Here’s my take:


live_loop :glts do
  hat = [:hat_zan, :hat_metal, :hat_gem, :hat_star]
  use_sample_defaults sustain: rrand(0, 0.5), finish: rrand(0, 0.5), amp: 2, decay: rrand(0,0.5)
  dens = [1,1,2,3,4,6].choose
  density dens do
    sample hat.choose, beat_stretch: rrand(0.125, 2) #smaller values get VERY glitchy
    sleep [0.25, 0.5, 0.75].choose
  end
end

A little funk in the sauce.