prometeu-runtime/docs/runtime/learn/mental-model-audio.md

1.6 KiB

Audio Mental Model

Status: pedagogical Companion spec: ../specs/05-audio-peripheral.md

The right mental model for audio in PROMETEU is an active peripheral with a budget, not "automatic sound".

Philosophy

Sound:

  • consumes time;
  • consumes memory;
  • uses finite channels;
  • depends on explicit commands.

That brings PROMETEU closer to classic consoles and arcades where the game "talks" to an audio block with its own rules.

Audio CPU Metaphor

A useful metaphor is:

[Game CPU] -> sends commands at 60 Hz -> [AUDIO Peripheral]
                                         |
                                         v
                                   Voices + Mixer
                                         |
                                         v
                                     PCM Output

This metaphor does not require a dedicated thread. It only separates responsibilities:

  • the machine defines the logical model;
  • the host decides how to deliver continuous buffers;
  • the game speaks in commands, not direct backend manipulation.

Good Habits

  • reuse samples;
  • limit simultaneous voices;
  • treat sound as an intentional event;
  • separate music and effects;
  • avoid triggering the same sound every frame.

Historical Direction

The main influences here are:

  • NES, for the clarity of limited channels;
  • SNES, for sample playback and mixing;
  • CPS-2 and Neo Geo, for the feeling of headroom and sample presence.

PROMETEU abstracts those references. It does not try to reproduce any of those systems literally.