The sound chip is how you as a troll programmer plays troll sounds.
Most sounds in the game are built-in and you have no control over the, like sound of projectile, user pressing troll buttons etc.
The sound you can control is the sound your troll makes: it hums, sighs, sings etc. There are also a few special sounds you can use.
NOTICE: Sound will be trigged once the next simulation step, so many writes during one simulation step will be collapsed into one: the last write.
NOTICE: Troll script starts executing when world appears and protagonist starts flying towards the island. This mean that if you setup your troll to play initially, it will start the sound while the camera (and microphone) is far away from the troll.
If you want something to happen when protagonist has arrived and player can interact, detect puzzle_phase = 10.
sound_pos [0 -255] - This represents the play back progress of the sound. 0 means the start of the sound, 255 the very end.The sound chip always plays back until the end (255) then stops there. When you write 0 you force the playback to start from the beginning of the sound. Write 255 to stop playback. You can also write any other value in the range 0 - 255 which will move playback to a position in the middle of the sound.
If you write 128 you will make playback from the middle of the sound. Write 200 and you will play only the last bit of the sound.
You can add triggers to when sound reaches a specific position. This allows you to chain sounds or make something else happen when sound is done.
sound_select [0 - 255] - This chose between the built-in sounds. You can change sound at any time.
sound_level [0 -255] -Controls the volume.
0 is off
128 medium strong
255 max volume.
sound_pitch [-24 - +24] -Change the pitch of the sound.The unit is semi notes (keys on a piano keyboard). This allows you to play tuned melodies by changing the pitch.
0 = normal pitch.
1 = one semi note up.
12 = one octave up
24 = two octaves up
-24 = two octaves down
The pitch is clipped to +/1 24 but to not use values outside since those may be used in the future.