@onjmin/dtm 1.0.4 → 1.0.5

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.js CHANGED
@@ -8891,14 +8891,20 @@ var mountMmlPlayer = (target, mml, options = {}) => {
8891
8891
  }
8892
8892
  const seqTracks = trackIndices.map((index) => {
8893
8893
  let id = 0;
8894
- const notes = placements.filter((p) => p.trackIndex === index).map((p) => ({
8894
+ const trackPlacements = placements.filter((p) => p.trackIndex === index);
8895
+ const headerVelocity = trackPlacements[0]?.velocity ?? DEFAULT_VELOCITY;
8896
+ const notes = trackPlacements.map((p) => ({
8895
8897
  id: id++,
8896
8898
  startStep: p.startStep,
8897
8899
  durationSteps: p.durationSteps,
8898
8900
  pitch: p.pitch,
8899
- velocity: p.velocity
8901
+ velocity: DEFAULT_VELOCITY
8900
8902
  }));
8901
- return { id: String(index), volume: trackVolume, notes };
8903
+ return {
8904
+ id: String(index),
8905
+ volume: trackVolume * headerVelocity / DEFAULT_VELOCITY,
8906
+ notes
8907
+ };
8902
8908
  });
8903
8909
  const colorOf = (index) => colors[index % colors.length] ?? DEFAULT_TRACK_COLORS[0];
8904
8910
  let audioCtx = null;
package/dist/index.mjs CHANGED
@@ -8758,14 +8758,20 @@ var mountMmlPlayer = (target, mml, options = {}) => {
8758
8758
  }
8759
8759
  const seqTracks = trackIndices.map((index) => {
8760
8760
  let id = 0;
8761
- const notes = placements.filter((p) => p.trackIndex === index).map((p) => ({
8761
+ const trackPlacements = placements.filter((p) => p.trackIndex === index);
8762
+ const headerVelocity = trackPlacements[0]?.velocity ?? DEFAULT_VELOCITY;
8763
+ const notes = trackPlacements.map((p) => ({
8762
8764
  id: id++,
8763
8765
  startStep: p.startStep,
8764
8766
  durationSteps: p.durationSteps,
8765
8767
  pitch: p.pitch,
8766
- velocity: p.velocity
8768
+ velocity: DEFAULT_VELOCITY
8767
8769
  }));
8768
- return { id: String(index), volume: trackVolume, notes };
8770
+ return {
8771
+ id: String(index),
8772
+ volume: trackVolume * headerVelocity / DEFAULT_VELOCITY,
8773
+ notes
8774
+ };
8769
8775
  });
8770
8776
  const colorOf = (index) => colors[index % colors.length] ?? DEFAULT_TRACK_COLORS[0];
8771
8777
  let audioCtx = null;
package/package.json CHANGED
@@ -2,7 +2,7 @@
2
2
  "author": "onjmin",
3
3
  "license": "MIT",
4
4
  "name": "@onjmin/dtm",
5
- "version": "1.0.4",
5
+ "version": "1.0.5",
6
6
  "description": "MMLを中間言語に用いた、モバイルファーストなDAW / ピアノロール打ち込みコンポーネント",
7
7
  "homepage": "https://onjmin.github.io/dtm",
8
8
  "repository": {