Component/Sound

From Turing Complete
Revision as of 12:37, 4 August 2025 by Gelthor (talk | contribs) (Describe inputs)
(diff) ← Older revision | Latest revision (diff) | Newer revision → (diff)
Sound
Type io
Unlocked by Lab
stub
stub

This page is a stub. Help us expand it, and you get a cookie.

Inputs[edit | edit source]

Command type Action
0 No request Do nothing. Allow any currently playing note to continue.
1 Play Start playing a note.
2 Reset and Play Stop the current note and start a new one.
3 Stop Stop the currently playing note.

Note> specifies which note to play: The defaut sound samples are described here. There are 5 instruments each with a different timbre and range of 24 notes each a semitone apart. Each can be overriden with a custom sample

Note values Instrument Range
0-23 0 C4 to B5
24-47 1 C4 to B5
48-71 2 C4 to B5
72-95 3 C3 to B4
96-119 4 Pitch unclear

Pitch is a signed 8-bit integer that scales the frequency of the note.

f -> f * (pitch + 129) / 129

A pitch value of 8 will raise a note by about a semitone.