feat: shape MIDI note gates and create channel-aware legato phrases

This commit is contained in:
Johannes Findeisen 2026-11-06 00:18:07 +01:00
commit 5acd3b65ab
9 changed files with 63 additions and 9 deletions

View file

@ -20,12 +20,14 @@ xtc_result xtc_project_transform_clips(xtc_project *project,const uint64_t *ids,
* fields persist. No matching notes returns NOT_FOUND. Edits are atomic.
* Swing: grid 1..3840, swing 0..100 delays alternate grid points by up to half
* a grid; strength 0..100 blends toward the nearest swung point (ties later).
* Durations stay fixed. Out-of-source results reject the complete operation. */
typedef enum { XTC_MIDI_TRANSFORM_SWING } xtc_midi_transform_type;
* Swing durations stay fixed. LEGATO ends at the next strictly later onset in
* the same clip/channel (chords stay together), or source end for the last onset. Out-of-source results reject the complete operation. */
typedef enum { XTC_MIDI_TRANSFORM_SWING, XTC_MIDI_TRANSFORM_GATE, XTC_MIDI_TRANSFORM_LEGATO } xtc_midi_transform_type;
typedef struct {
xtc_midi_transform_type type;
uint64_t grid;
unsigned int swing,strength;
unsigned int gate_percent; /* GATE: 1..400, rounded length, minimum 1 tick. */
} xtc_midi_transform;
xtc_result xtc_project_transform_midi(xtc_project *project,const uint64_t *ids,size_t count,const xtc_midi_transform *edit);
/* Repeat the bounding phrase span, including gaps, 1..1024 additional copies.