Skip to content

4. Tracks, Samples & Clips

4.1 Tracks

Tracks are the lanes inside a level. A music level might have drums, bass, strings; an SFX event often has just one track with many variations.

  • + / − under the Tracks: list add and remove tracks.
  • Click a track in the list — or click its lane in the timeline — to open Track Details in the inspector (volume with double-click-to-0 dB reset, Mute / Solo, and everything in ch. 5).
  • Drag tracks in the list to reorder them; the timeline lanes follow. Order is purely visual — it doesn't change the mix.

For SFX events the track panel also carries two event-wide voice rules:

  • Cooldown (0–5000 ms) — minimum time between two triggers of this event; protects against machine-gun retriggering.
  • Max voices (1–32, default 8) — polyphony cap. When the cap is hit, the least audible voice is released to make room (quietest first, the oldest on a tie), and a new trigger quieter than every playing voice is rejected instead of evicting one. An evicted voice ends through a short fixed anti-click seam (20 ms; 30 ms for Godot spatial voices), not the event's Release fade — Release belongs to the game's stop() and to emitter teardown (ch. 7.2).

4.2 The timeline

Timeline with two looped tracks

Each lane shows the track header (name, volume, MUTED/SOLO state, level) and the waveform of the current level's active sample.

  • The ruler shows bars & beats for music, or seconds for SFX and free-tempo events.
  • Ctrl+wheel zooms 1–8×.
  • The red playhead tracks preview playback, loop-aware.

4.3 The clip frame

Clip frame anatomy

Every sample plays through a clip — a trim window over the source file. The waveform is drawn full-length; the part inside the bright frame is what plays, the dimmed part is trimmed away.

  • Drag the frame edges to trim the start/end. The full source stays on disk untouched — trims are non-destructive and re-editable.
  • Fade handles (the orange corner markers on SFX tracks) drag out a fade in / fade out inside the clip.
  • LOOP appears top-left when looping is enabled for this region.
  • Hover the ? badge (bottom-right) to see the source filename.

Dragging a trim edge on a music track — the grab cursor appears on the
clip frame edge

Trimming an SFX clip — the orange fade-out handle is being dragged at
the same time

4.4 Samples

Add files with Add… in the track's sample list (ch. 5), or drag them from Finder straight onto the window. On import PFA:

  • up-mixes mono → stereo,
  • resamples to the project preview rate if needed (fast polyphase; cached),
  • keeps WAV files untouched on disk — the project references them in place (Collect Samples, ch. 13.1, copies them into the project when you want that).

Importing MP3, OGG, FLAC and friends

PFA edits and exports from WAV, but the import door takes the common compressed formats too: MP3 / OGG / OPUS / FLAC / AIFF / M4A / AAC / WMA / CAF — and an All Files pick of something more exotic still gets an honest try (the decoder sniffs the file's content, not its extension).

A non-WAV file is decoded once into a 24-bit WAV copy named <name>_<format>_<source-id>.wav (boom.mp3 → boom_mp3_1f3a9c02.wav; the short hex tail fingerprints the source's location, so same-named files from different library folders don't fight over one copy), and the project uses only that copy from then on. The one-time copy is deliberate: lossy decoders differ by a few tens of milliseconds between builds, so decoding fresh on every load could shift your trims — the copy freezes the decode forever, and the project stops depending on a Downloads folder surviving. The original file is never modified. Re-importing the same file reuses the existing copy; replace the source with a newer version and the next import re-converts.

Where the copy lands:

  • with a saved project — in the project's samples/ folder, next to collected samples;
  • before the first save there is no project folder yet, so the copy goes to the studio's user folder (~/.pfa_studio/imported_samples/). After you save, run Collect Samples (ch. 13.1) to gather those into samples/.

The source sample rate is kept, so no extra resample generation is added. At export the copy encodes exactly like any WAV source (ch. 11). One honest cost: MP3 in → OGG out at export is a second lossy generation — inaudible for typical SFX, but a WAV or FLAC master is always the better source when you have one.

Per-sample volume is set on the sample row; at export it is baked into the rendered audio together with clip volume, so engines don't pay a runtime cost (ch. 11).

4.5 Loops & loop length

For music tracks, the Region / Loop length control in Track Details sets the musical length of the loop: pick 1–64 bars from the combo or type any bar count. The cyan auto-label shows the length PFA detects from the trimmed clip at the event's BPM — with a clean trim, the detected value is already right.

The exported loop boundary is always computed from the clip's trimmed length at the event's tempo, so what loops in your game is what loops in the preview. While a transition fades a looping clip out, the clip keeps looping under the fade on all three players — audio beyond the trimmed window (a tail after the loop point) is not played during the fade.

SFX loops (sustained sounds like fires and hums) are enabled per event, not per clip — see Loop (sustained SFX) in ch. 7.

4.6 Sub-levels

Sub-level lanes in the timeline

A sub-level is a layered variant hanging under a level: the base level keeps playing and the sub adds (or swaps in) material on top — hierarchical intensity inside one level. Sub-levels are created in the node editor (+ Sub, ch. 6.7); their tracks appear in the timeline as extra lanes under the parent with an ON/OFF toggle per sub.

At export, sub-levels are flattened into the config, and the game toggles them at runtime like a mini-level inside the level.