Information Technology Grimoire

Version .0.0.1

IT Notes from various projects because I forget, and hopefully they help you too.

Viking Breaths

I meditate. This is designed as background noise for 4 count box breathing. Sounds like vikings something to me.

Try it

setcpm(60/4)  // Slower - 60 BPM = 1 beat per second

// ========== GUIDE TONE ==========
// BREATHING GUIDE TONE - marks each phase clearly
$: n("<[0 0 0 0] [5 5 5 5] [7 7 7 7] [5 5 5 5]>").scale("d:minor").trans(12)
  .s("gm_woodblock")
  .gain("<0.6 0.4 0.6 0.4>")  // Louder on inhale/exhale
  .lpf(2000)

// ========== BASS SECTION ==========
// Deep bass - marks beginning of each breath phase (4 phases)
$: n("<0 5 7 5>").scale("d:minor").trans(-24)
  .s("triangle")
  .gain(0.8)
  .lpf(200)
  .room(0.8)
  ._pianoroll()

// Walking bass through the chord tones - 2 different walking patterns
$: n("<<[0 -5 3 5] [0 2 5 7] [-2 0 3 5] [0 5 3 0]> <[0 3 -2 0] [2 5 7 5] [-2 3 5 7] [5 3 0 -5]>>").scale("d:phrygian").trans(-24)
  .s("gm_cello")
  .gain(0.6)
  .lpf(300)
  .distort(0.15)
  ._pianoroll()

// LEFT ear grounding (4 phases)
$: n("<0 2 3 2>").scale("d:minor").trans(-24)
  .s("triangle")
  .gain(0.5)
  .lpf(150)
  .pan(0.1)
  ._pianoroll()

// RIGHT ear grounding - subtle detune (4 phases)
$: n("<0 2 3 2>").scale("d:minor").trans(-24)
  .s("triangle")
  .gain(0.5)
  .lpf(150)
  .detune(3)
  .pan(0.9)
  ._pianoroll()

// ========== MELODY SECTION ==========
// Breathing drone - rises and falls with breath (4 phases)
$: n("<[0 0 0 0] [2 2 2 2] [3 3 3 3] [2 2 2 2]>").scale("d:phrygian").trans(-12)
  .s("kalimba")
  .lpf("<300 400 500 400>")  // Opens filter on exhale
  .resonance(6)
  .gain("<0.5 0.6 0.7 0.6>")  // Swells on exhale
  .distort(0.2)
  ._pianoroll()

// Tension pad - 2 different voicing patterns
$: n("<<[0 3 5 7] [0 2 5 7] [-2 0 3 5] [0 3 5 8]> <[0 5 7 10] [2 5 7 9] [-2 3 7 10] [0 3 7 8]>>").scale("d:phrygian").trans(-12)
  .s("gm_cello")
  .lpf(600)
  .gain(0.35)
  .room(0.9)
  .distort(0.1)
  ._pianoroll()

// ========== PERCUSSION SECTION ==========
// Taiko drum - punctuates transitions between breath phases (4 phases)
$: s("<tom:6 ~ ~ ~>")
  .gain(0.8)
  .lpf(400)
  .room(0.6)

// Secondary drums - gentler accent on mid-phase (4 phases)
$: s("<~ ~ tom2:5 ~>")
  .gain(0.6)
  .lpf(500)

// Cymbal - marks completion of full breath cycle (every 4th cycle = 16 beats)
$: s("<~!3 crash:6>")
  .gain(0.4)
  .lpf(3000)
  .room(0.9)

// Hi-hat with breath rhythm
$: s("<~ hh:12 ~ hh:12>")
  .gain(0.15)
  .lpf(5000)
  .pan(perlin.range(0.3, 0.7))

// Shaker - adds constant subtle movement
$: s("<shaker:2*2 shaker:2*2 shaker:2*3 shaker:2*2>")
  .gain(0.2)
  .lpf(6000)
  .pan(perlin.range(0.4, 0.6))

// Wood percussion accents - sparse hits
$: s("<~ perc:8 ~ ~>")
  .gain(0.3)
  .lpf(2500)
  .pan(0.5)

// Rim clicks - very subtle pulse
$: s("<rim:8 ~ rim:8 ~>")
  .gain(0.25)
  .lpf(4000)
  .pan(perlin.range(0.2, 0.8))
Last updated on 16 Nov 2025
Published on 16 Nov 2025