sonolus-d4dj-engine 1.4.6 → 1.5.1

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.
Binary file
Binary file
@@ -1,4 +1,4 @@
1
1
  import { LevelData } from '@sonolus/core';
2
- import { B34DJChart } from './index.cjs';
2
+ import { B34DJChart } from './index.js';
3
3
  export declare function b34djToLevelData(chart: B34DJChart, offset?: number): LevelData;
4
4
  export declare function d4djToLevelData(chart: any, offset?: number): LevelData;
@@ -1,13 +1,10 @@
1
- "use strict";
2
- Object.defineProperty(exports, "__esModule", { value: true });
3
- exports.d4djToLevelData = exports.b34djToLevelData = void 0;
4
- const index_cjs_1 = require("./index.cjs");
5
- function b34djToLevelData(chart, offset = 0) {
1
+ import { D4DJNoteType } from './index.js';
2
+ export function b34djToLevelData(chart, offset = 0) {
6
3
  let d4chart = [];
7
4
  d4chart[0] = chart.MusicName;
8
5
  d4chart[1] = [];
9
6
  d4chart[2] = chart.BarLineList;
10
- d4chart[3] = chart.NoteDataList.map((note) => [note.LaneId, index_cjs_1.D4DJNoteType[note.Type], note.Time, note.NextId, note.Direction, note.EffectType, note.EffectParameter]);
7
+ d4chart[3] = chart.NoteDataList.map((note) => [note.LaneId, D4DJNoteType[note.Type], note.Time, note.NextId, note.Direction, note.EffectType, note.EffectParameter]);
11
8
  const timescale = chart.SoflanDataList.map((soflan) => [soflan.Time, soflan.TimeScale, soflan.LeftRight]);
12
9
  timescale.forEach((ts) => {
13
10
  const i = d4chart[1].findIndex((tsc) => (tsc[0] === ts[0]) && (tsc[1] === ts[1]));
@@ -18,9 +15,8 @@ function b34djToLevelData(chart, offset = 0) {
18
15
  });
19
16
  return d4djToLevelData(d4chart, offset);
20
17
  }
21
- exports.b34djToLevelData = b34djToLevelData;
22
18
  ;
23
- function d4djToLevelData(chart, offset = 0) {
19
+ export function d4djToLevelData(chart, offset = 0) {
24
20
  let disc = {
25
21
  left: chart[1].filter((soflan) => [1, 3].includes(soflan[2])),
26
22
  right: chart[1].filter((soflan) => [2, 3].includes(soflan[2]))
@@ -308,14 +304,9 @@ function d4djToLevelData(chart, offset = 0) {
308
304
  ],
309
305
  }));
310
306
  let notes = note(chart);
311
- const sd = Array.from({ length: (Math.max(chart[3][chart[3].length - 1][2], chart[2][chart[2].length - 1]) + offset + 5) * 120 / 16 }, (_, index) => ({
312
- archetype: 'SliderData',
313
- data: [],
314
- }));
315
- data.entities.push(...ts, ...discL, ...discR, ...notes, ...bl, ...sd);
307
+ data.entities.push(...ts, ...discL, ...discR, ...notes, ...bl);
316
308
  return data;
317
309
  }
318
- exports.d4djToLevelData = d4djToLevelData;
319
310
  function note(chart) {
320
311
  let hold = [];
321
312
  let slider = [];
@@ -1,7 +1,4 @@
1
- "use strict";
2
- Object.defineProperty(exports, "__esModule", { value: true });
3
- exports.D4DJNoteType = exports.B34DJNoteType = void 0;
4
- var B34DJNoteType;
1
+ export var B34DJNoteType;
5
2
  (function (B34DJNoteType) {
6
3
  B34DJNoteType["Tap1"] = "Tap1";
7
4
  B34DJNoteType["Tap2"] = "Tap2";
@@ -13,8 +10,8 @@ var B34DJNoteType;
13
10
  B34DJNoteType["LongMiddle"] = "LongMiddle";
14
11
  B34DJNoteType["LongEnd"] = "LongEnd";
15
12
  B34DJNoteType["Slide"] = "Slide";
16
- })(B34DJNoteType || (exports.B34DJNoteType = B34DJNoteType = {}));
17
- var D4DJNoteType;
13
+ })(B34DJNoteType || (B34DJNoteType = {}));
14
+ export var D4DJNoteType;
18
15
  (function (D4DJNoteType) {
19
16
  D4DJNoteType[D4DJNoteType["Tap1"] = 0] = "Tap1";
20
17
  D4DJNoteType[D4DJNoteType["Tap2"] = 1] = "Tap2";
@@ -26,4 +23,4 @@ var D4DJNoteType;
26
23
  D4DJNoteType[D4DJNoteType["LongMiddle"] = 7] = "LongMiddle";
27
24
  D4DJNoteType[D4DJNoteType["LongEnd"] = 8] = "LongEnd";
28
25
  D4DJNoteType[D4DJNoteType["Slide"] = 9] = "Slide";
29
- })(D4DJNoteType || (exports.D4DJNoteType = D4DJNoteType = {}));
26
+ })(D4DJNoteType || (D4DJNoteType = {}));
@@ -1,3 +1,3 @@
1
1
  import { LevelData } from '@sonolus/core';
2
- import { D4CChartData } from './index.cjs';
2
+ import { D4CChartData } from './index.js';
3
3
  export declare function d4cToLevelData(chart: D4CChartData, offset?: number): LevelData;
@@ -1,8 +1,5 @@
1
- "use strict";
2
- Object.defineProperty(exports, "__esModule", { value: true });
3
- exports.d4cToLevelData = void 0;
4
- const index_cjs_1 = require("./index.cjs");
5
- function d4cToLevelData(chart, offset = 0) {
1
+ import { D4CNoteType } from './index.js';
2
+ export function d4cToLevelData(chart, offset = 0) {
6
3
  // let d4chart: any = []
7
4
  // d4chart[0] = chart.MusicName
8
5
  // d4chart[1] = []
@@ -119,39 +116,30 @@ function d4cToLevelData(chart, offset = 0) {
119
116
  ],
120
117
  }));
121
118
  let notes = note(chart);
122
- const lastNoteBeat = chart.NoteDataList[chart.NoteDataList.length - 1].Beat;
123
- let lastBlBeat = chart.BarLine.List[chart.BarLine.List.length - 1];
124
- lastBlBeat = typeof lastBlBeat === "number" ? lastBlBeat : lastBlBeat.Beat;
125
- const end = chart.BpmDataList.map((data, i, arr) => 60 / data.Bpm * ((i < arr.length - 1 ? arr[i + 1].Beat : Math.max(lastNoteBeat, lastBlBeat)) - data.Beat)).reduce((a, b) => a + b) + chart.Offset + offset + 5;
126
- const sd = Array.from({ length: end * 120 / 16 }, (_, index) => ({
127
- archetype: 'SliderData',
128
- data: [],
129
- }));
130
- data.entities.push(...bpm, ...ts.flat(), ...notes, ...bl, ...sd);
119
+ data.entities.push(...bpm, ...ts.flat(), ...notes, ...bl);
131
120
  return data;
132
121
  }
133
- exports.d4cToLevelData = d4cToLevelData;
134
122
  function note(chart) {
135
123
  let hold = [];
136
124
  let slider = [];
137
125
  let notes = {};
138
126
  let nots = chart.NoteDataList.map(({ Beat, Type, LaneId, NextId, Direction, EffectType, EffectParameter, TimeScaleGroupId }, i) => {
139
127
  const not = {
140
- archetype: Type === index_cjs_1.D4CNoteType.Tap1
128
+ archetype: Type === D4CNoteType.Tap1
141
129
  ? "DarkTapNote"
142
- : Type === index_cjs_1.D4CNoteType.Tap2
130
+ : Type === D4CNoteType.Tap2
143
131
  ? "LightTapNote"
144
- : Type === index_cjs_1.D4CNoteType.Scratch
132
+ : Type === D4CNoteType.Scratch
145
133
  ? "ScratchNote"
146
- : Type === index_cjs_1.D4CNoteType.StopStart
134
+ : Type === D4CNoteType.StopStart
147
135
  ? "StopStartNote"
148
- : Type === index_cjs_1.D4CNoteType.StopEnd
136
+ : Type === D4CNoteType.StopEnd
149
137
  ? "StopEndNote"
150
- : Type === index_cjs_1.D4CNoteType.LongStart
138
+ : Type === D4CNoteType.LongStart
151
139
  ? "HoldStartNote"
152
- : Type === index_cjs_1.D4CNoteType.LongEnd
140
+ : Type === D4CNoteType.LongEnd
153
141
  ? "HoldEndNote"
154
- : Type === index_cjs_1.D4CNoteType.LongMiddle
142
+ : Type === D4CNoteType.LongMiddle
155
143
  ? "HoldMiddleNote"
156
144
  : Direction !== 0
157
145
  ? "SliderFlickNote"
@@ -175,7 +163,7 @@ function note(chart) {
175
163
  notes[Beat]
176
164
  ? notes[Beat].push({ name: `note${i}`, lane: LaneId })
177
165
  : (notes[Beat] = [{ name: `note${i}`, lane: LaneId }]);
178
- if (NextId && (Type === index_cjs_1.D4CNoteType.LongStart || Type === index_cjs_1.D4CNoteType.StopStart)) {
166
+ if (NextId && (Type === D4CNoteType.LongStart || Type === D4CNoteType.StopStart)) {
179
167
  let note = {};
180
168
  note.head = not.name;
181
169
  note.tail = `note${NextId}`;
@@ -185,7 +173,7 @@ function note(chart) {
185
173
  ref: `note${NextId}`,
186
174
  });
187
175
  }
188
- if (Type === index_cjs_1.D4CNoteType.Slide) {
176
+ if (Type === D4CNoteType.Slide) {
189
177
  if (NextId && NextId > 0) {
190
178
  slider.push({ prev: not.name, next: `note${NextId}` });
191
179
  not.data.push({
@@ -200,7 +188,7 @@ function note(chart) {
200
188
  ref: sld.prev,
201
189
  });
202
190
  }
203
- if (Type === index_cjs_1.D4CNoteType.LongEnd || Type === index_cjs_1.D4CNoteType.StopEnd) {
191
+ if (Type === D4CNoteType.LongEnd || Type === D4CNoteType.StopEnd) {
204
192
  not.data.push({
205
193
  name: "head",
206
194
  ref: hold.find((note) => note.tail === not.name).head,
@@ -1,7 +1,4 @@
1
- "use strict";
2
- Object.defineProperty(exports, "__esModule", { value: true });
3
- exports.D4CNoteType = void 0;
4
- var D4CNoteType;
1
+ export var D4CNoteType;
5
2
  (function (D4CNoteType) {
6
3
  D4CNoteType["Tap1"] = "Tap1";
7
4
  D4CNoteType["Tap2"] = "Tap2";
@@ -12,4 +9,4 @@ var D4CNoteType;
12
9
  D4CNoteType["LongMiddle"] = "LongMiddle";
13
10
  D4CNoteType["LongEnd"] = "LongEnd";
14
11
  D4CNoteType["Slide"] = "Slide";
15
- })(D4CNoteType || (exports.D4CNoteType = D4CNoteType = {}));
12
+ })(D4CNoteType || (D4CNoteType = {}));
@@ -1,8 +1,8 @@
1
- export { b34djToLevelData, d4djToLevelData } from './b34dj/convert.cjs';
2
- export { d4cToLevelData } from './d4c/convert.cjs';
3
- export * from './b34dj/index.cjs';
4
- export * from './d4c/index.cjs';
5
- export declare const version = "1.4.6";
1
+ export { b34djToLevelData, d4djToLevelData } from './b34dj/convert.js';
2
+ export { d4cToLevelData } from './d4c/convert.js';
3
+ export * from './b34dj/index.js';
4
+ export * from './d4c/index.js';
5
+ export declare const version = "1.5.1";
6
6
  export declare const databaseEngineItem: {
7
7
  readonly name: "d4dj";
8
8
  readonly version: 13;
package/dist/index.js ADDED
@@ -0,0 +1,30 @@
1
+ export { b34djToLevelData, d4djToLevelData } from './b34dj/convert.js';
2
+ export { d4cToLevelData } from './d4c/convert.js';
3
+ export * from './b34dj/index.js';
4
+ export * from './d4c/index.js';
5
+ export const version = '1.5.1';
6
+ export const databaseEngineItem = {
7
+ name: 'd4dj',
8
+ version: 13,
9
+ title: {
10
+ en: 'D4DJ'
11
+ },
12
+ subtitle: {
13
+ en: 'D4DJ Groovy Mix',
14
+ ja: 'D4DJグルミク',
15
+ },
16
+ author: {
17
+ en: 'Gorengan Hunter#329978',
18
+ },
19
+ description: {
20
+ en: [
21
+ 'A recreation of D4DJ Groovy Mix engine in Sonolus.',
22
+ '',
23
+ 'Version:',
24
+ version,
25
+ '',
26
+ 'GitHub Repository:',
27
+ 'https://github.com/gorenganhunter/sonolus-d4dj-engine',
28
+ ].join('\n'),
29
+ },
30
+ };
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "sonolus-d4dj-engine",
3
- "version": "1.4.6",
3
+ "version": "1.5.1",
4
4
  "description": "A recreation of D4DJ Groovy Mix engine in Sonolus.",
5
5
  "type": "module",
6
6
  "author": "Gorengan Hunter",
@@ -14,7 +14,7 @@
14
14
  "dist"
15
15
  ],
16
16
  "exports": {
17
- ".": "./dist/index.cjs",
17
+ ".": "./dist/index.js",
18
18
  "./EngineConfiguration": "./dist/EngineConfiguration",
19
19
  "./EnginePlayData": "./dist/EnginePlayData",
20
20
  "./EngineWatchData": "./dist/EngineWatchData",
@@ -33,12 +33,11 @@
33
33
  "build": "tsc -p ./lib && sonolus-cli --build ./play && sonolus-cli --build ./watch && sonolus-cli --build ./preview && sonolus-cli --build ./tutorial && node ./lib/build.mjs"
34
34
  },
35
35
  "dependencies": {
36
- "@sonolus/core": "^7.13.2",
37
- "@sonolus/express": "^7.3.2"
36
+ "@sonolus/core": "^7.14.0"
38
37
  },
39
38
  "devDependencies": {
40
39
  "@eslint/js": "^8.57.0",
41
- "@sonolus/sonolus.js": "^9.5.6",
40
+ "@sonolus/sonolus.js": "^9.6.0",
42
41
  "eslint": "^8.57.0",
43
42
  "eslint-config-prettier": "^9.1.0",
44
43
  "prettier": "^3.3.1",
package/dist/index.cjs DELETED
@@ -1,50 +0,0 @@
1
- "use strict";
2
- var __createBinding = (this && this.__createBinding) || (Object.create ? (function(o, m, k, k2) {
3
- if (k2 === undefined) k2 = k;
4
- var desc = Object.getOwnPropertyDescriptor(m, k);
5
- if (!desc || ("get" in desc ? !m.__esModule : desc.writable || desc.configurable)) {
6
- desc = { enumerable: true, get: function() { return m[k]; } };
7
- }
8
- Object.defineProperty(o, k2, desc);
9
- }) : (function(o, m, k, k2) {
10
- if (k2 === undefined) k2 = k;
11
- o[k2] = m[k];
12
- }));
13
- var __exportStar = (this && this.__exportStar) || function(m, exports) {
14
- for (var p in m) if (p !== "default" && !Object.prototype.hasOwnProperty.call(exports, p)) __createBinding(exports, m, p);
15
- };
16
- Object.defineProperty(exports, "__esModule", { value: true });
17
- exports.databaseEngineItem = exports.version = exports.d4cToLevelData = exports.d4djToLevelData = exports.b34djToLevelData = void 0;
18
- var convert_cjs_1 = require("./b34dj/convert.cjs");
19
- Object.defineProperty(exports, "b34djToLevelData", { enumerable: true, get: function () { return convert_cjs_1.b34djToLevelData; } });
20
- Object.defineProperty(exports, "d4djToLevelData", { enumerable: true, get: function () { return convert_cjs_1.d4djToLevelData; } });
21
- var convert_cjs_2 = require("./d4c/convert.cjs");
22
- Object.defineProperty(exports, "d4cToLevelData", { enumerable: true, get: function () { return convert_cjs_2.d4cToLevelData; } });
23
- __exportStar(require("./b34dj/index.cjs"), exports);
24
- __exportStar(require("./d4c/index.cjs"), exports);
25
- exports.version = '1.4.6';
26
- exports.databaseEngineItem = {
27
- name: 'd4dj',
28
- version: 13,
29
- title: {
30
- en: 'D4DJ'
31
- },
32
- subtitle: {
33
- en: 'D4DJ Groovy Mix',
34
- ja: 'D4DJグルミク',
35
- },
36
- author: {
37
- en: 'Gorengan Hunter#329978',
38
- },
39
- description: {
40
- en: [
41
- 'A recreation of D4DJ Groovy Mix engine in Sonolus.',
42
- '',
43
- 'Version:',
44
- exports.version,
45
- '',
46
- 'GitHub Repository:',
47
- 'https://github.com/gorenganhunter/sonolus-d4dj-engine',
48
- ].join('\n'),
49
- },
50
- };
File without changes
File without changes