Skip to content

Memory Game

The wall tells a short story — animals trying to reach the river while avoiding the lions. Each animal the story mentions is a hold that lights up with that animal’s sound. Then the lights go out and the child climbs the route from memory: a right hold glows green and plays its animal, a wrong one glows yellow and a lion growls. Reaching the river — the top row — wins.

The story is content, so the engine names every sound: narration lines go through /sample/play and are sequenced with /sample/ended, and each message below carries the sample key of the sound it should make. SuperCollider adds what content cannot: it pans each sound to its hold, ducks the jungle under the narration, and makes a growl land harder when the child is near the top.

Mode id: memory · Status: draft · Since: 0.2.0 · Spec: Prototype Use Cases, pp. 9–10

Load this mode with /mode/load and type tags ssi:

NetAddr("127.0.0.1", 57120).sendMsg('/mode/load', "memory", "savanna", 4);

Sent in this exact order, immediately after the mode id.

#NameTypeRange / defaultDescription
1storyIdsThe story being told, e.g. “savanna”. Used for logs and to choose the ambience processing; the sounds themselves arrive as sample keys.
2routeLengthi2 – 12
default 4
Holds in the route to remember — the difficulty setting.

Settings from the use case that never cross the wire. The engine applies them; SuperCollider does not need them, so they are not in the protocol.

Setting
Story scriptWhich narration line plays when, and which hold each story element becomes. The engine sequences it using /sample/ended.
Default wall glowLow, pulsing green chaser on every hold; pulsing blue on the top-row river.
Hold coloursBright green for revealed and correct holds, yellow for mistakes.

/mode/memory/phase

engine → sc state since 0.2.0

Which stage of the game the wall is in.

s phase
s
phase s string "story" | "recall" | "complete"
story — narration and reveals. recall — lights out, the child climbs from memory. complete — the river was reached.
packet /mode/memory/phase recall
SuperCollider NetAddr("127.0.0.1", 57120).sendMsg('/mode/memory/phase', "recall");
engine (C#) osc.Send(Osc.ModeMemoryPhase, "recall");

SuperCollider changes the mix with the phase: during recall the ambience thins out so each animal sound is easy to hear.

/mode/memory/reveal

engine → sc event since 0.2.0

The story mentions an element; its hold lights up.

i stepIndex
i holdId
s key
iis
stepIndex i int32 0 – 11
Position of this element in the route, zero-based.
holdId i int32 hold index · 0 – holdCount−1
The hold that represents it.
key s string
Sample key of the element's sound, e.g. "savanna/giraffe".
packet /mode/memory/reveal 0 45 savanna/giraffe
SuperCollider NetAddr("127.0.0.1", 57120).sendMsg('/mode/memory/reveal', 0, 45, "savanna/giraffe");
engine (C#) osc.Send(Osc.ModeMemoryReveal, 0, 45, "savanna/giraffe");

/mode/memory/correct

engine → sc event since 0.2.0

The child pressed a hold that is part of the route.

i stepIndex
i holdId
s key
iis
stepIndex i int32 0 – 11
Which element of the route it was.
holdId i int32 hold index · 0 – holdCount−1
The hold pressed.
key s string
Sample key of that element's sound.
packet /mode/memory/correct 0 45 savanna/giraffe
SuperCollider NetAddr("127.0.0.1", 57120).sendMsg('/mode/memory/correct', 0, 45, "savanna/giraffe");
engine (C#) osc.Send(Osc.ModeMemoryCorrect, 0, 45, "savanna/giraffe");

/mode/memory/mistake

engine → sc event since 0.2.0

The child pressed a hold that is not part of the route.

i holdId
s key
is
holdId i int32 hold index · 0 – holdCount−1
The hold pressed.
key s string
Sample key of the warning sound, e.g. "savanna/lion".
packet /mode/memory/mistake 71 savanna/lion
SuperCollider NetAddr("127.0.0.1", 57120).sendMsg('/mode/memory/mistake', 71, "savanna/lion");
engine (C#) osc.Send(Osc.ModeMemoryMistake, 71, "savanna/lion");

A warning, not a punishment — the game carries on. Pressing the same wrong hold again within a second or so should not growl twice; the engine debounces.

/mode/memory/goal

engine → sc event since 0.2.0

The child reached the river with the route completed.

f elapsed
i mistakes
s key
fis
elapsed f float32 seconds
Time since the recall phase began.
mistakes i int32 0 – 999
Wrong holds pressed during recall.
key s string
Sample key of the "mission accomplished" track.
packet /mode/memory/goal 38.4 1 savanna/success
SuperCollider NetAddr("127.0.0.1", 57120).sendMsg('/mode/memory/goal', 38.4, 1, "savanna/success");
engine (C#) osc.Send(Osc.ModeMemoryGoal, 38.4f, 1, "savanna/success");