For AI agents: the complete documentation index is available at ../../llms.txt, the full documentation bundle is available at ../../llms-full.txt, and this page is available as Markdown at ../../docs/features/onboarding.md.

Feature — Onboarding

A one-time intro shown to new users: one screen — a film of the app being played, the product in one line, and Start. Completion is persisted in MMKV so returning users skip it.

The old six-step carousel (and later four-slide pager) is gone, with its slide art (hero-feel, hero-learn, hero-skills, hero-create and their tablet crops, ~4.7 MB; removed 25/11/2026). None of it was preloaded at launch, but the generated asset manifests require every file in their folder, so it all shipped in the app.

One script. Onboarding runs the one flow below: the film and Start, the tutorial's Welcome, the choice of one of three songs, a guided first song, its result, the video paywall (a non-subscriber), then Home. There is no post-onboarding paywall and no choice of script; every install walks the same run (onboarding_script was removed 04/12/2026).

Files

src/features/onboarding/
  store.ts                              # zustand + MMKV; Start gate; the film's playback state
  slides.ts                             # TitleLines (OnboardingTitle) + PAYWALL_HERO_BAND
  onboarding-video.pure.ts              # which film, and when the screen swaps films
  useOnboardingVideoSource.ts           # useOnboardingScreenFilm (screen), useOnboardingVideoSource (video paywall)
  start-cta-pulse.model.ts              # Start's lift, on the shine's beat
  useStartCtaAttention.ts               # one UI-thread clock for the lift and the shine
  start-cta-entrance.model.ts           # Start's pop-in
  screens/OnboardingScreen.tsx          # the one screen: film, copy, Start
  components/
    OnboardingIntroFilm.tsx             # the film band (VideoPlayback)
    StartCtaEntrance.tsx                # Start's pop-in, timed on the UI thread
    OnboardingTitle.tsx                 # multi-line, multi-segment title (Welcome uses it)
    OnboardingHero.tsx                  # the portrait paywall's cover band
    CoverWall.tsx                       # its scrolling cover columns

Route: app/(onboarding)/index.tsx re-exports OnboardingScreen.

Visual stack

LayerOwnerNotes
BackgroundOnboardingScreenSolid theme.colors.sessionResultBackground (#04051A).
FilmOnboardingIntroFilmAbout two thirds of the screen, its foot dissolving into the copy. See Film.
Title / descriptionOnboardingScreenONBOARDING_INTRO_COPY, the accent line through TextOutline.
CTA<PrimaryButton variant="gradientLight">Pops in with the film (StartCtaEntrance, start-cta-entrance.model.ts): 150 ms after the film's first frame, or 400 ms after the mount at the latest, it grows 0.8 → 1.06 → 1 over 260 ms and fades in on the way up (fade only under Reduce Motion). Then every 3.8 s (SHINE_PERIOD_MS) the soft shine sweeps across it (1.3 s) and it lifts to 1.025, peaking as the streak passes the middle (up 650 ms, down 950 ms, sine curves), then rests (useStartCtaAttention, start-cta-pulse.model.ts). One UI-thread clock drives both. No shine and no lift under Reduce Motion.
Hero (portrait paywall)OnboardingHero → CoverWallThe portrait paywall's band (PAYWALL_HERO_BAND: 375 / 575 on a phone, 72% of the height on a tablet), drawn as six tilted columns of song covers that scroll endlessly: columns 1, 3, 5 up and 2, 4, 6 down. Each column is one strip (cover-column-1…6.webp, left to right, 247 px wide with 246 px covers): columns 1, 3, 5 hold six covers (247 × 1624 px) and 2, 4, 6 hold five (247 × 1348 px). Every column loops in ten seconds a cover (60 s or 50 s), so all six move at one pace, and draws its strip as many times as the box needs for the loop to have no seam. A fixed fade lies over them into the paywall's background. Geometry, the strips' sizes and the per-column offset live in cover-wall.model.ts; a test holds each file to the size listed there. Still under Reduce Motion; the loop is cancelled when the paywall closes.

Film

The single onboarding screen opens on a film (OnboardingIntroFilm, played through the app's shared VideoPlayback, an expo-video VideoView; the ad backfill uses the same component). The video paywall plays the same film through the same component. The one film is ShowOff, everywhere.

The film plays at once (DEV 25/11/2026; it used to wait for Remote Config, and the band stayed dark meanwhile). On a launch whose app-open chime is still sounding it waits for the chime's end, a fraction of a second (useOpenAppSoundDone): the player's set-up reconfigures the audio session and broke the chime up. useOnboardingScreenFilm hands the screen ShowOff from its first frame, and the film loops for as long as the player reads. It never waits for Remote Config, and there is no second film to swap to. The state is the onboarding store's film.started (set by markFilmStarted on the first frame, which times Start's pop-in). The video paywall (useOnboardingVideoSource) plays the same file.

Start waits for the locked variant. Once the screen is seen (the splash has gone), decideOnboardingVariant locks the install's A/B-tested values (tutorial_song, mon_pkg; experiment-decision.ts): the console's answer if this launch's fetch lands within 3 s (EXPERIMENT_DECISION_WAIT_MS) or an earlier launch fetched it, else the in-app baseline (the console's three songs, no ads arm). Until then Start shows a loading state and takes no tap; the film does not wait. Start waits for nothing else, and never past one ceiling: ONBOARDING_START_GATE_CAP_MS (3 s, kept equal to EXPERIMENT_DECISION_WAIT_MS) after the screen is seen, started by decideOnboardingVariant (onboarding-start-gate.pure.ts, selectStartReady in the store). Past it Start takes a tap even if the variant is not locked yet; Remote Config keeps its own timeout. The tap Start takes sends fn_splash_start (with session), once: a tap on the loading Start sends nothing, nor does a quick second tap.

No GPU prewarm on the onboarding screen (DEV 19/11/2026: it held Start and made the film hang). The tutorial song warms the GPU under its own loading card, as every song does: the first-hit rehearsal fires each kind of effect once before the 3-2-1 (piano.md, "Loading gate"). To try a fallback install in a development build, set EXPO_PUBLIC_AB_FORCE_FALLBACK=1 in .env.local: the screen ignores the fetch, waits the full 3 s and locks the baseline. With EXPO_PUBLIC_ONBOARDING_REPLAY=1 beside it every Metro reload is a new try, since the replay also clears the lock. Release builds ignore both. The lock sets the ab_source user property (remote | fallback) and, for remote only, sends ab_config_applied — the activation event of every experiment on these keys, so the Firebase A/B report leaves fallback installs out. The wait is reported as onboarding_perf.config_wait_ms. The tutorial's songs and covers are fetched once the variant is locked (prepareTutorialAfterConfig), so they are this variant's. Start also lets the piano sampler load (AppStartupPolicy): starting its audio engine during the film would duck the film's music.

FilmFile (src/assets/onboarding-video/)MasterPlays when
showoffshowoff.mp4onb_showoff.mp4every install

The film ships in the app only: there is no build switch and no Remote Config key for it. ShowOff was kept after the owner tried it against a RushE film as two TestFlight builds; the RushE film and the onboarding_video key (which could replace a film with a URL) are gone. A console that still serves onboarding_video is ignored like any unknown key.

Encoding. The shipped file is 1080², 30 fps, HEVC tagged hvc1 (the tag AVPlayer plays), 1.24 MB. The film was shot in a dark room, so the encode carries a 1.25× gain on each colour channel (RGB, so blacks stay black and the foot still dissolves into the page without a seam); nothing is filtered at runtime. The master (1080², 60 fps) is gitignored under src/assets/onboarding/Onboarding_video/; it is the cut delivered on 22/10/2026 (HEVC, ~2.8 Mbps). Encode from it, never from a shipped file (a second HEVC pass costs quality):

ffmpeg -i onb_showoff.mp4 \
  -vf "fps=30,scale=in_range=tv:in_color_matrix=bt709,format=gbrp,colorchannelmixer=rr=1.25:gg=1.25:bb=1.25,scale=out_color_matrix=bt709:out_range=tv,format=yuv420p" \
  -c:v libx265 -preset slow -crf 24 -tag:v hvc1 -colorspace bt709 -color_primaries bt709 -color_trc bt709 \
  -c:a aac -b:a 96k -ac 2 -movflags +faststart showoff.mp4

ShowOff re-encode (DEV 25/11/2026). ShowOff was 2.05 MB (video ~1.5 Mbps). It is now -preset veryslow -crf 28 (video ~0.86 Mbps, 1.24 MB, −40%), chosen over CRF 26 / 27 after a side-by-side on device frames: SSIM 0.992 / PSNR 45.9 dB against the previous file, no visible loss at 100% on the busiest frames (PERFECT text, particles, the glow line). The master was not at hand, so this pass was encoded from the shipped file (a second HEVC generation); re-encode from onb_showoff.mp4 with the same settings when the master is available:

ffmpeg -i onb_showoff.mp4 \
  -vf "fps=30,scale=in_range=tv:in_color_matrix=bt709,format=gbrp,colorchannelmixer=rr=1.25:gg=1.25:bb=1.25,scale=out_color_matrix=bt709:out_range=tv,format=yuv420p" \
  -c:v libx265 -preset veryslow -crf 28 -tag:v hvc1 -colorspace bt709 -color_primaries bt709 -color_trc bt709 \
  -c:a aac -b:a 96k -ac 2 -movflags +faststart showoff.mp4

After adding, removing or renaming a film, run bun run assets:sync (the asset manifest is generated and gitignored).

The film fills about two thirds of a phone, ~1,800 px tall on a 3x screen. The earlier 720², ~0.5 Mbps encode was stretched 2.5× and its text and badges smeared; H.264 at the new quality would weigh about twice as much. onboarding-film-assets.test.ts holds each file to hvc1 at 1080². Android support for HEVC varies by device: encode H.264 (-c:v libx264 -tune film -crf 23) if these files ship there.

Title segments

A title is TitleLines = readonly (readonly TitleSegment[])[]: lines of segments, each solid white or carrying the brand scoreNumber gradient (gradient: true). OnboardingTitle draws each line as one <TextOutlineRun> (one Skia canvas per line); the tutorial's Welcome screen uses it. See <TextOutlineRun> in src/components/TextOutline.tsx.

State

interface OnboardingState {
  hasCompleted: boolean;
  complete: () => void;
  startPressed: boolean;
  variantReady: boolean;
  configWaitMs: number | null;
  gateCapReached: boolean;
  /** The film (ShowOff): its first frame has shown. */
  film: { started: boolean };
  reset: () => void;
}

MMKV key: onboarding. Only hasCompleted is persisted; everything else is in-memory and a cold relaunch starts fresh.

Flow

During FTUE, the tutorial gameplay song, the friendly arm's whole offer, the reward picker's Claim and the choose screen's Get are permanently unlocked as "promo" library entitlements (no rewarded ad). See songs.md.

From the welcome to the song (goToTutorialSong): the welcome's "Let's go!" goes straight to the choose screen, or to the song (tutorialSongRoute). A "Now you're ready to play your first masterpiece!" beat stood there for 1.5 s until the PO removed it (23/10/2026). The hand-off still sends its fn_tutorial_set, and waits for the run's MIDI as the beat's time let it, at most TUTORIAL_SONG_HANDOFF_MAX_WAIT_MS (1.5 s) — no wait once it has arrived, which is long before the welcome is left.

The onboarding test values. Remote Config's tutorial_song (the three songs offered) and mon_pkg (the monetization arm) shape the run. Builds 1.0.11–1.0.13 also read onboarding_script and is_public; this app does not (see remote-config-removed-keys.md).

  • Default: an install the console names no tutorial_song for plays the app's copy of the console's value (No Batidão, APT, Twinkle — excerpts the app ships), so an install that cannot fetch walks the same run as everyone else; change them together with the console. The persisted config is the last-known-good, so a failed fetch keeps the console's last songs.
  • Locked for good: tutorial_song and mon_pkg are locked once per install (experiment-lock.pure.ts, kept in MMKV and laid over every Remote Config update by the store), so a fetch that lands later — Firebase placing the player in a group after they met the baseline — changes nothing they play. The monetization slice reads the locked mon_pkg too (readEffectiveMonetizationValue; the DevTool's rules still win). Only a console ab_lock_version above the round an install locked in lets it lock again: bump it when a test starts or ends, never while one runs. Where and when the lock is taken is the onboarding screen's decision.

Trying the tutorial's songs without the console (development builds only; the store build ignores these, so players are never touched). In .env.local:

EXPO_PUBLIC_RC_MON_PKG='{"variant":"balance"}'
EXPO_PUBLIC_RC_TUTORIAL_SONG='{"three_songs":[{"name":"APT.","song_id":"apt","midi":"https://drar523gvaj67.cloudfront.net/Q4_Folder/tutorial_1stUA_package/APT_RoseBrunoMars_tutorial.mid"},{"name":"Dance Monkey","song_id":"dance-monkey","midi":"https://drar523gvaj67.cloudfront.net/Q4_Folder/tutorial_1stUA_package/DanceMonkey_TonesAndI_tutorial.mid"},{"name":"Fur Elise","song_id":"fur-elise","midi":"https://drar523gvaj67.cloudfront.net/Pack1_15Songs_2/Song_tutorial/FurElise_Beethoven_tutorial.mid"}]}'
EXPO_PUBLIC_ONBOARDING_REPLAY=1

EXPO_PUBLIC_RC_TUTORIAL_SONG replaces tutorial_song and is read entry by entry, as the console's value is. APT. and Dance Monkey are rewarded-video songs whose excerpts the app ships (no download), so picking one shows the unlock. With "balance" the picked song is free in the Song list afterwards, the reward picker follows the song, and the song not claimed stays locked; with "friendly" all three are free after Get. Restart Metro after editing .env.local.

The run. Welcome → Pick Your First Song (/(tutorial)/choose-song): one of the first 3 of tutorial_song.three_songs; what is unlocked follows the arm's tutorial.free_songs (see below) → the guided first song (Guided first song) → the Game Mode result (/(tutorial)/song-result).

  • Friendly (3 free): the player chooses Song list, Next or a suggested song from the result, which end the tutorial there (no Replay).
  • Other arms (2 free): the result shows only its score (stars, score, judgements — no suggestions, no buttons), then goes on to the reward picker (/(tutorial)/reward), see below.
  • Video paywall: a non-subscriber sees it over the result; the first-song paywall waits for the 4th song_end.

The "get a song" step is reported as fn_tutorial_get_song (song_id, song_name) on the choose screen's Get, before the song starts (tutorialChoiceGetSongParams names the song by its catalog id, as the song's own events do).

The choose screen (TutorialChooseSongScreen, rules in choose-song-store.ts). Its cards rise in one by one on the reward picker's keyframes (below), 72 pt apart (100 on tablet). No consent (UMP) or tracking (ATT) prompt opens here, nor on the welcome. The consent (UMP) and tracking (ATT) prompts are asked right after the splash (DEV, 26/11/2026 — PostSplashPrivacyPrompts, askPrivacyPromptsAfterSplash in tutorial-privacy-prompts.ts) for a player still in the funnel, over the onboarding video, which goes on loading under them (nothing pauses it); a player past the tutorial is asked on the splash itself (requestAttAtBoot). The ad SDK starts as they are answered (requestGuardedAttThenPreloadAds, DEV 02/12/2026), as at boot: it was held to the run's end while the prompts were asked there, and its start and first ad loads then ran under the reward picker's Claim. Ad loads still wait out the tutorial song (holdTutorialAdPark). The prompts no longer ride with the video paywall, and no exit waits on them: an exit used to wait on their answer, and the reward picker's Claim froze when it never came. The video paywall (a non-subscriber, useTutorialRunEnd) opens over the first song's result on every run: as its reveal settles, or — where the result leads to the reward picker — after its short hold, the picker taking its place underneath (DEV 02/12/2026, below). The choose screen is the reward picker's stage without the claim (DEV, 26/11/2026 — TutorialPickerStage, the shared card TutorialRewardCard in mode="pick", clocks in usePickerClocks): the title drops in, the cards rise in one by one (sounds ftue_title_in, ftue_card_swoosh; loaded as the tutorial opens, warmFtueSfx in TutorialEntryScreen — until DEV 02/12/2026 they loaded with the song, so this screen skipped the first play of each, ftue_scene_transition included). Play presses as Start does (squish, sparkles, cta_press) and then enters the claim clock where the reward picker's Claim has opened its lock (PICK_FROM_MS, 430 ms): the button leaves, the other songs and the title fade, the picked card moves to the middle and grows under the halo's rim, pulse and light rays — no lock, no glow, flash, ring or particles; no song previews past the pick (DEV 02/12/2026); at the launch cue (2.7 s after Get, ftue_scene_transition) it zooms into the light wipe, and at the wipe's peak (3.14 s after Get) the song screen fades in on its loading card (pickCue → revealDone). Before the pick each cover previews its song with its badge, and the cover whose song is sounding turns like a record (once every 6 s) and kicks on each note (DEV, 27/11/2026 — option 5 of the cover-effects preview, in place of the waves; useCoverRecord). Past the pick the badge fades out and the cover takes no tap (previewEnabled={!locked && pickable}). Step by step in Choose → play, step by step. Until DEV 25/11/2026 the pick reveal handed over at its settle (~950 ms) and the song screen carried the reveal on, settled: the song's load then landed on the route's fade with the choose screen still up, which held the fade back and froze the rays before a jump. On the song screens that do play a reveal (the run's later songs: entrance="drop"), at the hand-over (the hold over, the rays at rest) the song's lane and keyboard mount under the still reveal, and the reveal leaves only once the song is ready, straight onto its Get ready! card (tutorialRevealLeaves, tutorial-reveal-handoff.ts); a song still not ready 2.5 s after the hand-over (TUTORIAL_REVEAL_READY_WAIT_MS, a UI-thread clock) gets the loading card. Two things keep the cover from flickering out and back there: the song screen renders at once from its already-loaded module (lazyRoute + memoLoader.peek, no lazy() first-render fallback), and SongRevealCover draws from the memory/disk image cache (it used cachePolicy="none", reloading the cover in every new view) with no fade in the reveal (artFadeMs={0}):

  • How many songs. Always the first 3 entries of three_songs (fewer only when the console names fewer), so order the list by priority (tutorialOfferSize).
  • How many are free. Fixed by the install's monetization arm — friendly (and no arm) 3, balance / aggressive / very_aggressive 2 (mon-arms/); before the arm is known the friendly 3 stands. The console cannot change it: a tutorial.free_songs in mon_pkg is ignored and noted (mon-pkg-mapper.ts), and the tutorial holds any count to 2–3 besides — the PO changes only which songs (tutorial_song). It becomes the run's reward plan (tutorialRewardPlan), fixed with the run's songs:
    • grant_all (free ≥ songs offered — friendly): Get unlocks every offered song for good in the Song list (promo grant, even when a row is VIP or a rewarded video). (The line that said so under the cards, "All 3 songs stay unlocked in your song list." The song ends on the Game Mode result as before.
    • pick_after_play (2 ≤ free < songs offered — the other arms): Get unlocks only the song picked (its line under the cards, "The song you pick stays unlocked in your song list."). After its excerpt the Game Mode result shows only the score (SessionResultOverlay summaryOnly: stars, score and judgements, centred; no suggestion column, previews or buttons), holds TUTORIAL_SCORE_HOLD_MS (2 s: the stars' 1.5 s pop-in, then 0.5 s to read it; DEV 02/12/2026) after the count-up, and goes on to the reward picker (tutorialResultLeadsToReward). Where the video paywall shows, it opens over the result first; once it covers the screen (PAYWALL_COVER_MS) the picker replaces the result underneath, and the picker's intro and sounds wait for the paywall to have gone (useRewardIntroReady, tutorial-reward-handoff.ts). The route's offered=1 keeps the picker from opening it again.
    • single: a run with only one distinct song — that song.
  • Screen copy (DEV, 25/11/2026). The title alone: the line under it ("A short version…"), the line under the cards and the cards' difficulty tags are gone. The reward picker drops its line under the title too ("Choose 1 song…") but keeps its cards' tags.
  • Cards. Title, artist and a Get button. The run's difficulty (the console's difficulty / diff_tag, PO 09/11/2026) is not drawn on these cards (hideDifficulty); the pick reveal and the song's intro still name it. The cards (two or three) always sit in one centred row capped at their Figma width; where the width is short (a small iPad with three cards) they narrow evenly instead of scrolling (TutorialPickSongRow).

No paywall reads Remote Config enableIAP: that flag only switches the single-song deals (the No Ads package no longer follows it either — see remote-config-enable-iap.md). The onboarding paywalls — the video paywall and the held-back first-song paywall — show whatever it says (paywalls-ignore-enable-iap.test.ts).

The reward picker (TutorialRewardScreen, /(tutorial)/reward, rules in reward-song-store.ts) ends the song on pick_after_play runs: "Great job! Pick your reward — Pick 1 song to unlock". It shows the offered songs the player did not play, locked, each with Claim.

  • The claim flow (DEV's prototype "Reward Unlock -> Gameplay", 26/11/2026, applied keyframe for keyframe — times, easings, distances, colours and sounds: reward-unlock-timeline.ts over the prototype's kf() / bez() port in @core/motion/keyframes; flow in reward-claim-flow.pure.ts). It runs by itself from the Claim — no Play, no "Unlock later…": choosing → claiming → launching → done. Intro (from the screen's arrival): "Great job! Pick your reward" drops 10 pt as it fades in, "Pick 1 song to unlock" a beat later from 8 pt; each locked card rises 14 pt, fading in and growing from 0.85 with an overshoot (its Claim from 0.9), 100 ms after the card before it; each lock nudges once (1.06) while the player chooses; sounds ftue_reward_in (DEV's stinger, REWARD_OPENING_SFX) and a ftue_card_swoosh per card; the cards being in (0.6 s for two, cardsIn cue → onEntranceDone) opens the video paywall only on a picker a relaunch reopened, with no result before it. Claim (its own clock, 0 = the press's action): Claim presses as Start does (SquishPressable: squish, sparkles, cta_press; DEV 02/12/2026), its action 180 ms after the release; the other Claim dims to 35 %; the lock shakes (±8° → ±6°), pops (1.18) and comes apart — the shackle lifts 7 pt and tilts −20° about its bottom right, the lock rises 14 pt and shrinks as it fades — as the veil lifts, a soft blue glow comes up behind the cover, a white flash and a light-blue ring spread and 16 particles (gold stars, cyan sparkles, lilac dots) fly out; the cover bounces (1.06); the other card fades, shrinking to 0.9 about its middle and sinking 8 pt; the copy floats up as it fades; the claimed card moves to the screen's middle and stays its own size (no grow — the prototype's ×1.25 showed the 256 px thumbnail's pixels; the halo's rays and rim are laid out at the size the prototype showed them, HALO_SIZE_KEEP), and the halo comes: light rays turning 13°/s, spreading from 0.3 and breathing, a bright rim and one pulse out. Sounds ftue_lock_shake, ftue_unlock_burst, ftue_cards_fade, ftue_card_to_center, ftue_halo, then ftue_scene_transition at the launch cue (3.15 s). No preview plays under the halo, and no rings leave the cover (the prototype's; removed by DEV 02/12/2026). Zoom (the launch cue, phase launching): the card's name and difficulty fade, the card zooms from 1× by 3.2 more and lifts 40 pt as it fades, its halo and rim with it (claimedTravelAt, claimedFadeAt), into the light wipe (TutorialTransitionWipe over the shared LightWipe: a white-to-blue radial light at 50 % × 45 %, rewardWipe*, peaking at 0.85). Sharpness (DEV, 27/11/2026): the picked card sits at 1× in the middle and scales up only in the zoom — its 256 px thumbnail already shows 228 px on a 76 pt cover @3x, and the prototype's ×1.25 there read blurred all through the halo (DEV 02/12/2026); its cover art (SongRevealCover fullResArt) and the halo's rays and rim (ImageCache allowDownscaling={false}) keep their files' own resolution instead of being decoded at their views' size; the name under the cover is still text scaled by the card's transform. Hand-over at the wipe's peak (3.57 s, handOver cue, HAND_OVER_MS): finishLaunch brings gameplay's loading card up at once under the same light at its peak, which clears over it in 480 ms (HAND_OVER_FADE_MS; showPlayLaunchCoverUnderWipe → LightWipeClear in PlayLaunchCover), and the claim commits once it is clear — one light clearing rather than the picker and the card crossfading (DEV, 27/11/2026, option 2 of the hand-over preview). The prototype cut straight to the song; the app loads it on the loading card (DEV, 26/11/2026). Drawing: the halo's canvases are drawn once, when the picker mounts, and only their views move (turn, breath, spread, fades) — no Skia work or blur on any frame of the pick (the halo dropped frames as it came, DEV 26/11/2026). The unlock burst (flash, ring, 16 particles, the halo's pulse) is one Skia canvas (30/11/2026: it was ~20 — a canvas, and a GPU surface for the compositor, per piece — and the Claim dropped 11–25 frames where the choose screen's pick, without them, dropped none): each frame of the claim clock records one picture (unlock-burst-frame.ts) — the ring's glow and the flash as images baked once on idle after mount (unlock-burst-art.ts, useUnlockBurstImages), so no blur runs on a frame; the ring line (its width animated directly, 3 → 0.8 pt) and the particles drawn live, sharp at any scale; the canvas drawn at the grown card's size and shrunk back by its view. A picture is recorded only while something shows (01/12/2026, unlockBurstClockAt: the burst's span, then the pulse's; −1 otherwise, which a shared value set to what it holds does not pass on), so before the pick, between the burst and the pulse and after it the canvas is not redrawn; its paints are made once (a frame only sets alphas); and while nothing shows it draws the two baked images 1 pt wide at alpha 1/255, so their GPU upload is done before the flash. Each lock's canvas reads the shackle's own clock (shackleClockAt), held outside the shackle's move, so it redraws only for that ~0.1 s. The halo's rays and rim are the prototype's, exported as PNGs @1x/@2x/@3x at the size the centred card shows them (ftue_halo_rays, 550 pt; ftue_halo_rim, 133 pt — so a phone's @3x lands 1:1; DEV 26/11/2026: drawn in Skia they read soft at 1×, 2× and 3×); The other bitmaps are drawn at FX_SHARPNESS times the largest size each shows, released when the picker unmounts. A card turns about its cover by translate-and-scale from its measured height, never a transform origin (the halo sat off the cover). The lock is the prototype's 36 × 40 SVG in Skia (TutorialRewardLock); the light is two picker-wide layers (Skia canvases drawn once, and the two PNGs) kept on the claimed cover as it moves — under the cards the glow and the rays (TutorialRewardHalo), over them the flash, ring, particles and pulse on one canvas, and the rim (TutorialUnlockBurst); colours are reward* theme tokens. Nothing mounts or renders on the claim: every part is mounted with the screen (the light layers' canvases drawn once at mount, hidden until the claim) and moves off two UI-thread clocks — introSv from the arrival, claimClockSv from the Claim — sampled with sample(); the clocks' cues hop to the store on the JS thread (introCue / claimCue, which play the sounds — loaded as the tutorial opens, warmFtueSfx — and take the flow's steps; usePickerClocks, shared with the choose screen). The store takes the tap at once (claim returns true) and its phase and claimed card land on the next idle slot (≤ 150 ms, reward-claim-commit.ts; the launch cue lands it first if it ever comes sooner); a second tap meanwhile is turned away; the Labs clone's Reset drops a claim still waiting (reward-claim-no-render.contract.test.ts). The prototype's tap marker (its "show touch point" toggle) is a demo aid and is not drawn.

  • The commit unlocks that song for good (promo grant), ends the tutorial and opens the song's full chart directly (pendingPlay { kind: "play", full: true } → /(app)/play?full=1, songPlayType: "tutorial_next"). It runs only once the light has cleared over the loading card (the grant and the tutorial's end together), so a kill mid-animation reopens the saved picker with nothing taken. The Song list is not mounted under it; pause → Songs and the result's Songs replace onto it (leaveToSongList), so they land there as any song does.

  • The song not claimed keeps its catalog lock: a rewarded-video song opens with one rewarded video, a VIP song needs VIP.

  • End jobs (useTutorialRunEnd, shared with the result): song_result (sent by the score-only result before it), reachedResult for a relaunch, and the video paywall, opened over the result before this screen (closing it shows the picker). Only a picker reopened by a relaunch opens it itself, once its cards have appeared. The claim's commit waits on nothing.

  • Drawing (TutorialRewardView, cards TutorialRewardCard → TutorialRewardCover + TutorialRewardCta): display and animation only — the screen hands it rewardSongView(), the flow's phase and the store's actions. The Labs clone draws the same view.

  • Testing without a reinstall: Component Labs → Claim reward → Open claim screen pushes a clone (/lab-claim-reward, ClaimRewardLabScreen, store claim-reward-lab-store.ts) over the app, after the tutorial. Its cards come from tutorial_song.three_songs the catalog knows, then catalog rows, to three songs, less the song "played" (Played #1–3 chips). The whole claim flow plays, but nothing is granted, no song opens and the tutorial store is untouched (the status chip shows the step; sounds play). Tune reward-unlock-timeline.ts here. Reset remounts the view (previews, entrance and claim state replay); Close pops it and reopens Labs.

The choosing runs' result (TutorialSongResultScreen) is the Game Mode result (SessionResultOverlay, Play tab lit). It shows the excerpt's score, frozen at game over (tutorial-song-result.ts).

  • Kept from Congrats: song_result, the video paywall and the tracking prompt (after the paywall where it shows). The last two happen on the run's first result only, after the reveal.
  • Not run here: interstitials, and the first-song and replay paywalls.
  • No Replay: the action row has Song list and Next song only (SessionResultOverlay without onReplay); each tutorial song is played once.
  • Leaving: Song list and Next complete the tutorial. A suggestion rides out with the completion (pendingPlay). An exit into gameplay (the reward picker's Claim, a gameplay suggestion) never lands on the Song list: complete() fixes exitHref (tutorialExitHref in tutorial-exit.ts) with hasCompleted in one update, and the root layout passes it to the tutorial group's Stack.Protected redirectTo, so the guarded tutorial screen replaces itself with /(app)/play and the app's stack opens as [play] alone. Before, the app landed on the Song list and gameplay was pushed over it once it was up; taps during that hop reached the Song list under the cover (paywall, another song). With nothing under gameplay, its exits go through leaveToSongList (pop when the Song list is underneath, else replace onto it), and Android's back does the same (useHardwareBackToSongList in app/(app)/_layout.tsx). The other exits — a locked suggestion (its rewarded video first, as on the Game Mode result) or a Learn one — still land on the Song list, where TutorialExitHost opens them (tutorialExitNeedsHost). A gameplay pick raises the root PlayLaunchCover first, so nothing (and the Game Mode result's replace into a next song / replay) shows before gameplay; the cover also takes the touches, so nothing it hides can be pressed. The cover wears the loading card's face (PrepareLoadingFace: the prepare art and the piano-keys loader), and it lifts only once BOTH the play route has arrived (useScreenEntered → markPlayLaunchEntered) and its loading card has painted (PrepareLoadingOverlay, two frames after mount → markPlayLaunchCardPainted), so the hand-off from cover to card is invisible. A 4 s backstop, counted from the navigation, lifts it if gameplay never arrives. A play visit opened under the cover carries cover=1 (playParamsUnderCover / playHrefUnderCover) and opens without the stack's fade (playOpensUnderCover in app/(app)/_layout.tsx): on a first play, with the Song List mounting at the same time, the cover could lift on the route's 700 ms arrival backstop while the fade was still running, and the Song List flashed through the half-faded play screen (iPad A16).
  • Choosing the next song: the result's song cards carry no CTA. A tap selects one (the top card by default), and Next opens it — with the video glyph when it is ad-locked (songs.md).
  • No Learn tab: Learn Mode opens after four finished songs, so a first-run player sees no toggle here — only the Play recommendations under "Recommended for You" (songs.md).
  • Waits for tracking: every exit waits for the tracking answer.
  • Relaunch: reaching the result ends the run for a relaunch. A player who quits the app on the result or under the video paywall comes back to the song list. The result sets the tutorial store's persisted reachedResult; the screen on view stays up, and the next cold start restores the tutorial as complete (restoreTutorialPersistedState). Except a reward picker still owed a claim (pick_after_play): the run's end also saves the picker's cards (pendingReward, reward-song-store.ts reachEnd), so a player who quits on the score-only result or on the picker comes back to that same picker (TutorialEntryScreen opens it in place of the Welcome), not the song list. The saved cards win over a relaunch's fresh offer; Claim clears them with the tutorial's completion. Before the result, a relaunch starts the tutorial again (Welcome), but a choosing run whose song was already picked does not offer the choice again: the pick is saved as it is made (savedPick, choose-song-store.ts), and the hand-off (goToTutorialSong) replays that song (resumePick, found by catalog file in the rebuilt offer, else its old place), so a second pick cannot unlock a second song. Cleared with the tutorial's completion.

The choose screen has no close: the player picks one of its songs.

Song previews on the choose screen. On "Pick Your First Song" each cover is a preview button: a tap plays fifteen seconds of the song (the badge turns into the moving wave), and the songs also play one after another on their own, each fading in over half a second (TUTORIAL_PREVIEW_FADE_IN_MS). Every picker comes in top to bottom (reward-claim-motion.ts): the title block drops in as it fades in (TutorialTextEntrance, inside TutorialPickerHeader), then the cards scale in left to right, then the line under them (the choose screen). The preview badges pop in (fade, scale up) only once the cards are all in (useTutorialPickerPreviewStore.cardsIn, set by TutorialPickSongRow), and the first preview starts a second after that pop (PREVIEW_START_AFTER_CARDS_MS) — not with the entrance, whose frames it cost. It is the result screens' queue (useSongPreviewQueue) without their 3 s wait and 2 s fade, which hold the music back for the score; here the songs are the screen. On the choose screen the queue repeats: after its last song it goes back to its first, in the same order, until the player taps Play (repeat: true; the picker and every other screen play their songs once). The choose screen's sounding cover is a record (DEV, 27/11/2026): its art turns inside its ring once every COVER_TURN_MS (6 s) and coasts on to upright when the song stops; every note the preview plays (subscribeBeats) kicks the whole cover (up to 1.07, settling in 450 ms; useCoverRecord, timings in reward-claim-motion.ts). Transforms only — no canvas, nothing to compile on the first note; still under Reduce Motion; the reward picker's covers keep still. The waves (TutorialPreviewRipple) are gone, and so are the preview and the rings that played under the halo after a pick (DEV 02/12/2026). A choose-screen song is previewed by its catalog name (its game chart's busiest 15 s, never a recording), never by its tutorial chart (tutorial-song-preview.pure.ts). Play, Get and close stop the previews before leaving. No analytics event is sent. Rules: tutorial-song-choice.pure.ts, tutorial-song-result.ts, first-song.pure.ts.

Each tutorial_song entry can also set the difficulty tag its song shows on the song's intro (and its pick reveal; the choose screen's cards no longer draw it) (a chip as wide as its word, the intro's title block just under the cover and over the rays, PO 09/11/2026) and on its tutorial result: "difficulty" takes the sheet's number (1–6) or the song list's label ("easy", "hard", any case) and replaces the catalog row's; "diff_tag": false hides the tag. Both are optional; an unreadable value is ignored, never the song. The tag is drawn bare, like the song list's. Analytics keep the catalog difficulty.

Which catalog song an entry is. The card (title, artist, cover, the preview it plays), the song it unlocks and its analytics come from the catalog row the entry names (catalogSongForEntry), in the live catalog: the bundled songs.json overridden by the newest song_catalog (Remote Config / CDN) this device has fetched — the list the Song list shows (tutorial-catalog-source.ts). A song added to the sheet and published in song_catalog after a build can therefore be a tutorial song, cover and all, without a new build. On a first install the catalog refresh runs after the first paint: a song only in song_catalog is found if the refresh lands before the run's songs are fixed (on the choose screen); otherwise that slot plays the stand-in. Every tutorial screen shows the fields copied when the run was fixed, so the choose screen, the song and its result always name the same song. A slot that plays the stand-in leaves a crash-report breadcrumb with why (empty_slot, no_catalog_row, midi_missing).

  • "song_id" (optional, read from 1.0.8): the row's id in the catalog, the song_id song events send (dance-monkey, no-batidao, fur-elise, apt, twinkle-twinkle-little-star). It is matched exactly and wins over name. An id no row has plays the stand-in rather than whatever name would find, so a typo shows on the device.
  • "name" (required): without song_id, the row whose file name, id or title it matches, ignoring case, accents, spaces and punctuation. Keep it beside song_id: builds before song_id match by name alone, and drop an entry without one.
{
  "three_songs": [
    { "name": "Fur Elise", "song_id": "fur-elise", "midi": "https://…", "difficulty": "easy", "diff_tag": true },
    { "name": "No Batidão", "song_id": "no-batidao", "midi": "https://…", "difficulty": 2 },
    { "name": "Twinkle Twinkle Little Star", "song_id": "twinkle-twinkle-little-star", "midi": "https://…", "diff_tag": false }
  ]
}

Excerpts the app ships play with no download. An entry's midi is fetched while onboarding runs, unless its file name is one the app carries under src/assets/tutorial/: then the song plays that bundled chart, and nothing is downloaded or waited for (bundledTutorialExcerpt, prepareTutorialRun). The match is the file the URL ends in, exactly (case included), wherever it is hosted: …/Q4_Folder/tutorial_1stUA_package/APT_RoseBrunoMars_tutorial.mid plays the bundled APT_RoseBrunoMars_tutorial. The app ships the excerpts of the Instant songs:

FileSong
APT_RoseBrunoMars_tutorial.midAPT.
DanceMonkey_TonesAndI_tutorial.midDance Monkey
FurElise_Beethoven_tutorial.midFür Elise
NoBatidao_ZXKAI_tutorial.mid, NoBatidao_ZXKAI_tutorial_new.midNo Batidão (two cuts)
twinkletwinklelittlestar_tutorial.midTwinkle Twinkle Little Star (also the stand-in)

The CDN keeps a copy of each, for builds that predate it and as the source of truth. A file whose notes change takes a new file name: the old name keeps playing the copy the app shipped with. Adding an excerpt to the app is committing its .mid under its CDN file name; charts:convert-tutorial turns it into a chart at build time.

Tutorial song

The tutorial song is a Game Mode session (useTutorialSongSession over useMagicGameplay) that waits on each note, drawn by Game Mode's own gameplay group (PlayScreenGameplayGroup, under GameplayThemeTierProvider): the score (hidden through the 3-2-1, shown at GO), the x2–x5 badge, the points over each lane, and the glow, smoke, stars and keyboard colours that climb with the streak. It draws Game Mode's song progress rail (PlayScreenSongProgressRail) across the top. The rail stays hidden through the 3-2-1, shows at GO, and fills with the chart's tick up to totalEndTicks, so it waits with the song (TutorialSongGameplayPhase).

Before the song starts, TutorialGameplayScreen plays the song reveal: the cover rises with a pulsing ring over the starry sky, then the title and artist fade in (no difficulty tag on a tutorial song). It is the shared SongRevealShowcase (with SongRevealCover, SongRevealMeta, song-reveal.model.ts and StarryScaffold) in src/components/, because Learn Mode plays it too — after the "Learn Mode unlocked!" popup's Claim opens Twinkle (songs.md). The tutorial's result celebration draws the same SongRevealCover.

A chosen tutorial song starts sooner than other songs (tutorial-song-start.ts): its reveal holds 0.7 s once settled instead of 2 s (holdMs, the 0.95 s motion unchanged). The song mounts under the reveal once it settles — reported by the reveal on the UI thread (onSettled), so the mount never lands on the entrance — and loads through that hold; its lane atlas and its keyboard's sheets are baked by the surface's own mount (no prewarm: the old ones held the splash and loaded the app before the FTUE). Its 3-2-1 is Game Mode's 2 s pre-roll, armed when the reveal hands over (piano.md). Learn Mode's reveal keeps the 2 s hold.

Choose → play, step by step

What happens between Play on "Pick Your First Song" and the song's first note (DEV, 25/11/2026). The rule: everything that loads, loads on the song screen's loading card — never with the choose screen still up. The choose screen only animates.

  1. Play (choose screen). The button squishes, sparkles and sounds (cta_press); 180 ms after the release the store's pick runs: fn_tutorial_get_song, the promo grant (every offered song on grant_all, else the pick), the run set to the song, the pick saved for a relaunch, phase revealing. The previews stop; the claim clock starts at PICK_FROM_MS (430 ms) and the picked cover is measured (measureInWindow) for the light layers and the move to the middle.
  2. The pick on the choose screen (TutorialPickerStage, every part mounted with the screen): the Play button leaves, the other cards and the title fade, the picked card moves to the middle at its own size; the halo comes — the rays (ftue_halo_rays) turning, spreading and breathing, the rim (ftue_halo_rim) and one pulse. No difficulty tag on the run's first song. Nothing loads meanwhile.
  3. 2.72 s after the pick — the launch cue (ftue_scene_transition): the card's name fades, the card zooms from 1× into the light wipe (TutorialTransitionWipe) as it fades with its light.
  4. 3.14 s after the pick — the hand-over, the wipe at its peak: pickCue → revealDone → phase leaving → router.replace("/(tutorial)/play?revealed=1"). The song screen opens with the same light at its peak over its loading card (LightWipeClear, over everything), clearing in 480 ms as the picker's own wipe clears under the route's fade.
  5. Route fade under the clearing light (the tutorial stack's own fade, react-native-screens' iOS default 500 ms). The song screen's first frame is light on purpose: only the song's loading card (TutorialLoadingCover: the card's own face, the prepare art and the piano-keys loader) — no reveal, no song yet. The choose screen is unmounted once the fade is over.
  6. Song mount once the route has arrived (transitionEnd, useScreenEntered, backstop ≤ 1 s): the chart, runner and sampler load, and the lane and keyboard mount at once (surfaceArmed), all under the song's own loading card — identical to the cover, which goes in the same commit.
  7. Song ready (prepareReady): the loading card cross-fades to Get ready! → 3-2-1 (2 s) → the song.

The reward picker does the same with the full song (/(app)/play), at its own hand-over: gameplay's loading card comes up at once under the wipe's peak, the light clears over it in 480 ms, and the song loads there. The app is entered only once that light is clear (showPlayLaunchCoverUnderWipe runs the commit when the cover's wipeClearing drops, markPlayLaunchWipeCleared; 500 ms past the light's length at the latest, PLAY_LAUNCH_WIPE_GRACE_MS): the commit takes the tutorial group down and mounts the app and the play screen, whose chart, sampler and WebGPU engine then load, and run as the light started it would share its frames (DEV, 02/12/2026; the WebGPU build alone was held before, 01/12/2026 — useSpriteEngineLease, shouldMountPlayGameplay's launchLightClear still do). The load starts about half a second later for it. Its freeze now lands on the still loading card, as the tutorial song's does. The engine is not kept from the tutorial song (keeping it crashed before).

To measure a hop on a device, build with EXPO_PUBLIC_HITCH_TRACE=1: the song screen marks route_entered, song_mount, gameplay_ready and prepare_ready (Component Labs → Hitch traces).

Guided first song

The run's first song, the first time it is played (step.index === 0 in TutorialGameplayScreen), teaches the tap and the hold on two of its own notes (tutorial-song-guide.pure.ts, wired in useTutorialSongSession). Every later song plays as Game Mode.

tutorial_start (step: step_tap | step_hold) reports each lesson once the player has done it: when the first tap note is played and when the first hold's head is played (it need not be held to its tail, PO 23/10/2026). It also carries show: "TRUE" when the song stopped on that lesson's note and showed its guide (the spotlight and the hand) because the player had not pressed it in time, "FALSE" when the player pressed it in time and saw no guide (PO sheet, 04/12/2026; tutorial-start-event.pure.ts).

  • The first tap note. The song's first note that is not a hold, as the engine reads a hold (its tempo included: a short long note on a fast song is a tap). Either guided note may come first: No Batidão opens on three holds and taps after them, Fur Elise taps first and holds last. Twinkle has holds only, so only its first hold is guided.
    • While it is the note to play, a press on its key (inside the note tolerance) that is not Perfect is ignored. It pops the label it earned, as Game Mode would (GOOD or EARLY — EARLY also for a press before the Early window while the note is on screen; before it shows, the key just sounds), and it sounds, but it scores nothing (no points over the lane) and the note goes on falling.
    • The song waits for the note on the line, as Game Mode waits on every note (auto-pause). The moment it does, the guide's spotlight (TutorialPracticeSpotlightOverlay) comes in, dimming everything but the key's column, with "Tap the key when the note reaches the line" (TutorialSongGuideCopy, 50 pt above halfway down to the hit line). It comes in over 588 ms (TUTORIAL_SONG_GUIDE_SPOTLIGHT_ENTER_MS), and from the same frame the hand (TutorialHandGuide) shows the tap gesture on its key. Playing the key clears all three. Every guided wait below brings them in the same way. All three are mounted once by TutorialSongGuideLayer and shown on the UI thread from guideWaitKindSv (opacity + translate), so a wait starting or ending commits nothing to React. The layer is a forwardRef host isolated from the gameplay tree (a sibling of PlayScreenGameplayGroup, outside GameplayThemeTierProvider): it takes stable props (waits, guideWaitKindSv, one memoized guideGeometry), builds its Skia layers on an idle JS slot after the surface may mount (useIdleMount, off the lane's first-mount commit), and the session flips its prewarm through the ref handle (guideRef.current?.setPrewarm) — no prop flip. TutorialGameplayScreen re-renders for its own state (the song mounting under the reveal, the hand-over, the reveal's fade), so SongRevealShowcase and TutorialSongSurface are memo, and the hand-over reaches the song as countdownArmedSv (a SharedValue via useBooleanSharedValue), not a prop: only surfaceArmed (the reveal gone) re-renders the song shell. What remains in the Profiler during the reveal and the guide's waits are Reanimated's settledStyle renders (FORCE_REACT_RENDER_FOR_SETTLED_ANIMATIONS, left on by design — see piano.md). Under the Get ready! card their Skia layers draw at TUTORIAL_SONG_GUIDE_PREWARM_OPACITY to warm the GPU pipelines.
    • A press there scores Perfect however long the wait. Game Mode turns such a press Late after 0.5 s and Miss after 1.2 s (fixed, not BPM-scaled); the guide lifts both limits through useMagicJudgement's getAutoPausePerfectGraceMs (returning undefined once nothing is guided, so Game Mode's default grace applies).
    • A Perfect press while the note is still falling plays on.
  • The first hold.
    • Its press is guarded as the first tap note's is (PO, 24/10/2026): a press on its key before the line that is not Perfect pops the label it earned and sounds, but scores nothing, and the hold goes on falling to the line. A key held down through such a press does not start the hold on arrival; the player presses again.
    • Waiting on the line for its press, it gets the spotlight with its hold line, "Hold the key when the long note reaches the line", and the hand (the long press), and its press scores Perfect however long the wait.
    • From the press on it plays as Game Mode (PO, 23/10/2026: a hold scores like a tap, and its haptic already tells it from one). Let go early, it keeps its head's points without the completion bonus and the song goes on; held to its tail, it gets the bonus.

Debugging

Profile screen exposes a "Reset onboarding flow" button that closes the paywall, resets onboarding and tutorial state, then signs out — re-running the full onboarding → tutorial sequence.


Source: docs/features/onboarding.md