Skip to content

Instantly share code, notes, and snippets.

View s1oane's full-sized avatar
💖

sloane s1oane

💖
View GitHub Profile
@s1oane
s1oane / codeforsound-oct6.js
Last active October 6, 2025 23:39
Fade in filter
synth = Synth('saw')
filter = Filter()
// filter
synth.fx.add(filter)
filter.filterMode = 3
filter.cutoff.fade(0, 1, 6) // start, end, duration
// notes
synth.note.seq( [0,2,4,7], 1/2 )=
@s1oane
s1oane / codeforsound-sep12.js
Created September 12, 2025 19:07
FM-controlled 3D dog
Graphics.quality = 'low'
Union2(
// head
head = Sphere(0.5).material('red').texture('dots'),
// body
Sphere(0.5).material('red').texture('dots').translate(0.2,-0.5),
Sphere(0.5).material('red').texture('dots').translate(0.5,-0.5),
@s1oane
s1oane / codeforsound-sep10.js
Last active September 11, 2025 00:10
composition using randomness
// synth
synth = Synth('bleep')
synth.seq( [0, 2, 4, 5, 7], [1/8, 1/16].rnd() )
s.pan.seq(Rndf() // randomize pan
synth.gain.seq(Rndf(0, 0.5)) // randomize volume
// drums
kickDrum = Kick().seq( [0,2,4].rnd(), 1/4 )
snare = Snare().seq( [0,1].rnd(), 1/8 )
@s1oane
s1oane / codeforsound-sep8.js
Created September 9, 2025 01:08
composition for practicing monosynths and busses
// bus
reverb = Bus2().fx.add(Reverb())
// monosynth
monosynth = Monosynth({
detune2:-.5, detune3:2, antialias:true, octave:-1
}).note.seq( 0, 1/4 )
monosynth.connect(reverb)
@s1oane
s1oane / codeforsound-sep4.js
Created September 4, 2025 16:38
second version of one-minute composition
// bass (low register)
bass = Synth('square.bass')
bass.note.seq(notes = [1, 3, 4], 1/2)
bass.waveform = 'saw'
// -------------------------
// synth (high register)
Theory.root = 'd3'
synth = Synth({ useADSR:true })
@s1oane
s1oane / codeforsound-sep2.js
Created September 2, 2025 19:09
first version of minute-long composition project
// bass (low register)
bass = Synth('square.bass')
bass.note.seq(notes = [1, 3, 4], 1/2)
bass.waveform = 'saw'
// -------------------------
// synth (high register)
Theory.root = 'd3'
synth = Synth({ useADSR:true })
@s1oane
s1oane / codeforsound-aug28.js
Last active August 28, 2025 23:21
Another synth + drum combo with Gibber
// synth
s = Synth('square.perc')
s.note.seq( [0,1.3,0.3,3], 1/3)
// synth scale
Theory.root = 'c3'
Theory.mode = 'mixolydian'
// drums
@s1oane
s1oane / codeforsound-aug26.js
Last active August 28, 2025 23:20
Drums + synth pattern with Gibber
// drums
drums = Drums()
drums.tidal( '< sd*2 oh> kd/2' )
// synth pattern
synth = Synth()
synth.amp = 0.3
synth.resonance = 0.5
synth.note.seq( [1, 2, 4, 7, null, 5], [1, 1, 1, 1, 1/2, 1/2] )
import time
import board
import neopixel
import touchio
touch_pad = board.A0
touch = touchio.TouchIn(touch_pad)
pixel_pin = board.D2
num_pixels = 16
import time
import board
import neopixel
import touchio
touch_pad = board.A0
touch = touchio.TouchIn(touch_pad)
pixel_pin = board.D2
num_pixels = 16