Skip to content

Eliminate wire-strings for user-defined patches #533

@dpwe

Description

@dpwe

Currently, user-defined patches are stored either as wire strings (via char *memory_patch[patch_number]) or as lists of deltas (via struct delta *memory_patch_deltas[patch_number]). In patches_load_patch, the deltas list is used if present, otherwise the wire string is used.

We got here historically: First, there was only wire strings, then we added delta lists to allow patches to be defined without using wire string syntax, but we were (and still are) using wire-string definitions in a few places (like setting up default synths in api.c).

It's confusing to have these two levels. I think we can successfully remove the wire-string storage/support.

Note that the built-in patches (Juno, DX7) will continue to be defined as wire strings in patches.h. Currently, get_events_for_patch_number, which exists purely to configure the web editor parameters, works from these wire strings. I'd like to make it also work for user-defined patches, but that will need a new mechanism to reconstruct events from a list of deltas. This will be a little weird, since each delta describes a single non-default value within an amy_event structure. The constraint is that each delta specifies an osc, and a single amy_event can only have a single osc value. I think I can write a deltas_queue_to_amy_events that works well enough to support this.

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