Generative guitar/cello/autoharp textures

Hi
I have spent most of the week getting to know the :pluck synth, particularly its envelope function. I discovered (as you all have, no doubt) that beyond the standard ‘steeple and church’ ADSR shape we can create unnatural envelope shapes like a capital M, where the decay level is lower than the sustain level. This causes a gentle pulsing reverb-like effect in the ADSR envelope. Again, not news to anyone here.

I also wanted an autonomous algorithm to generate random ‘windchime’ events with minimal user input, so the two controls for this function are attack time (0 - 1) and repeats (1 ~ <100), the latter is simply the max value for a random sleep range.

The attack time input (0 - 1) is mapped in several ways. Attack and decay values are the same; the decay level is the inverse of attack, such that a percussive strike (attack = 0) has maximum amplitude at the start. Longer attack times (~ 1) cause the decay level to decrease. And the sustain level is the inverse of the decay level, so the shape has this seesaw/hinge mapping.

I’ve mapped and scaled (* 0.4) the damping coefficient to attack time, just because. You can hardwire it back to 0.5 or thereabouts. I literally let this run in the background for ages, lovely sounds. If you exceed the input value bounds you will break it (attack > 1 can cause negative dec/sus levels, because there’s no .clamp method currently).

/ generative autoharp plucky-bowy thing /

/ USER INPUT HERE /
atkmax = 0.5 # must be 0 ~ 1
rpts = 7 # 1 ~ <100

/ SETUP ONLY /
use_synth :pluck
rpts =  1.0/rpts * 10.0 # just remapping

live_loop :guitelloarp do
  atkdec = rrand(0.0, atkmax+0.01) # semi-randomised atkdec
  decsus = 1.0 - atkdec # atkdec 0 ~ 1.0, decsus is its inverse
  decsus = decsus**2 # ensure decsus >0
  
  play chord(:a1, :minor7, num_octaves: 4).choose, amp: 2,
    attack: atkdec, decay: atkdec, decay_level: decsus,
    sustain: 3, sustain_level: atkdec,
    coef: decsus * 0.4 + 0.1,
    pluck_decay: 30,
    pan: rrand(-0.4, 0.4)
  
  sleep rrand(0.1, rpts)
end

No reverbs were harmed in the making of this patch.
PD-Pi

3 Likes

Some really nice sounds. This will no doubt be a handy tool and timesaver for me. Cheers!