@jeffy-g/live-midi-types
Version:
Common TypeScript types for Ableton Live MIDI clip and event data.
62 lines (61 loc) • 1.43 kB
TypeScript
/*!
// - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
// Copyright (C) 2025 jeffy-g <hirotom1107@gmail.com>
// Released under the MIT license
// https://opensource.org/licenses/mit-license.php
// - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
*/
/**
* @file src/project.ts
*/
import type { TempoEvent } from "./midi-event.ts";
export type TClipSummary<T extends Record<string, any>> = {
/**
* ID assigned for use in UI etc.
*
* ```
* "clip-" + crypto.randomUUID()
* ```
*/
id: string;
color: string;
/**
* Disabled property for the clip.
*/
disabled: boolean;
clipName: string;
trackName: string;
annotations?: string;
} & T;
export type TTrackInfo<T extends Record<string, any>> = {
id: string;
name: string;
color: string;
annotations?: string;
/**
* ```
* Record<"clipName", TMidiClipSummary>
* ```
*/
clips: Record<string, TClipSummary<T>>;
};
export type TParsedAbletonLiveSet<T extends Record<string, any>> = {
/**
* Ableton Live project name
* Usually the als file name without the extension.
*/
alsName: string;
/**
* ppq (ticks per quarter note)
*/
ticksPerQuarter: number;
/**
* Tracks in the project.
* NOTE: currently, this is a Midi tracks only.
*/
tracks: TTrackInfo<T>[];
/**
* Tempo automation events.
*/
tempoAutomation?: TempoEvent[];
};