musicxml-io 0.1.0 → 0.2.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
@@ -1,4 +1,4 @@
1
- import { S as Score, M as Measure, f as MeasureAttributes, a as Pitch, N as NoteEntry, P as Part } from '../types-DC_TnJu_.mjs';
1
+ import { S as Score, M as Measure, f as MeasureAttributes, P as Pitch, N as NoteEntry, e as Part } from '../types-Dp9zcgIg.mjs';
2
2
 
3
3
  /**
4
4
  * Get a specific measure from the score
@@ -1,4 +1,4 @@
1
- import { S as Score, M as Measure, f as MeasureAttributes, a as Pitch, N as NoteEntry, P as Part } from '../types-DC_TnJu_.js';
1
+ import { S as Score, M as Measure, f as MeasureAttributes, P as Pitch, N as NoteEntry, e as Part } from '../types-Dp9zcgIg.js';
2
2
 
3
3
  /**
4
4
  * Get a specific measure from the score
@@ -269,4 +269,3 @@ function pitchesEqual(a, b) {
269
269
  measureRoundtrip,
270
270
  scoresEqual
271
271
  });
272
- //# sourceMappingURL=index.js.map
@@ -229,4 +229,3 @@ export {
229
229
  measureRoundtrip,
230
230
  scoresEqual
231
231
  };
232
- //# sourceMappingURL=index.mjs.map
@@ -215,6 +215,7 @@ interface MeasureAttributes {
215
215
  keys?: KeySignature[];
216
216
  clef?: Clef[];
217
217
  staves?: number;
218
+ instruments?: number;
218
219
  transpose?: Transpose;
219
220
  transposes?: Transpose[];
220
221
  staffDetails?: StaffDetails[];
@@ -265,7 +266,7 @@ interface TimeSignature {
265
266
  }
266
267
  interface KeySignature {
267
268
  fifths: number;
268
- mode?: 'major' | 'minor' | 'dorian' | 'phrygian' | 'lydian' | 'mixolydian' | 'aeolian' | 'ionian' | 'locrian';
269
+ mode?: 'major' | 'minor' | 'dorian' | 'phrygian' | 'lydian' | 'mixolydian' | 'aeolian' | 'ionian' | 'locrian' | 'none';
269
270
  cancel?: number;
270
271
  cancelLocation?: 'left' | 'right' | 'before-barline';
271
272
  number?: number;
@@ -284,6 +285,8 @@ interface Clef {
284
285
  line: number;
285
286
  staff?: number;
286
287
  clefOctaveChange?: number;
288
+ printObject?: boolean;
289
+ afterBarline?: boolean;
287
290
  }
288
291
  interface Transpose {
289
292
  diatonic: number;
@@ -292,7 +295,7 @@ interface Transpose {
292
295
  }
293
296
  interface Barline {
294
297
  location: 'left' | 'right' | 'middle';
295
- barStyle?: 'regular' | 'dotted' | 'dashed' | 'heavy' | 'light-light' | 'light-heavy' | 'heavy-light' | 'heavy-heavy' | 'none';
298
+ barStyle?: 'regular' | 'dotted' | 'dashed' | 'heavy' | 'light-light' | 'light-heavy' | 'heavy-light' | 'heavy-heavy' | 'tick' | 'short' | 'none';
296
299
  repeat?: {
297
300
  direction: 'forward' | 'backward';
298
301
  times?: number;
@@ -372,6 +375,9 @@ interface DirectionSound {
372
375
  volume?: number;
373
376
  pan?: number;
374
377
  };
378
+ damperPedal?: 'yes' | 'no';
379
+ softPedal?: 'yes' | 'no';
380
+ sostenutoPedal?: 'yes' | 'no';
375
381
  }
376
382
  interface DirectionEntry {
377
383
  type: 'direction';
@@ -403,6 +409,9 @@ interface SoundEntry {
403
409
  fine?: boolean;
404
410
  forwardRepeat?: boolean;
405
411
  swing?: Swing;
412
+ damperPedal?: boolean | 'yes' | 'no';
413
+ softPedal?: boolean | 'yes' | 'no';
414
+ sostenutoPedal?: boolean | 'yes' | 'no';
406
415
  }
407
416
  interface HarmonyEntry {
408
417
  type: 'harmony';
@@ -561,6 +570,7 @@ interface SlurNotation extends BaseNotation {
561
570
  slurType: 'start' | 'stop' | 'continue';
562
571
  number?: number;
563
572
  lineType?: 'solid' | 'dashed' | 'dotted' | 'wavy';
573
+ orientation?: 'over' | 'under';
564
574
  defaultX?: number;
565
575
  defaultY?: number;
566
576
  bezierX?: number;
@@ -696,6 +706,8 @@ type DirectionType = {
696
706
  number?: number;
697
707
  lineEnd?: 'up' | 'down' | 'both' | 'arrow' | 'none';
698
708
  lineType?: 'solid' | 'dashed' | 'dotted' | 'wavy';
709
+ defaultY?: number;
710
+ relativeX?: number;
699
711
  } | {
700
712
  kind: 'dashes';
701
713
  type: 'start' | 'stop' | 'continue';
@@ -793,5 +805,288 @@ interface NoteIteratorItem {
793
805
  note: NoteEntry;
794
806
  position: number;
795
807
  }
808
+ /**
809
+ * Voice to Staff mapping for inferring staff when not explicitly specified
810
+ */
811
+ interface VoiceToStaffMap {
812
+ get(voice: number): number | undefined;
813
+ has(voice: number): boolean;
814
+ entries(): IterableIterator<[number, number]>;
815
+ size: number;
816
+ }
817
+ /**
818
+ * Note with full context information
819
+ */
820
+ interface NoteWithContext {
821
+ note: NoteEntry;
822
+ part: Part;
823
+ partIndex: number;
824
+ measure: Measure;
825
+ measureIndex: number;
826
+ position: number;
827
+ }
828
+ /**
829
+ * Entry with context (for iterateEntries)
830
+ */
831
+ interface EntryWithContext {
832
+ entry: MeasureEntry;
833
+ part: Part;
834
+ partIndex: number;
835
+ measure: Measure;
836
+ measureIndex: number;
837
+ position: number;
838
+ }
839
+ /**
840
+ * Direction with context information
841
+ */
842
+ interface DirectionWithContext {
843
+ direction: DirectionEntry;
844
+ part: Part;
845
+ partIndex: number;
846
+ measure: Measure;
847
+ measureIndex: number;
848
+ position: number;
849
+ }
850
+ /**
851
+ * Staff range (min and max staff numbers)
852
+ */
853
+ interface StaffRange {
854
+ min: number;
855
+ max: number;
856
+ }
857
+ /**
858
+ * Options for position-based queries
859
+ */
860
+ interface PositionQueryOptions {
861
+ staff?: number;
862
+ voice?: number;
863
+ includeChordNotes?: boolean;
864
+ }
865
+ /**
866
+ * Vertical slice - all notes at a specific position across all parts
867
+ */
868
+ interface VerticalSlice {
869
+ measureIndex: number;
870
+ position: number;
871
+ parts: Map<number, NoteEntry[]>;
872
+ }
873
+ /**
874
+ * Voice line - continuous melodic line across measures
875
+ */
876
+ interface VoiceLine {
877
+ partIndex: number;
878
+ voice: number;
879
+ staff?: number;
880
+ notes: NoteWithContext[];
881
+ }
882
+ /**
883
+ * Adjacent notes (previous and next)
884
+ */
885
+ interface AdjacentNotes {
886
+ prev: NoteWithContext | null;
887
+ next: NoteWithContext | null;
888
+ }
889
+ /**
890
+ * Direction kind type for filtering
891
+ */
892
+ type DirectionKind = DirectionType['kind'];
893
+ /**
894
+ * Dynamic marking with context
895
+ */
896
+ interface DynamicWithContext {
897
+ dynamic: DynamicsValue;
898
+ direction: DirectionEntry;
899
+ part: Part;
900
+ partIndex: number;
901
+ measure: Measure;
902
+ measureIndex: number;
903
+ position: number;
904
+ }
905
+ /**
906
+ * Tempo marking with context
907
+ */
908
+ interface TempoWithContext {
909
+ beatUnit: NoteType;
910
+ perMinute?: number | string;
911
+ beatUnitDot?: boolean;
912
+ direction: DirectionEntry;
913
+ partIndex: number;
914
+ measureIndex: number;
915
+ position: number;
916
+ }
917
+ /**
918
+ * Pedal marking with context
919
+ */
920
+ interface PedalWithContext {
921
+ pedalType: 'start' | 'stop' | 'change' | 'continue';
922
+ direction: DirectionEntry;
923
+ partIndex: number;
924
+ measureIndex: number;
925
+ position: number;
926
+ }
927
+ /**
928
+ * Wedge (crescendo/diminuendo) with context
929
+ */
930
+ interface WedgeWithContext {
931
+ wedgeType: 'crescendo' | 'diminuendo' | 'stop';
932
+ direction: DirectionEntry;
933
+ partIndex: number;
934
+ measureIndex: number;
935
+ position: number;
936
+ }
937
+ /**
938
+ * Octave shift with context
939
+ */
940
+ interface OctaveShiftWithContext {
941
+ shiftType: 'up' | 'down' | 'stop';
942
+ size?: number;
943
+ direction: DirectionEntry;
944
+ partIndex: number;
945
+ measureIndex: number;
946
+ position: number;
947
+ }
948
+ /**
949
+ * A group of tied notes (notes connected by ties)
950
+ */
951
+ interface TiedNoteGroup {
952
+ notes: NoteWithContext[];
953
+ /** Total duration of all tied notes */
954
+ totalDuration: number;
955
+ }
956
+ /**
957
+ * A slur span from start to stop
958
+ */
959
+ interface SlurSpan {
960
+ number: number;
961
+ startNote: NoteWithContext;
962
+ endNote: NoteWithContext;
963
+ /** Notes covered by the slur (including start and end) */
964
+ notes: NoteWithContext[];
965
+ }
966
+ /**
967
+ * A tuplet group
968
+ */
969
+ interface TupletGroup {
970
+ number: number;
971
+ notes: NoteWithContext[];
972
+ /** Actual notes (numerator of time modification) */
973
+ actualNotes: number;
974
+ /** Normal notes (denominator of time modification) */
975
+ normalNotes: number;
976
+ }
977
+ /**
978
+ * A beam group (notes connected by beams)
979
+ */
980
+ interface BeamGroup {
981
+ notes: NoteWithContext[];
982
+ /** Beam level (1 for eighth notes, 2 for sixteenth, etc.) */
983
+ beamLevel: number;
984
+ }
985
+ /**
986
+ * Filter for finding notes with specific notations
987
+ */
988
+ type NotationType = Notation['type'];
989
+ /**
990
+ * Harmony entry with context
991
+ */
992
+ interface HarmonyWithContext {
993
+ harmony: HarmonyEntry;
994
+ part: Part;
995
+ partIndex: number;
996
+ measure: Measure;
997
+ measureIndex: number;
998
+ position: number;
999
+ }
1000
+ /**
1001
+ * Lyric entry with context
1002
+ */
1003
+ interface LyricWithContext {
1004
+ lyric: Lyric;
1005
+ note: NoteEntry;
1006
+ part: Part;
1007
+ partIndex: number;
1008
+ measure: Measure;
1009
+ measureIndex: number;
1010
+ position: number;
1011
+ verse: number;
1012
+ }
1013
+ /**
1014
+ * Assembled lyrics for a verse
1015
+ */
1016
+ interface AssembledLyrics {
1017
+ verse: number;
1018
+ text: string;
1019
+ syllables: {
1020
+ text: string;
1021
+ position: number;
1022
+ measureIndex: number;
1023
+ }[];
1024
+ }
1025
+ /**
1026
+ * Barline information with context
1027
+ */
1028
+ interface BarlineWithContext {
1029
+ barline: Barline;
1030
+ partIndex: number;
1031
+ measureIndex: number;
1032
+ measureNumber: string;
1033
+ }
1034
+ /**
1035
+ * Repeat structure information
1036
+ */
1037
+ interface RepeatInfo {
1038
+ type: 'forward' | 'backward';
1039
+ times?: number;
1040
+ measureIndex: number;
1041
+ measureNumber: string;
1042
+ }
1043
+ /**
1044
+ * Ending (volta bracket) information
1045
+ */
1046
+ interface EndingInfo {
1047
+ number: string;
1048
+ type: 'start' | 'stop' | 'discontinue';
1049
+ partIndex: number;
1050
+ measureIndex: number;
1051
+ measureNumber: string;
1052
+ }
1053
+ /**
1054
+ * Key change information
1055
+ */
1056
+ interface KeyChangeInfo {
1057
+ key: KeySignature;
1058
+ partIndex: number;
1059
+ measureIndex: number;
1060
+ measureNumber: string;
1061
+ position: number;
1062
+ }
1063
+ /**
1064
+ * Time signature change information
1065
+ */
1066
+ interface TimeChangeInfo {
1067
+ time: TimeSignature;
1068
+ partIndex: number;
1069
+ measureIndex: number;
1070
+ measureNumber: string;
1071
+ }
1072
+ /**
1073
+ * Clef change information
1074
+ */
1075
+ interface ClefChangeInfo {
1076
+ clef: Clef;
1077
+ staff: number;
1078
+ partIndex: number;
1079
+ measureIndex: number;
1080
+ measureNumber: string;
1081
+ position: number;
1082
+ }
1083
+ /**
1084
+ * All structural changes combined
1085
+ */
1086
+ interface StructuralChanges {
1087
+ keyChanges: KeyChangeInfo[];
1088
+ timeChanges: TimeChangeInfo[];
1089
+ clefChanges: ClefChangeInfo[];
1090
+ }
796
1091
 
797
- export type { Accidental as A, BackupEntry as B, Clef as C, DirectionEntry as D, ForwardEntry as F, KeySignature as K, Lyric as L, Measure as M, NoteEntry as N, Part as P, Score as S, TimeSignature as T, VoiceGroup as V, Pitch as a, ScoreMetadata as b, PartInfo as c, PartGroup as d, PartListEntry as e, MeasureAttributes as f, MeasureEntry as g, NoteType as h, AccidentalInfo as i, TieInfo as j, BeamInfo as k, Notation as l, DirectionType as m, DynamicsValue as n, Transpose as o, Barline as p, StaffGroup as q, NoteWithPosition as r, Chord as s, NoteIteratorItem as t, Print as u, Defaults as v, Credit as w };
1092
+ export type { TupletGroup as $, Accidental as A, BackupEntry as B, Clef as C, DirectionEntry as D, EntryWithContext as E, ForwardEntry as F, StaffRange as G, PositionQueryOptions as H, VerticalSlice as I, VoiceLine as J, KeySignature as K, Lyric as L, Measure as M, NoteEntry as N, AdjacentNotes as O, Pitch as P, DirectionKind as Q, DynamicWithContext as R, Score as S, TieInfo as T, TempoWithContext as U, VoiceGroup as V, PedalWithContext as W, WedgeWithContext as X, OctaveShiftWithContext as Y, TiedNoteGroup as Z, SlurSpan as _, ScoreMetadata as a, BeamGroup as a0, NotationType as a1, HarmonyWithContext as a2, LyricWithContext as a3, AssembledLyrics as a4, BarlineWithContext as a5, RepeatInfo as a6, EndingInfo as a7, KeyChangeInfo as a8, TimeChangeInfo as a9, ClefChangeInfo as aa, StructuralChanges as ab, HarmonyEntry as ac, PartInfo as b, PartGroup as c, PartListEntry as d, Part as e, MeasureAttributes as f, MeasureEntry as g, NoteType as h, AccidentalInfo as i, BeamInfo as j, Notation as k, DirectionType as l, DynamicsValue as m, TimeSignature as n, Transpose as o, Barline as p, StaffGroup as q, NoteWithPosition as r, Chord as s, NoteIteratorItem as t, Print as u, Defaults as v, Credit as w, VoiceToStaffMap as x, NoteWithContext as y, DirectionWithContext as z };