musicxml2json-drum
Version:
MusicXML to JSON for drum.
108 lines (107 loc) • 2.48 kB
TypeScript
type ClefXML = {
sign: 'percussion' | string;
_number: string;
};
type MeasureAttributesXML = {
clef?: ClefXML;
divisions?: number;
time?: TimeSignatureXML;
};
export type MeasureXML = {
[propName: string]: any;
attributes?: MeasureAttributesXML;
note?: any;
};
export type MusicXML = {
'score-partwise'?: PartwiseXML;
};
export type NoteXML = {
[propName: string]: any;
};
type PartwiseXML = {
part?: PartXML[];
work?: {
'work-title': string;
};
};
export type PartXML = {
_id: string;
measure?: MeasureXML | MeasureXML[];
};
type TimeSignatureXML = {
beats?: number;
'beat-type': number;
};
export type Beam = 'begin' | 'continue' | 'end';
export type Dot = 'single' | 'double' | 'triple';
export type Measure = {
id: string;
isLast: boolean;
metronome: Metronome;
notes: Note[];
number: string;
partId: string;
time: Time | null;
timeSignature: TimeSignature;
};
export type Metronome = {
beatUnit: number;
bpm: number;
};
export type Notations = {
slur: Slur | null;
tied: Tied | null;
tuplet: Tuplet | null;
};
export type Note = {
beam: Beam[] | null;
data: NoteData[] | null;
dot: Dot | null;
id: string;
measureId: string;
notations: Notations;
stem: Stem | null;
time: Time | null;
timeModification: TimeModification | null;
type: NoteType;
kind: NoteKind;
};
export type NoteData = {
index: number;
code: number;
name: string;
value: number[];
};
export type NoteKind = 'note' | 'chord' | 'rest';
export type NoteType = 'whole' | 'half' | 'quarter' | 'eighth' | '16th' | '32nd' | '64th' | '128th';
export type Part = {
duration: number;
measures: Measure[];
metronome: Metronome;
sign: string;
timeSignature: TimeSignature;
};
export type Slur = 'start' | 'continue' | 'stop';
export type Stem = 'up' | 'down';
export type Tied = 'start' | 'continue' | 'stop';
export type Tuplet = 'start' | 'stop';
export type Time = {
duration: number;
end: number;
start: number;
};
export type TimeModification = {
actualNotes: number;
normalNotes: number;
};
export type TimeSignature = {
beats: number;
beatType: number;
};
export type Instruments = {
code: number;
name: string;
value: number[];
index: number;
};
export {};