Chipgrid / Documentation / Examples

Sound

The basics of the chip: one bang and one beep, melodies, drums, chords, movers and chance. The demo song uses all four voices.

10 examples. Each block is the grid as the app loads it (a . is an empty cell). Open in Chipgrid opens it ready to play; or pick it from the app’s EXAMPLES menu.

Demo song

Everything at once, using all four voices of the chip:

  • top left — drums: a clock, three step-sequences, a triangle kick and two noise sounds (hats, snare). F flashes the screen on the snare.
  • right — pulse 1 plays a melody, pulse 2 an arpeggio chord, the triangle the bass.
  • the picture — J copies each melody note to an X on the right edge and M05 scrolls left: a piano roll drawn by code. V00 sets the palette.

The kick and the bass share the triangle, so the kick steals it — exactly what happened on a NES.

# DEMO SONG  -  ctrl+enter to play #
# drums #
1Cg.......................2C8
..S*0000000*0*00000.....1D2.SCEGEAGED...# pulse 1: melod
.J.B3C2o..................P4.12
..S00*000*000*000*0.........J
.J.N010...................Xv.4..# piano roll #
..S0000*0000000*000
...N530...................gC4
..F1....................1D4.SCAFG.......# pulse 2: chord
..........................G3.24
.
..........................gC4
........................1D2.SCAFG.......# triangle: bass
..........................B2.2
.
M05..# scroll left = time #
V00..# palette + background #

Open in Chipgrid ↗ · 132 BPM

One bang, one beep

D8 writes a bang under itself every 8 ticks; the bang touches P, which plays octave 4, note C, duty 2, 4 ticks. The same bang touches F below it: the screen flashes on every beep.

# ONE BANG, ONE BEEP #
.
..D8
...P4C24
..F7

Open in Chipgrid ↗

Pulse width = timbre

A clock 8C4 writes P’s duty: 12.5%, 25%, 50%, 75% in turn. J copies the same number to the width of a bar H: the wider the bar, the wider the pulse.

# PULSE WIDTH = TIMBRE #
.
.1D4
....8C4
..P3A.2
.....J
..H0b.4
.
T6

Open in Chipgrid ↗

Melody: clock + sequence

Clock 2C8 → sequence SCEGEAGED → pulse P. Below, J copies each note to an X at the right edge — the letter is read as a number (C = 12, E = 14…), so it becomes a height — and M05 scrolls left: a piano roll. Rewrite the notes and watch the line.

# A MELODY #
.
..2C8
1D2.SCEGEAGED
..P4.12
....J
..Xv.4
.
M05.# piano roll #

Open in Chipgrid ↗

Drums

One 16-step clock shared by Js, three patterns (* = hit), a triangle kick and two noise sounds. Picture: F flashes on the snare, a random bar H every tick, wiped by K on every beat.

# DRUMS #
.
1Cg
..S*0000000*0*00000
.J.B3C2o
..S00*000*000*000*0
.J.N010
..S0000*0000000*000
...N530
..F1
.
1D4
..K
.
..0Rn
.H0.w4

Open in Chipgrid ↗

Chords & bass

G arpeggiates a chord at 50 notes a second; the triangle plays the roots. Change the chord type 2 → 3 (minor). J copies the chord’s root into the seed of a sprite O: each chord has its own creature.

# CHORDS + BASS #
.
..gC4
1D4.SCAFG
..G3.24
....J
.Oc8.7
T3
.
..gC4
1D2.SCAFG
..B2.2

Open in Chipgrid ↗

Movers & polyrhythm

Emitters every 8, 6, 12 and 10 ticks: the arrows hit the voices and drift in and out of phase. The bang each arrow becomes also touches an F below it: each lane flashes its own colour.

# MOVERS + POLYRHYTHM #
.
8E..................P5C02
...................F4
6E..................P5G02
...................F7
cE..................N010
...................Fb
aE..................B3C2o
...................F2

Open in Chipgrid ↗

Random & scales

A random index into a pentatonic scale (C D E G A): random, but never wrong. Below, a random noise mode, and random sparks: X at a random x on the bottom row, scrolled up by M21.

# RANDOM + PENTATONIC #
.
..0R4
1D2.SCDEGA
..P5.12
.
...D2.0R1
....N01
.
.0Rv
.X.n7
.
M21
T1

Open in Chipgrid ↗

Wireless

The clock and the beat are at the top left, the voice at the bottom right, and nothing joins them. @k and &k share a name: the bang travels instantly, and so does the value on n. Lay your code out the way you think about it.

# WIRELESS #
.
1D4
..@k..# sends: k a bang, n a value #
.
2C4
..@n
.
.
.
.
.
.
.
................................&n
..............................&k.SCEGA..# far away #
...............................P4.24

Open in Chipgrid ↗ · 120 BPM

Verse and chorus

A whole song. S holds 8 chords, and A adds the part to the clock: 0 plays the first four (the verse), 4 plays the other four (the chorus). The part comes from far away on the link p, and changes every 64 ticks. The bass copies the chord with J, and the palette changes with the part. Rewrite the chords and it is your song.

# VERSE AND CHORUS #
.
gC4&p.........................1Cg
..A.............................S*0000000*0*00000
D4.SCAFGAFCG...................J.B3C2o
.G3.24..........................S00*000*000*000*0
D2.J...........................J.N010
.B1.4...# two parts #...........S0000*0000000*000
.................................N530
.
wC4
..S0044.# the part: 0 = verse, 4 = chorus #
...@p
.
1DwwC4....1Dg
..?V........;
.........Qgc.7
T41
~3.4f2..# a palette per part, a ring on the bar #

Open in Chipgrid ↗ · 126 BPM

Esc