Skip to content

Unify/simplify PCM playback #985

Description

@dpwe

Currently, there are 3 kinds of PCM presets source:

  • "In-ROM" presets, compiled in under one of several pcm_map_t arrays including pcm_map from pcm_tiny.h and gamma9001_map from pcm_gamm9001.h.
  • "In-memory" (RAM) presets, loaded from file into memory at run-time with pcm_load (or amy.send(load_sample='...'))
  • "From-file" presets, which allow for longer samples to pulled directly from a filesystem during playback, to avoid the RAM footprint. This is presumably slower (so limits what else AMY can do?), and does not allow looping (seeking back in the file).

The code in pcm.c includes a lot of code branches and special-cases for each of these types, as well as for the segmented ROM preset numbers covering the pcm_map and gamma9001_map dichotomy.

I would like to simplify this code, so that as far as possible all PCM playback uses a single code path. ROM versus RAM should be just a matter of handles of a single type located in static memory or RAM, and playback-from-file will simulate the same thing with a small buffer that is periodically updated.

Activity

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions