Chiptune Starter Pack

I make a lot of chiptune with SP, even though its most well-known use is the bland genre known as dub techno. I decided to release some of my secrets on here (first post here, too!) because we’re all programmers here anyway, and SP is open-source, so we should be too.

# initializing stuff.
t = true
f = false

#Sequencer for :bd. 3 measures, 4/4.
bdSeq = (bools 1,1,1,0, 1,0,1,1, 1,1,0,0)
#HiHat sequencer.
hhSeq = (bools 1,1,0,1, 0,0,1,1, 0,1,1,0)
#Kickdrum sequencer
kiSeq = (bools 1,1,1,1, 1,1,1,1, 1,1,1,1)

bdOn = t
hhOn = t
kiOn = t

use_bpm 120
with_fx :bitcrusher, bits: 4 do
  live_loop :bd do
    if (bdSeq.tick) and (bdOn) then
      sample :bd_haus, amp: 2
    end
    sleep 1
  end
  
  sleep 5
  
  live_loop :hh do
    if (hhSeq.tick) and (hhOn) then
      sample :drum_cymbal_pedal
    end
    sleep 1
  end
  
  sleep 2
  
  live_loop :kik do
    if (kiSeq.tick) and (kiOn) then
      sample :drum_heavy_kick, amp: 1.25
    end
    sleep 1.5
  end
end

This first bit (heh, heh) is, obviously, the drumkit. It’s in 4-bit, but 6- or 8-bit works better if you want to make higher-rez chip.
It includes a sequencer for each drum in the kit, which you can fiddle with to change the beat.

use_bpm 120

melody = [:bb4, :c4, :a4, nil, :b4].ring

melody2 = [:c4, :eb3, :as4, nil, :cs4].ring

with_fx :bitcrusher, bits: 4 do
  
  live_loop :bass do
    synth :chipbass, note: melody.tick, amp: 0.5
    sleep 1
  end
  
  
  live_loop :syn do
    synth :mod_pulse, note: melody2.tick, amp: 0.35, mod_phase: 0.25, pulse_width: 0.125
    sleep 0.5
  end
end

The second portion is the melody and an arp-y additional melody. I tried the :tri and :dtri synths, but :tri was too loud, even at 50% amplitude, and :dtri just sounded weird with this particular melody. Obviously, you can change all of the settings and opts, but this is what I used in a track that I’m going to release on SoundCloud later today.

use_bpm 120

with_fx :bitcrusher do
  live_loop :needleArp do
    t = Time.now.to_i
    use_random_seed t
    synth :mod_tri, note: rrand_i(55, 70), attack: 1, release: 1, mod_phase: 0.25, amp: 0.25, pulse_width: 0.125
    t += rrand_i(1, 4)
    use_random_seed t
    sleep 1.5
  end
end

This final portion is a true needle arp. It uses the :mod_tri synth (triangle = standard in needles), although depending on your track you can make it faster or slower by modifying the mod_phase opt.

You can put these in one buffer or in many. To change timing between threads/live loops, you can put a simple “sleep” line between threads. This works because the steps of a thread are run at the same time as the steps after that thread, allowing a pause before the next thread starts.

3 Likes

Cool stuff : simple and efficient :+1:

1 Like

Efficiency is the point and simplicity makes it easy to understand, modify, and use!

thank you so much for this, i’ve been dying to get my chiptune on with this and have been struggling with what’s already on

1 Like

No problem – It was especially fun to figure out the arpeggiator, especially. Drums are pretty straightforward and the :bitcrusher FX can be changed around. Find a bit depth that you like – each one sounds different. I normally use 6, but 4 can sound cool (Especially on kickdrums!) and 8 is the default. The value CAN be a decimal number, although I rarely use those. Don’t go lower than 2 bits unless you REALLY want a 1-ish-bit sound. 1-bit snare drums sound pretty cool, but for everything else, use (bits >= 2) as a rule of thumb.

This is cool stuff :slight_smile: I added a few synths for chiptune around v2.10 which people might also want to checkout

:chipbass (a kind of steppy triangle waveform)
:chiplead (pretty much a straight square/pulse wave)
:chipnoise (1 bit noise as you'd find on old consoles like the NES)

Another way to make chip bass drum sounds is to use :chipbass and slide the note down very quickly as described in this video Kick drum synthesis

2 Likes

I actually intended to avoid those – If I want a :chipnoise-like synth, I’ll make one. Your synths are good but I prefer the extra options created by combining the base waveform synths.

I highly recommend playing with these synths - they’re huge fun :slight_smile:

I have used them but I prefer the challenge of recklessly combining the raw waveforms.That’s not to say Xavier’s synths are useless to me, but I only use them in specific situations. Personal preference, more than anything.