Component/Sound: Difference between revisions

From Turing Complete
(Initial stub)
 
(Describe inputs)
 
Line 6: Line 6:


{{stub}}
{{stub}}
==Inputs==
{|class="wikitable"
!colspan=2| Command type
!Action
|-
| <code>0</code>
| No request || Do nothing. Allow any currently playing note to continue.
|-
| <code>1</code>
| Play
| Start playing a note.
|-
| <code>2</code>
| Reset and Play
| Stop the current note and start a new one.
|-
| <code>3</code>
| Stop
| Stop the currently playing note.
|}
<code>Note></code> 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
{|class="wikitable"
! <code>Note</code> 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
|}
<code>Pitch</code> is a signed 8-bit integer that scales the frequency of the note.
<code>f -> f * (pitch + 129) / 129 </code>
A pitch value of 8 will raise a note by about a semitone.

Latest revision as of 12:37, 4 August 2025

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.