@modplayjs/fmt-fc 0.0.0-stage → 0.2.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.
- package/README.md +41 -2
- package/dist/fc.d.ts +15 -0
- package/dist/fc.d.ts.map +1 -0
- package/dist/fc.js +1111 -0
- package/dist/fc.js.map +1 -0
- package/dist/index.d.ts +3 -0
- package/dist/index.d.ts.map +1 -0
- package/dist/index.js +6 -0
- package/dist/index.js.map +1 -0
- package/dist/linearTables.d.ts +4 -0
- package/dist/linearTables.d.ts.map +1 -0
- package/dist/linearTables.js +13 -0
- package/dist/linearTables.js.map +1 -0
- package/dist/synth.d.ts +302 -0
- package/dist/synth.d.ts.map +1 -0
- package/dist/synth.js +1430 -0
- package/dist/synth.js.map +1 -0
- package/package.json +51 -4
package/README.md
CHANGED
|
@@ -1,3 +1,42 @@
|
|
|
1
|
-
#
|
|
1
|
+
# @modplayjs/fmt-fc
|
|
2
2
|
|
|
3
|
-
|
|
3
|
+
**Future Composer 1.0–1.4 (.fc13/.fc14, SMOD) plugin** for
|
|
4
|
+
`@modplayjs/core`. The loader is a 1:1 port of OpenMPT's
|
|
5
|
+
`Load_fc.cpp` (header validation, playlist, pattern decode with
|
|
6
|
+
per-channel transposes, E0–EA script translation with the
|
|
7
|
+
volume-underflow quirk, built-in waveforms, SSMP sub-samples).
|
|
8
|
+
|
|
9
|
+
Playback drives the **InstrumentSynth engine port** (`synth.ts`) — the
|
|
10
|
+
same synth OpenMPT uses for FC/MED/GT2 scripts — through the core's
|
|
11
|
+
EffectPlugin hooks. Pitch mapping is exact (the FC pitch block reads the
|
|
12
|
+
loader NoteMap exactly like C) and all 20 test-corpus files load.
|
|
13
|
+
|
|
14
|
+
Known synth-engine deltas vs OpenMPT (swapSampleIndex bookkeeping,
|
|
15
|
+
MED_JumpScript sibling-state access) are tracked in
|
|
16
|
+
[docs/REMAINING-PARITY.md](../../docs/REMAINING-PARITY.md).
|
|
17
|
+
|
|
18
|
+
## Install
|
|
19
|
+
|
|
20
|
+
```sh
|
|
21
|
+
npm install @modplayjs/fmt-fc
|
|
22
|
+
```
|
|
23
|
+
|
|
24
|
+
## Usage
|
|
25
|
+
|
|
26
|
+
```ts
|
|
27
|
+
import { CorePlayer } from '@modplayjs/core';
|
|
28
|
+
import { plugin as fcPlugin, fcEffect } from '@modplayjs/fmt-fc';
|
|
29
|
+
|
|
30
|
+
const core = new CorePlayer();
|
|
31
|
+
core.registries.registerFormat(fcPlugin);
|
|
32
|
+
core.registries.registerEffect(fcEffect);
|
|
33
|
+
core.loadModule(bytes); // .fc13 / .fc14
|
|
34
|
+
```
|
|
35
|
+
|
|
36
|
+
## Also exports
|
|
37
|
+
|
|
38
|
+
`fcTest` / `fcLoad`, `setModEventReader`, and the full synth-event
|
|
39
|
+
surface (`SynthState`, `ev*` command handlers) for reuse by other
|
|
40
|
+
script-driven formats.
|
|
41
|
+
|
|
42
|
+
Part of the [modplayjs monorepo](../../README.md). BSD-3-Clause.
|
package/dist/fc.d.ts
ADDED
|
@@ -0,0 +1,15 @@
|
|
|
1
|
+
import type { Core, EffectPlugin, FormatPlugin, LoadCtx, ModuleData } from '@modplayjs/core';
|
|
2
|
+
export declare function fcTest(bytes: Uint8Array): boolean;
|
|
3
|
+
export declare function fcLoad(bytes: Uint8Array, ctx: LoadCtx): ModuleData;
|
|
4
|
+
declare module './fc.js' { }
|
|
5
|
+
/** OpenMPT Sndmix.cpp:2197 (NextTick before volume) + :2371
|
|
6
|
+
* (ApplyChannelState after volume) — the plugin's onTick/onTickPost run at
|
|
7
|
+
* exactly those points in our per-channel loop. */
|
|
8
|
+
export declare const fcEffect: EffectPlugin;
|
|
9
|
+
/** The plugin the demo/core registers. Also wires the channel extras reset
|
|
10
|
+
* on module start (C: new_channel_extras). */
|
|
11
|
+
export declare const plugin: FormatPlugin;
|
|
12
|
+
/** Wire the shared MOD event reader (called by the host after registering
|
|
13
|
+
* both plugins — C: MOD_TYPE_MOD shares read_event_mod). */
|
|
14
|
+
export declare function setModEventReader(fn: (core: Core, chn: number, row: number) => void): void;
|
|
15
|
+
//# sourceMappingURL=fc.d.ts.map
|
package/dist/fc.d.ts.map
ADDED
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"fc.d.ts","sourceRoot":"","sources":["../src/fc.ts"],"names":[],"mappings":"AAMA,OAAO,KAAK,EAEV,IAAI,EAEJ,YAAY,EAEZ,YAAY,EAEZ,OAAO,EACP,UAAU,EAIX,MAAM,iBAAiB,CAAC;AAqazB,wBAAgB,MAAM,CAAC,KAAK,EAAE,UAAU,GAAG,OAAO,CAEjD;AAgDD,wBAAgB,MAAM,CAAC,KAAK,EAAE,UAAU,EAAE,GAAG,EAAE,OAAO,GAAG,UAAU,CAuWlE;AAuBD,OAAO,QAAQ,SAAS,CAAC,GAAE;AA+D3B;;oDAEoD;AACpD,eAAO,MAAM,QAAQ,EAAE,YAuLtB,CAAC;AAsHF;+CAC+C;AAC/C,eAAO,MAAM,MAAM,EAAE,YAsBpB,CAAC;AAOF;6DAC6D;AAC7D,wBAAgB,iBAAiB,CAAC,EAAE,EAAE,CAAC,IAAI,EAAE,IAAI,EAAE,GAAG,EAAE,MAAM,EAAE,GAAG,EAAE,MAAM,KAAK,IAAI,GAAG,IAAI,CAE1F"}
|