xtc/include/xtc/xtc_midi_file.h

23 lines
1.2 KiB
C

#ifndef XTC_MIDI_FILE_H
#define XTC_MIDI_FILE_H
#include "xtc_midi.h"
#ifdef __cplusplus
extern "C" {
#endif
/* Control thread only. Atomic type-0 SMF, 960 PPQN, project constant tempo.
* Exports only audible source notes of a MIDI clip, relative to its start,
* retaining channels/velocities, clamping crossing notes to clip boundaries.
* Includes clip name and trailing silence. No CC/program/plugin/audio data.
* Existing destination survives validation/write failures before atomic rename. */
xtc_result xtc_project_export_midi_clip(const xtc_project *,uint64_t clip,const char *path);
/* Transactional notes-only type 0/1 PPQN import into an existing non-bus track.
* Merges file tracks, preserving channels, rounds timing to 960 PPQN and retains
* trailing silence. Keeps project tempo; ignores meta/CC/program/bend/SysEx data.
* Max 1 MiB, 64 tracks, 65536 events and 4096 notes. SMPTE/type 2 unsupported.
* Unclosed notes or malformed data reject; same-pitch overlap pairs FIFO per
* file track/channel. IDs/project/out_clip remain unchanged on every error. */
xtc_result xtc_project_import_midi(xtc_project *,uint64_t track,uint64_t start,const char *path,uint64_t *out_clip);
#ifdef __cplusplus
}
#endif
#endif