Patterns, Tracks & Effects
On this page you build a beat while it plays: you change its patterns, add a bass track, and put a filter and a delay on the drums. The music never stops until you stop it.
Work in the hello project from Your First Sound.
Write each step into src/main.non, select it, and press Cmd+Enter. Every step adds to what the
previous one built.
Before you start
Section titled “Before you start”Open hello/src/main.non. Evaluate RESET; on its own, then remove that line.
The session should be silent before you run the setup below; this also clears earlier effects.
Each later block adds to the setup.
Start the beat
Section titled “Start the beat”use "std/instruments" { Sampler, Kit };
let drums = AudioTrack("drums");drums.set_instrument(Sampler(Kit("CR-78")));
drums << [bd sd bd sd];
PLAY;Change it on the beat
Section titled “Change it on the beat”Run this line early in the bar, and then run it late in the bar:
drums << [bd _ sd _, hh hh hh hh];The change never happens in the middle of the bar. The current cycle finishes, and the new pattern starts on the next downbeat.
Add a track
Section titled “Add a track”A second track plays next to the first one, in time with it:
let bass = AudioTrack("bass");bass.set_instrument(Sampler(Kit("TR-808")));bass << [bd _ _ bd, _ _ bd _];It starts on the next cycle. Each track has its own instrument and its own pattern.
Add an effect
Section titled “Add an effect”An effect processes the sound of a track, like an insert on a mixer channel. Put a lowpass filter on the drums:
use "std/effects" { Lowpass, Delay };
drums.set_effects(#[Lowpass("lowpass", 1200)]);The drums sound darker. Now run the same line with a delay after the filter:
drums.set_effects(#[Lowpass("lowpass", 1200), Delay("delay", 0.25, 0.4)]);The drums echo. .set_effects() takes the whole chain, in order. The filter was not built again: it is the
same filter, with the same settings, and it did not stop for a moment. You can add, remove and
reorder effects this way while the music plays.
Use the transport keys
Section titled “Use the transport keys”Try the keys while src/main.non is open:
- F5 pauses. Press it again, and the music plays on from the same place.
- Shift+F5 stops and goes back to the start. The echoes of the delay ring out.
- Press Shift+F5 three times, and everything that still sounds is cut.
The tracks are still there after a stop. Press F5, and the beat comes back from the start.
Next steps
Section titled “Next steps”- Your First Project — the next tutorial: save the beat as a piece and run it from the terminal
- Transport — exactly what
PLAY,PAUSE,STOPandRESETdo - Pattern Basics — after Getting Started, explore step lengths, pitches and variations