SPACE, or PLAY: start and stop the transport 5 6 7 8 9: PLAYLIST / CHANNELS / PIANO ROLL / MIXER / HELP — FL's F5–F8, without the F keys Scratch cannot see Q / W, or - + beside BPM: tempo, 40–240 BPM. Hold the button to repeat A / S, or - + beside PAT: previous / next of the eight patterns M, or PAT/SONG: loop the current pattern, or play the arrangement T: swap the DRAW and DELETE tools N: cycle the snap: 1/16, 1/8, 1/4 X, or CLR: erase every note in the current pattern arrows: scroll the piano roll in pitch and time SAVE: writes the project code into the g_code monitor, to select and copy LOAD: paste a code back in Piano roll. Drag in empty grid to draw a note and set its length in one gesture. Drag a note's body to move it in pitch and time; drag the brighter right-hand sliver to resize it. Press T then click to delete. Click the keyboard down the left edge to audition a pitch. The channel strip at the bottom left picks which of the nine channels you are editing; the other channels' notes stay on screen as low ghost bars. Channel rack. Click a step to toggle it. Click a channel name to open that channel in the piano roll. The lamp on the left of each name mutes it. Playlist. Pick a pattern with the P1–P8 row, then click a timeline cell to drop a four-bar clip there; click a clip to remove it. The lamp beside each track name mutes that track. Only SONG mode plays the arrangement. Mixer. Drag the faders and the pan sliders. M mutes, S solos (anything soloed silences everything unsoloed). The MASTER strip scales the lot.
An FL Studio-shaped music production environment in Scratch: a real piano roll you draw notes into, a channel rack over the same events, a playlist that arranges patterns into a song, a mixer whose faders actually move the audio, and nine instruments synthesised from oscillators and noise — nothing sampled. Press PLAY. The four-bar loop and the sixteen-bar arrangement are already loaded. THE CHANNEL RACK AND THE PIANO ROLL ARE THE SAME DATA There is one note table — five parallel lists of (pattern, channel, pitch, step, length) — and both grids are views onto it. A lit step in the rack is a note at that channel's base pitch, which is exactly what a step button is in FL. Two consequences fall out for free rather than being coded: * Draw a hi-hat pattern on the rack, open the piano roll, and it is there. * Drag a note in the roll off its base pitch and the rack still shows the step — but with a bright cap on the pad, because a step button cannot express where the note actually is. The rack tells you it is lying rather than hiding it. The rack's pads are looked up through a 9×16 grid rebuilt once per repaint. Searching the note table per pad would be 144 pads × a few hundred notes of list reads on every frame of a drag. POLYPHONY IS CLONES, AND NOTE-OFF IS DELETING ONE Scratch's volume, pan and pitch are per target, and they apply live to whatever that target is already playing. So one sprite cannot hold a bass note and a lead note at two pitches: setting the pitch for the second bends the first. Clones are separate targets with their own effect state, which makes a clone the natural unit of polyphony — one clone per sounding note, up to 48. That also supplies a note-off, which Scratch otherwise does not have: there is no "stop this one sound", but **deleting a clone stops the sounds that clone started**. A gated voice waits out its note length and deletes itself, so note length in the piano roll is audible. Drums opt out (ch_gate = 0) and are queued long enough to ring, because chopping a kick at a sixteenth is not a musical choice. One trap here cost a rewrite. Scratch runs "when I start as a clone" scripts only after the cloning script yields. A run-without-refresh tick that fires eight notes and clones eight times therefore has all eight clone bodies run afterwards — reading whatever the shared parameters ended up as. So notes go onto a queue in the Stage, and the sprite that owns the samples drains it and clones itself, one note at a time, because a clone snapshots its own sprite's variables at the instant it is created. The four pitched instruments are all rendered at C4 and transposed by the pitch sound effect, whose value is in tenths of a semitone and clamps at ±360 — exactly ±3 octaves. That is what sets the roll's five-octave C2–C6 range: MIDI 36–95 is −240 to +350 from the reference, inside the clamp. WHY THE TRANSPORT IS NOT `FOREVER { FIRE; WAIT D }` Because wait resolves on a frame boundary. At 30fps every wait is rounded up to a multiple of 33.3 ms, so a sixteenth at 130 BPM — 115.4 ms — becomes 133.3 ms and the project plays at 112.5 BPM. Worse, the rounding is a step function: every tempo from 112.5 to 150 BPM lands on four frames and plays at exactly 112.5, so the whole useful dance-tempo range collapses onto one tempo and the BPM readout becomes decoration. All original - code, art and sound. See Inside is open.