Blown away that this can become this
Someday I’ll investigate this more seriously but for now here’s ChatGPT-4’s explanation of the code:
// licensed with CC BY-NC-SA 4.0 https://creativecommons.org/licenses/by-nc-sa/4.0/ // by Felix Roos samples({ p: 'https://cdn.freesound.org/previews/648/648433_11943129-lq.mp3' }) s("p") .loopAt(32) .chop(128) .jux(rev) .shape(.4) .decay(.1) .sustain(.6)
Here's a breakdown of the code:
samples({ p: 'https://cdn.freesound.org/previews/648/648433_11943129-lq.mp3' })
: This line loads an audio sample from the specified URL and assigns it to the variable p
.s("p")
: This line selects the sample p
as the sound source..loopAt(32)
: This line sets the loop length of the sample to 32 cycles..chop(128)
: This line slices the sample into 128 equal pieces, which can be rearranged and played back individually..jux(rev)
: This line applies the rev
(reverse) function to every second repetition of the sample, creating a juxtaposition effect..shape(.4)
: This line applies a wave shaping distortion effect to the sound, with an intensity of 0.4 (on a scale from 0 to 1)..decay(.1)
: This line sets the decay time of the sound envelope to 0.1 (10% of the cycle duration)..sustain(.6)
: This line sets the sustain level of the sound envelope to 0.6 (60% of the maximum amplitude).By chaining these effects and manipulations together, the code creates a unique, transformed version of the original sound sample.
Taking some learning from that, here’s a haunting variation:
samples({ p: 'https://cdn.freesound.org/previews/648/648433_11943129-lq.mp3' }) s("p") // .loopAt(32) .loopAt(48) // .chop(128) .chop(4) .jux(rev) .shape(.2) .decay(.1) .sustain(.8)
</code>