README
¶
Tick effects
Play "Frere Jacques" on the default audio device from the repository root.
CGO_ENABLED=0 go run ./internal/test/tracker/tick-effects
Add -out ./tick-effects.wav for stereo WAV output, -trace for row and
frame positions, or -repeat for another tracker pass. Replace the opening
tracker lead with a decoded clip using -sample ./clip.wav -root-hz 220.
The score opens with a short sequencer phrase, then the tracker plays the melody. Listen for the alternating PCM kicks, the quicker and wider middle phrases, the change to the bell phrase, and the final release tail. Short release ramps soften the intro notes, and stereo changes ramp over 10 ms. The render test checks peak level and adjacent-sample jumps.
Coverage checklist
| Feature | Public API | Passage and check |
|---|---|---|
| Shared player and playhead | NewReplayPlayer, Replay.StepTick, Position |
The in-Go replay shares reusable patterns across orders. The trace shows order, row, frame, and speed. WAV and player tests check exact endings. |
| Tick clock and effects | RateHz, Frame, Tick, WithChannel, Effect.Apply, SetTickDuration, SetSpeed |
The middle phrases use shorter ticks and quicker rows. The forward-loop phrase changes gain and pitch mid-note. Tests check frame rounding, tick order, and the same native sample step at 44.1 and 48 kHz. |
| Flow, restart, and repeat | LoopRow, JumpOrder, BreakPattern, EndSong, Restart, RepeatCount |
The opening phrase loops, the middle phrase jumps past an unused order and enters the bell phrase at row 1, and the final rest ends the pass. The trace and tests verify target rows and repeat PCM. |
| Voice lifetimes | StartVoice, ForegroundVoice, Emit, CutPrior, ReleasePrior, KeepPrior |
Leads overlap their release tails, the first quick phrase changes the gain of a detached voice, and the bass cuts and replaces voices. The player tests check the voice limit and retirement. |
| Continuous and scheduled sine | NewTone, Sine.NewVoice, SetPanAt, SetGainAt, SetPitchAt, RetriggerAt, CutAt, FadeAt, ReleaseAt |
A continuous sine supplies the intro pad. The scheduled bass pans, retriggers, changes pitch, fades, and cuts. The lead effect adjusts gain. Synth tests check individual controls. |
| PCM and percussion | NewPCMInstrument, LoadPCMInstrument, PitchHz, PitchSampleStep, Trigger.OffsetSourceFrame |
Pitched one-shots open the tracker melody. The quick phrases start at a source offset. The WAV test checks the melody, both kick styles, and the 909-style kick delayed by one tick. |
| Envelopes and loops | ADSR, PointEnvelope, TickVoice.ScheduleTick, LoopForward, LoopPingPong, SustainLoop |
The rising phrase releases during attack. The next passage uses a forward loop, the quick phrases use bidirectional loops and tick pan and pitch envelopes, and the bell phrase releases a sustain loop. The 909-style kick uses tick volume. Tests check the stereo change and audible tail. |
| Duration-based score | NewSequencer, Note, Track, Silence |
The intro overlaps the lead and pad and leaves a rest for the pad tail. The WAV test checks the intro notes and exact overall length. Sequencer tests check overlapping tracks, clipping, rests, and empty scores. |
Click to show internal directories.
Click to hide internal directories.