@waveform-playlist/engine 14.0.0-next.7 → 14.0.0-next.8

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.
package/dist/index.d.mts CHANGED
@@ -49,6 +49,13 @@ declare function calculateSplitPoint(splitSample: number, samplesPerPixel: numbe
49
49
  *
50
50
  * The left clip retains the original fadeIn; the right clip retains the original fadeOut.
51
51
  * Both clips share the same waveformData reference and the same `src`.
52
+ * A MIDI clip's halves both keep its whole `midiNotes` list (the same array),
53
+ * `midiChannel` and `midiProgram` (#838): like an audio clip's buffer, the notes
54
+ * are the source and each half is a window on them (`offsetSamples` and
55
+ * `durationSamples`), the notes the Tone MIDI tracks play and the piano roll
56
+ * draws. A note that crosses the split is released by the left half at the
57
+ * split (a SoundFont sample that does not loop rings on) and struck again
58
+ * there by the right half.
52
59
  * The left clip keeps the original's `id`; the right clip gets a new one.
53
60
  * If the clip has a name, suffixes " (1)" and " (2)" are appended.
54
61
  *
package/dist/index.d.ts CHANGED
@@ -49,6 +49,13 @@ declare function calculateSplitPoint(splitSample: number, samplesPerPixel: numbe
49
49
  *
50
50
  * The left clip retains the original fadeIn; the right clip retains the original fadeOut.
51
51
  * Both clips share the same waveformData reference and the same `src`.
52
+ * A MIDI clip's halves both keep its whole `midiNotes` list (the same array),
53
+ * `midiChannel` and `midiProgram` (#838): like an audio clip's buffer, the notes
54
+ * are the source and each half is a window on them (`offsetSamples` and
55
+ * `durationSamples`), the notes the Tone MIDI tracks play and the piano roll
56
+ * draws. A note that crosses the split is released by the left half at the
57
+ * split (a SoundFont sample that does not loop rings on) and struck again
58
+ * there by the right half.
52
59
  * The left clip keeps the original's `id`; the right clip gets a new one.
53
60
  * If the clip has a name, suffixes " (1)" and " (2)" are appended.
54
61
  *
package/dist/index.js CHANGED
@@ -86,6 +86,11 @@ function calculateSplitPoint(splitSample, samplesPerPixel) {
86
86
  function splitClip(clip, splitSample) {
87
87
  const leftDuration = splitSample - clip.startSample;
88
88
  const rightDuration = clip.durationSamples - leftDuration;
89
+ const midi = {
90
+ midiNotes: clip.midiNotes,
91
+ midiChannel: clip.midiChannel,
92
+ midiProgram: clip.midiProgram
93
+ };
89
94
  const leftName = clip.name ? `${clip.name} (1)` : void 0;
90
95
  const rightName = clip.name ? `${clip.name} (2)` : void 0;
91
96
  const left = {
@@ -101,7 +106,8 @@ function splitClip(clip, splitSample) {
101
106
  fadeIn: clip.fadeIn,
102
107
  audioBuffer: clip.audioBuffer,
103
108
  waveformData: clip.waveformData,
104
- src: clip.src
109
+ src: clip.src,
110
+ ...midi
105
111
  }),
106
112
  id: clip.id
107
113
  };
@@ -117,7 +123,8 @@ function splitClip(clip, splitSample) {
117
123
  fadeOut: clip.fadeOut,
118
124
  audioBuffer: clip.audioBuffer,
119
125
  waveformData: clip.waveformData,
120
- src: clip.src
126
+ src: clip.src,
127
+ ...midi
121
128
  });
122
129
  return { left, right };
123
130
  }