Zongzi. Score. Key behaviour
(zongzi v0.3.0)
Copy Markdown
Domain model for pitch.
Uses an adapter pattern to support different tuning systems.
Handles conversion between two representations:
- Staff notation data
- MIDI / frequency data
Key values are stored and serialized in their internal type.
Summary
Types
@type key_struct() :: struct()
@type t() :: key_struct()
Callbacks
@callback from_midi(midi_note :: number(), ctx :: term()) :: {:ok, key_struct()} | {:error, term()}
@callback from_score(score_data :: term(), type :: atom(), ctx :: term()) :: {:ok, key_struct()} | {:error, term()}
@callback new(any()) :: {:ok, key_struct()} | {:error, term()}