audio degradation
parent
8f80745cf2
commit
bb464e7249
@ -0,0 +1,106 @@
|
|||||||
|
(
|
||||||
|
{
|
||||||
|
var sound, warped, degraded, flutter, hiss;
|
||||||
|
|
||||||
|
// Load your WAV file
|
||||||
|
sound = PlayBuf.ar(1, Buffer.read(s, "/Users/lcoogan/snd/releases/desolation-mountain/mono.wav"), loop: 0);
|
||||||
|
|
||||||
|
// Wow & flutter (pitch modulation)
|
||||||
|
flutter = SinOsc.kr(0.2).range(0.98, 1.02) + LFNoise1.kr(0.5).range(0.99, 1.01);
|
||||||
|
|
||||||
|
// flutter = SinOsc.kr(0.2).range(0.4, 0.6) + LFNoise1.kr(0.5).range(-0.05, 0.05);
|
||||||
|
|
||||||
|
warped = Warp1.ar(1, Buffer.readChannel(s, "/Users/lcoogan/snd/releases/desolation-mountain/mono.wav", channels:[0]), SinOsc.ar(0), 1, 0.2);
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
// Add tape-style hiss
|
||||||
|
hiss = WhiteNoise.ar(0.01);
|
||||||
|
|
||||||
|
// Filter for muffling
|
||||||
|
warped = LPF.ar(warped, 6000); // Adjust to taste
|
||||||
|
|
||||||
|
// Bit reduction
|
||||||
|
warped = Decimator.ar(warped, rate: 44100, bits: 8);
|
||||||
|
|
||||||
|
// Combine and output
|
||||||
|
(warped + hiss) * 0.5;
|
||||||
|
}.play;
|
||||||
|
)
|
||||||
|
|
||||||
|
|
||||||
|
Buffer.read(s, "/Users/lcoogan/snd/releases/desolation-mountain/mono.wav");
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
// Load buffer once
|
||||||
|
~buf = Buffer.readChannel(s, "/Users/lcoogan/snd/releases/desolation-mountain/mono.wav", channels:[0]);
|
||||||
|
|
||||||
|
~buf = Buffer.read(s, "/Users/lcoogan/snd/releases/desolation-mountain/02 - crawling and quietly seething was the figure of the trees.wav");
|
||||||
|
|
||||||
|
// Then:
|
||||||
|
(
|
||||||
|
{
|
||||||
|
var rate, sig, hiss;
|
||||||
|
|
||||||
|
// Create pitch flutter by modulating playback rate
|
||||||
|
rate = PinkNoise.ar(3).range(0.4, 0.42) + PinkNoise.kr(0.2).range(0.4, 0.42);
|
||||||
|
|
||||||
|
// Normal playback with flutter
|
||||||
|
sig = PlayBuf.ar(1, ~buf, rate, doneAction: 2); // doneAction: 2 frees the synth when finishede
|
||||||
|
// Add hiss
|
||||||
|
// hiss = BrownNoise.ar(0.01);
|
||||||
|
|
||||||
|
// Filter + degrade
|
||||||
|
// sound = LPF.ar(sound, 100000);
|
||||||
|
// sig = Decimator.ar(sig, rate: 44100, bits: 8);
|
||||||
|
// sig = PitchShift.ar(sig, windowSize:0.2, pitchRatio:1.0, pitchDispersion:0, timeDispersion:0.8, mul:1.0, add:0.0)[;
|
||||||
|
|
||||||
|
sig = Fold.ar(sig, -20, 20); // EMF: wavefolding only happens if the input signal amplitude exceeds the bounds provided. osc has a pretty normal range and won't ever exceed ±20. You can see in the previous line (LFDNoise3) I'm only amplifying it by a maximum factor of 1.5. It's actually small boundary values with Fold that cause audible results (change to the folding min/max to -0.1, +0.1 and you'll notice the sound changes significantly)
|
||||||
|
sig = Splay.ar(sig, spread: 10); // EMF: spread caps out at 1, larger values don't do anything extra
|
||||||
|
sig = sig.tanh * \amp.ir(0.25);
|
||||||
|
sig = sig + CombL.ar(sig, maxdelaytime:0.2, delaytime:0.2, decaytime: 1.0, mul: 0.3) * 0.4;
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
sig!2 * 4;
|
||||||
|
}.play;
|
||||||
|
)
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
(
|
||||||
|
{
|
||||||
|
var rate, sig, hiss, wowFlutter, dirt, stereo, folded, degraded, roomy;
|
||||||
|
|
||||||
|
// Wow & Flutter via modulated rate
|
||||||
|
wowFlutter = LFNoise1.kr(0.2).range(0.97, 1.03) + LFNoise2.kr(0.1).range(0.98, 1.02);
|
||||||
|
|
||||||
|
// Use PlayBuf for natural file playback with flutter
|
||||||
|
rate = wowFlutter;
|
||||||
|
sig = PlayBuf.ar(1, ~buf, rate, doneAction: 2);
|
||||||
|
|
||||||
|
// Tape hiss / noise floor
|
||||||
|
hiss = BrownNoise.ar(0.005);
|
||||||
|
|
||||||
|
// Bitcrushing and sample rate crunch (optional!)
|
||||||
|
sig = Decimator.ar(sig, rate: 8000, bits: 6); // go lo-fi
|
||||||
|
|
||||||
|
// Saturation and nonlinearities
|
||||||
|
folded = Fold.ar(sig, -0.1, 0.1); // tight fold = audible grit
|
||||||
|
dirt = (folded * 5).tanh;
|
||||||
|
|
||||||
|
// Slight stereo spread
|
||||||
|
stereo = Splay.ar(dirt + hiss, spread: 0.7);
|
||||||
|
|
||||||
|
// Subtle comb echo / fake reverb tail
|
||||||
|
roomy = stereo + CombL.ar(stereo, 0.3, 0.2, 2.5, 0.2);
|
||||||
|
|
||||||
|
// Optional: small dropouts
|
||||||
|
roomy = roomy * LFNoise2.kr(0.5).range(0.7, 1.0);
|
||||||
|
|
||||||
|
// Final output level
|
||||||
|
roomy * \amp.ir(0.3);
|
||||||
|
}.play;
|
||||||
|
)
|
||||||
@ -0,0 +1,44 @@
|
|||||||
|
~buf = Buffer.read(s, "/Users/lcoogan/snd/releases/desolation-mountain/02 - crawling and quietly seething was the figure of the trees.wav");
|
||||||
|
|
||||||
|
(
|
||||||
|
{
|
||||||
|
var rate, sig, wow, flutter, noise, dropout, echo, worn, warm, ghost, deckNoise;
|
||||||
|
|
||||||
|
// Load mono audio buffer first: (run once before)
|
||||||
|
// ~buf = Buffer.readChannel(s, "/Users/lcoogan/snd/releases/desolation-mountain/mono.wav", channels:[0]);
|
||||||
|
|
||||||
|
// --- Wow & flutter ---
|
||||||
|
wow = SinOsc.kr(0.3).range(0.99, 1.01); // slow cyclical wobblee
|
||||||
|
flutter = LFNoise1.kr(1).range(0.995, 1.005); // fast jitter
|
||||||
|
rate = wow * flutter;
|
||||||
|
|
||||||
|
// --- Play the buffer with pitch mod ---
|
||||||
|
sig = PlayBuf.ar(1, ~buf, rate, doneAction: 2);
|
||||||
|
|
||||||
|
// --- Simulate dropouts ---
|
||||||
|
dropout = LFNoise2.kr(0.4).range(0.6, 1.0);
|
||||||
|
sig = sig * dropout;
|
||||||
|
|
||||||
|
// --- Add tape hiss ---
|
||||||
|
noise = BrownNoise.ar(0.003);
|
||||||
|
|
||||||
|
// --- Print-through / ghosting (delayed echo of self) ---
|
||||||
|
ghost = DelayC.ar(sig, 0.6, 0.6) * 0.3;
|
||||||
|
|
||||||
|
// --- Slight combing / smearing (wow bleed) ---
|
||||||
|
echo = CombL.ar(sig, 0.2, 0.03, 2) * 0.2;
|
||||||
|
|
||||||
|
// --- Tape saturation ---
|
||||||
|
warm = ((sig + ghost + echo) * 2).tanh;
|
||||||
|
|
||||||
|
// --- Worn tape: Lowpass and bitcrush ---
|
||||||
|
worn = LPF.ar(warm, 4000);
|
||||||
|
// worn = Decimator.ar(worn, rate: 12000, bits: 10);
|
||||||
|
|
||||||
|
// --- Add subtle deck hum / mechanical loop? ---
|
||||||
|
deckNoise = SinOsc.ar(50, 0, 0.001); // tape motor hum
|
||||||
|
|
||||||
|
// --- Stereo + Final mix ---
|
||||||
|
Splay.ar(worn + noise + deckNoise, spread: 0.5) * 0.4;
|
||||||
|
}.play;
|
||||||
|
)
|
||||||
@ -0,0 +1,41 @@
|
|||||||
|
(
|
||||||
|
{
|
||||||
|
var sig, noise, crackle, flutter, gritty, dusty, wow, ring, dropout;
|
||||||
|
|
||||||
|
// Buffer preload (mono)
|
||||||
|
// ~buf = Buffer.readChannel(s, "/Users/lcoogan/snd/releases/desolation-mountain/mono.wav", channels:[0]);
|
||||||
|
|
||||||
|
// Wow & flutter (slow and loopy like hand-cranked)
|
||||||
|
wow = SinOsc.kr(0.1).range(0.99, 1.01);
|
||||||
|
flutter = LFNoise1.kr(6).range(0.98, 1.02);
|
||||||
|
|
||||||
|
// Modulated playback rate
|
||||||
|
sig = PlayBuf.ar(1, ~buf, rate: wow * flutter, doneAction: 2);
|
||||||
|
|
||||||
|
// Bandwidth-limited like a wax disc (c. 4kHz max)
|
||||||
|
sig = HPF.ar(sig, 300); // kill low-end rumble
|
||||||
|
sig = LPF.ar(sig, 4000); // simulate acoustic horn
|
||||||
|
|
||||||
|
// Dropouts (emulate groove wear)
|
||||||
|
dropout = LFNoise2.kr(0.8).range(0.5, 1.0);
|
||||||
|
sig = sig * dropout;
|
||||||
|
|
||||||
|
// Clicks / crackle (discrete dust pops)
|
||||||
|
crackle = Dust2.ar(200) * Decay2.ar(Impulse.ar(20), 0.001, 0.02) * 0.2;
|
||||||
|
|
||||||
|
// Background hiss / groove rumble
|
||||||
|
noise = WhiteNoise.ar(0.01) + Crackle.ar(1.5, 0.02);
|
||||||
|
|
||||||
|
// Mechanical ring (horn resonance / disc rumble)
|
||||||
|
ring = Resonz.ar(sig, 900, 0.1) * 0.3;
|
||||||
|
|
||||||
|
// Mix everything (all mono!)
|
||||||
|
gritty = sig + ring + crackle + noise;
|
||||||
|
|
||||||
|
// Subtle saturation
|
||||||
|
gritty = (gritty * 2).tanh;
|
||||||
|
|
||||||
|
// Reduce output + normalize
|
||||||
|
gritty!2* 0.5;
|
||||||
|
}.play;
|
||||||
|
)
|
||||||
Loading…
Reference in New Issue