# Chiptune Starter Pack

**URL:** <https://in-thread.sonic-pi.net/t/chiptune-starter-pack/657>\
**Category:** Creations & Ideas\
**Created:** [January 26, 2018, 2:37pm UTC](https://in-thread.sonic-pi.net/t/chiptune-starter-pack/657 "2018-01-26T14:37:05Z")\
**Posts on this page:** 9\
**Page:** 1

<div class="post-metadata">

**Author:** ![JorshTheHacker](https://avatars.discourse-cdn.com/v4/letter/j/d2c977/32.png) [@JorshTheHacker](https://in-thread.sonic-pi.net/u/JorshTheHacker)\
**Post date:** [January 26, 2018, 2:37pm UTC](https://in-thread.sonic-pi.net/t/chiptune-starter-pack/657/1 "2018-01-26T14:37:05Z")

</div>

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.

---

<div class="post-metadata">

**Author:** ![Freid](https://dub1.discourse-cdn.com/flex017/user_avatar/in-thread.sonic-pi.net/freid/32/365_2.png) [@Freid](https://in-thread.sonic-pi.net/u/Freid)\
**Post date:** [January 27, 2018, 12:26am UTC](https://in-thread.sonic-pi.net/t/chiptune-starter-pack/657/2 "2018-01-27T00:26:57Z")

</div>

Cool stuff : simple and efficient 👍

---

<div class="post-metadata">

**Author:** ![JorshTheHacker](https://avatars.discourse-cdn.com/v4/letter/j/d2c977/32.png) [@JorshTheHacker](https://in-thread.sonic-pi.net/u/JorshTheHacker)\
**Post date:** [January 27, 2018, 1:03am UTC](https://in-thread.sonic-pi.net/t/chiptune-starter-pack/657/3 "2018-01-27T01:03:37Z")

</div>

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

---

<div class="post-metadata">

**Author:** ![deadguy](https://dub1.discourse-cdn.com/flex017/user_avatar/in-thread.sonic-pi.net/deadguy/32/343_2.png) [@deadguy](https://in-thread.sonic-pi.net/u/deadguy)\
**Post date:** [January 29, 2018, 2:32am UTC](https://in-thread.sonic-pi.net/t/chiptune-starter-pack/657/4 "2018-01-29T02:32:31Z")

</div>

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

---

<div class="post-metadata">

**Author:** ![JorshTheHacker](https://avatars.discourse-cdn.com/v4/letter/j/d2c977/32.png) [@JorshTheHacker](https://in-thread.sonic-pi.net/u/JorshTheHacker)\
**Post date:** [January 29, 2018, 11:40am UTC](https://in-thread.sonic-pi.net/t/chiptune-starter-pack/657/5 "2018-01-29T11:40:17Z")

</div>

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.

---

<div class="post-metadata">

**Author:** ![xavierriley](https://dub1.discourse-cdn.com/flex017/user_avatar/in-thread.sonic-pi.net/xavierriley/32/9_2.png) [@xavierriley](https://in-thread.sonic-pi.net/u/xavierriley)\
**Post date:** [January 31, 2018, 3:52pm UTC](https://in-thread.sonic-pi.net/t/chiptune-starter-pack/657/6 "2018-01-31T15:52:49Z")

</div>

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

```ruby
: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](http://in-thread.sonic-pi.net/t/kick-drum-synthesis/269/20)

---

<div class="post-metadata">

**Author:** ![JorshTheHacker](https://avatars.discourse-cdn.com/v4/letter/j/d2c977/32.png) [@JorshTheHacker](https://in-thread.sonic-pi.net/u/JorshTheHacker)\
**Post date:** [January 31, 2018, 4:07pm UTC](https://in-thread.sonic-pi.net/t/chiptune-starter-pack/657/7 "2018-01-31T16:07:42Z")

</div>

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.

---

<div class="post-metadata">

**Author:** ![samaaron](https://dub1.discourse-cdn.com/flex017/user_avatar/in-thread.sonic-pi.net/samaaron/32/7_2.png) [@samaaron](https://in-thread.sonic-pi.net/u/samaaron)\
**Post date:** [February 1, 2018, 12:13am UTC](https://in-thread.sonic-pi.net/t/chiptune-starter-pack/657/8 "2018-02-01T00:13:51Z")

</div>

> [@xavierriley](#):
>
> I added a few synths for chiptune around v2.10 which people might also want to checkout

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

---

<div class="post-metadata">

**Author:** ![JorshTheHacker](https://avatars.discourse-cdn.com/v4/letter/j/d2c977/32.png) [@JorshTheHacker](https://in-thread.sonic-pi.net/u/JorshTheHacker)\
**Post date:** [February 1, 2018, 4:42pm UTC](https://in-thread.sonic-pi.net/t/chiptune-starter-pack/657/9 "2018-02-01T16:42:20Z")

</div>

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.
