@karaplay/file-coder 1.5.0 β 1.5.2
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/DEMO_ENHANCED.md +207 -134
- package/DOCUMENTATION_INDEX.md +317 -0
- package/EMK_REFERENCE_DATA.json +190 -0
- package/EMK_SONGS_INFO.md +336 -0
- package/EMK_TEST_SUITE_README.md +456 -0
- package/EMK_TEST_SUITE_SUMMARY.txt +197 -0
- package/README.md +90 -0
- package/RELEASE_v1.5.1.md +190 -0
- package/RELEASE_v1.5.2.md +238 -0
- package/SONG_LIST.txt +268 -0
- package/TEMPO_TRICKS_SUMMARY.md +240 -0
- package/demo-libs/KarFile.js +391 -0
- package/demo-libs/MIDIEvents.js +325 -0
- package/demo-libs/MIDIFile.js +450 -0
- package/demo-libs/MIDIFileHeader.js +144 -0
- package/demo-libs/MIDIFileTrack.js +111 -0
- package/demo-libs/TextEncoding.js +275 -0
- package/demo-libs/UTF8.js +151 -0
- package/demo-server.js +78 -1
- package/demo-simple.html +287 -7
- package/dist/index.d.ts +1 -0
- package/dist/index.js +5 -1
- package/dist/kar-validator.d.ts +66 -0
- package/dist/kar-validator.js +152 -0
- package/dist/ncntokar.browser.js +13 -1
- package/dist/ncntokar.js +13 -1
- package/package.json +4 -1
- package/verify-emk-reference.js +230 -0
- package/analyze-emk-cursor.js +0 -169
- package/analyze-emk-simple.js +0 -124
- package/check-real-duration.js +0 -69
- package/temp/test_output.kar +0 -0
- package/test-all-emk-durations.js +0 -109
- package/test-convert-001.js +0 -130
package/DEMO_ENHANCED.md
CHANGED
|
@@ -1,168 +1,241 @@
|
|
|
1
|
-
#
|
|
2
|
-
|
|
3
|
-
## π― New Features Added
|
|
4
|
-
|
|
5
|
-
### 1. **EMK File Analysis** (Before Conversion)
|
|
6
|
-
When you select an EMK file, it now automatically analyzes:
|
|
7
|
-
- β
Title and Artist (Thai encoding)
|
|
8
|
-
- β
Format type (ZXIO or MThd)
|
|
9
|
-
- β
**Original Tempo** (BPM)
|
|
10
|
-
- β
**Original Duration** (seconds and minutes)
|
|
11
|
-
- β
PPQ (Ticks per beat)
|
|
12
|
-
- β
Number of tracks
|
|
13
|
-
- β
Number of notes
|
|
14
|
-
- β
Lyric and cursor data size
|
|
15
|
-
|
|
16
|
-
### 2. **Comparison Table** (EMK vs KAR)
|
|
17
|
-
After conversion, see a detailed comparison:
|
|
18
|
-
- π Format changes
|
|
19
|
-
- π Tempo ratio (e.g., 2.78x for ZXIO, 4x for MThd)
|
|
20
|
-
- π Duration changes
|
|
21
|
-
- π Tempo verification (β
or β οΈ)
|
|
22
|
-
- π Track and note count
|
|
23
|
-
- π Visual indicators for increases/decreases
|
|
24
|
-
|
|
25
|
-
## π How to Use
|
|
26
|
-
|
|
27
|
-
### Step 1: Open Demo
|
|
28
|
-
```
|
|
29
|
-
http://localhost:3000/demo-simple.html
|
|
30
|
-
```
|
|
1
|
+
# Demo Page Enhanced - MIDI Player
|
|
31
2
|
|
|
32
|
-
|
|
33
|
-
|
|
34
|
-
- **Wait for automatic analysis** (1-2 seconds)
|
|
35
|
-
- See original EMK info displayed
|
|
3
|
+
**Date:** 2026-01-13
|
|
4
|
+
**Version:** v1.5.0 with MIDI Player
|
|
36
5
|
|
|
37
|
-
|
|
38
|
-
- Click "Convert to KAR"
|
|
39
|
-
- Wait for conversion
|
|
40
|
-
- See converted KAR info
|
|
6
|
+
## π΅ New Feature: MIDI Player
|
|
41
7
|
|
|
42
|
-
###
|
|
43
|
-
- Automatically displays after conversion
|
|
44
|
-
- Compare original vs converted values
|
|
45
|
-
- Verify tempo ratio is correct
|
|
8
|
+
### Added to `demo-simple.html`
|
|
46
9
|
|
|
47
|
-
|
|
48
|
-
-
|
|
49
|
-
-
|
|
10
|
+
#### 1. **UI Components**
|
|
11
|
+
- βΆοΈ **Play Button** - Start MIDI playback
|
|
12
|
+
- βΈοΈ **Pause Button** - Pause playback (currently restarts on resume)
|
|
13
|
+
- βΉοΈ **Stop Button** - Stop and reset playback
|
|
14
|
+
- **Progress Bar** - Visual playback progress
|
|
15
|
+
- **Time Display** - Current time / Total duration
|
|
16
|
+
- **Status Display** - Shows player state and messages
|
|
50
17
|
|
|
51
|
-
|
|
18
|
+
#### 2. **Libraries Used**
|
|
19
|
+
```html
|
|
20
|
+
<!-- MIDI Parser -->
|
|
21
|
+
<script src="https://cdn.jsdelivr.net/npm/midi-parser-js@4.0.4/src/main.min.js"></script>
|
|
22
|
+
|
|
23
|
+
<!-- Soundfont Player for audio synthesis -->
|
|
24
|
+
<script src="https://cdn.jsdelivr.net/npm/soundfont-player@0.12.0/dist/soundfont-player.min.js"></script>
|
|
25
|
+
```
|
|
52
26
|
|
|
27
|
+
#### 3. **Features**
|
|
28
|
+
- β
**Auto-initialize** - Loads instrument on first play
|
|
29
|
+
- β
**Parse MIDI** - Converts base64 KAR data to playable MIDI
|
|
30
|
+
- β
**Tempo-aware** - Respects MIDI tempo events
|
|
31
|
+
- β
**Real-time progress** - Updates every 100ms
|
|
32
|
+
- β
**Multi-track support** - Plays all MIDI tracks simultaneously
|
|
33
|
+
- β
**Note scheduling** - Uses Web Audio API for precise timing
|
|
34
|
+
- β
**Piano soundfont** - Uses Acoustic Grand Piano (MusyngKite)
|
|
35
|
+
|
|
36
|
+
#### 4. **How It Works**
|
|
37
|
+
|
|
38
|
+
**Step 1: Initialization**
|
|
39
|
+
```javascript
|
|
40
|
+
await initMidiPlayer();
|
|
41
|
+
// Creates AudioContext
|
|
42
|
+
// Loads soundfont from: https://gleitz.github.io/midi-js-soundfonts/
|
|
53
43
|
```
|
|
54
|
-
|
|
55
|
-
|
|
56
|
-
|
|
57
|
-
|
|
58
|
-
|
|
59
|
-
|
|
60
|
-
|
|
61
|
-
β PPQ β 96 β Same β Unchanged β
|
|
62
|
-
β Tracks β 25 β Same + Karaoke β +1 (lyrics) β
|
|
63
|
-
β Notes β 6313 β 6313 β Same β
|
|
64
|
-
β Tempo Ratio β - β 2.78x β β
Correct β
|
|
65
|
-
ββββββββββββββββββββββββ΄ββββββββββββββββββ΄ββββββββββββββββββ΄ββββββββββββββββββ
|
|
44
|
+
|
|
45
|
+
**Step 2: Parse MIDI**
|
|
46
|
+
```javascript
|
|
47
|
+
parseMidiData(base64Data);
|
|
48
|
+
// Decodes base64 β Uint8Array
|
|
49
|
+
// Parses with MidiParser.js
|
|
50
|
+
// Extracts tempo, PPQ, notes
|
|
66
51
|
```
|
|
67
52
|
|
|
68
|
-
|
|
53
|
+
**Step 3: Schedule Notes**
|
|
54
|
+
```javascript
|
|
55
|
+
// Converts ticks to seconds
|
|
56
|
+
ticksToSeconds(ticks, tempo, ppq);
|
|
57
|
+
|
|
58
|
+
// Schedules note events
|
|
59
|
+
instrument.play(midiNote, scheduleTime, options);
|
|
60
|
+
```
|
|
69
61
|
|
|
70
|
-
|
|
71
|
-
|
|
72
|
-
|
|
73
|
-
|
|
62
|
+
**Step 4: Playback Control**
|
|
63
|
+
```javascript
|
|
64
|
+
playMidi() // Start playback
|
|
65
|
+
pauseMidi() // Stop all notes
|
|
66
|
+
stopMidi() // Reset to beginning
|
|
67
|
+
```
|
|
74
68
|
|
|
75
|
-
|
|
76
|
-
- Tempo: **178.09 BPM** (2.78x)
|
|
77
|
-
- Duration: **~2.11 minutes** (126 seconds)
|
|
78
|
-
- Tempo Ratio: β
**Correct (2.78x)**
|
|
69
|
+
## π― Usage
|
|
79
70
|
|
|
80
|
-
###
|
|
81
|
-
|
|
82
|
-
|
|
83
|
-
|
|
71
|
+
### 1. Convert EMK to KAR
|
|
72
|
+
1. Select an EMK file from the list
|
|
73
|
+
2. Click "π Convert to KAR"
|
|
74
|
+
3. Wait for conversion to complete
|
|
84
75
|
|
|
85
|
-
|
|
86
|
-
|
|
87
|
-
|
|
88
|
-
|
|
76
|
+
### 2. Play Converted KAR
|
|
77
|
+
1. After successful conversion, MIDI Player appears
|
|
78
|
+
2. Click "βΆοΈ Play" to start playback
|
|
79
|
+
3. Use "βΈοΈ Pause" or "βΉοΈ Stop" to control playback
|
|
89
80
|
|
|
90
|
-
|
|
81
|
+
### 3. Monitor Playback
|
|
82
|
+
- **Progress Bar** - Shows current position
|
|
83
|
+
- **Time Display** - Shows current time / total duration
|
|
84
|
+
- **Status** - Shows player state (Playing, Paused, Stopped)
|
|
91
85
|
|
|
92
|
-
|
|
93
|
-
Analyze EMK file before conversion
|
|
86
|
+
## π§ Technical Details
|
|
94
87
|
|
|
95
|
-
|
|
96
|
-
|
|
97
|
-
|
|
98
|
-
|
|
99
|
-
|
|
88
|
+
### MIDI Processing
|
|
89
|
+
|
|
90
|
+
**Tempo Calculation:**
|
|
91
|
+
```javascript
|
|
92
|
+
microsecondsPerBeat = (data[0] << 16) | (data[1] << 8) | data[2];
|
|
100
93
|
```
|
|
101
94
|
|
|
102
|
-
**
|
|
103
|
-
```
|
|
104
|
-
|
|
105
|
-
"success": true,
|
|
106
|
-
"emkInfo": {
|
|
107
|
-
"format": "ZXIO",
|
|
108
|
-
"title": "ΰΈΰΈΰΈΰΈ£ΰΈ°ΰΈΰΈΰΈ",
|
|
109
|
-
"artist": "ΰΈΰΈΈΰΉΰΈ ΰΈ¨ΰΈΈΰΈ ΰΈΰΈ²ΰΈΰΈΰΈΰΉ",
|
|
110
|
-
"tempo": "64.00",
|
|
111
|
-
"duration": "351.56",
|
|
112
|
-
"durationMinutes": "5.86",
|
|
113
|
-
"ppq": 96,
|
|
114
|
-
"tracks": 25,
|
|
115
|
-
"notes": 6313,
|
|
116
|
-
"hasLyrics": 3456,
|
|
117
|
-
"hasCursor": 3742
|
|
118
|
-
}
|
|
119
|
-
}
|
|
95
|
+
**Time Conversion:**
|
|
96
|
+
```javascript
|
|
97
|
+
seconds = (ticks Γ microsecondsPerBeat) / (ppq Γ 1000000)
|
|
120
98
|
```
|
|
121
99
|
|
|
122
|
-
|
|
100
|
+
**Note Events:**
|
|
101
|
+
- **Type 9 (Note On):** data[0] = note, data[1] = velocity
|
|
102
|
+
- **Type 8 (Note Off):** data[0] = note
|
|
103
|
+
- **Type 255, Meta 81:** Set Tempo event
|
|
104
|
+
|
|
105
|
+
### Audio Synthesis
|
|
106
|
+
|
|
107
|
+
**Soundfont:**
|
|
108
|
+
- Source: `https://gleitz.github.io/midi-js-soundfonts/`
|
|
109
|
+
- Format: MusyngKite (high quality)
|
|
110
|
+
- Instrument: Acoustic Grand Piano
|
|
111
|
+
|
|
112
|
+
**Web Audio API:**
|
|
113
|
+
- Uses `AudioContext` for precise timing
|
|
114
|
+
- Schedules notes in advance
|
|
115
|
+
- Supports dynamic gain (velocity)
|
|
123
116
|
|
|
124
|
-
|
|
125
|
-
- β
**Correct (2.78x)** - ZXIO format with correct tempo
|
|
126
|
-
- β
**Correct (~4x)** - MThd format with correct tempo
|
|
127
|
-
- β οΈ **Unexpected** - Tempo ratio doesn't match expected value
|
|
117
|
+
## π Testing
|
|
128
118
|
|
|
129
|
-
###
|
|
130
|
-
|
|
131
|
-
|
|
132
|
-
|
|
119
|
+
### Test File: `001_original_emk.emk`
|
|
120
|
+
|
|
121
|
+
**Expected Results:**
|
|
122
|
+
```
|
|
123
|
+
Format: ZXIO
|
|
124
|
+
Tempo: 79 BPM
|
|
125
|
+
Duration: 4:43 (283 seconds)
|
|
126
|
+
Tracks: 25
|
|
127
|
+
Notes: 6313
|
|
128
|
+
```
|
|
133
129
|
|
|
134
|
-
|
|
130
|
+
**Playback:**
|
|
131
|
+
- β
Should play piano notes
|
|
132
|
+
- β
Should follow correct tempo (79 BPM)
|
|
133
|
+
- β
Should complete in ~4:43
|
|
134
|
+
- β
Progress bar should update smoothly
|
|
135
|
+
- β
Time display should increment correctly
|
|
135
136
|
|
|
136
|
-
|
|
137
|
-
1. **Before/After Comparison** - See exact changes from conversion
|
|
138
|
-
2. **Tempo Verification** - Confirm correct ratio is applied
|
|
139
|
-
3. **Duration Accuracy** - Verify music length is correct
|
|
140
|
-
4. **Format Detection** - Ensure ZXIO vs MThd is identified correctly
|
|
137
|
+
## π Known Limitations
|
|
141
138
|
|
|
142
|
-
|
|
143
|
-
|
|
144
|
-
|
|
145
|
-
3. **Quality Assurance** - Demonstrates accurate metadata preservation
|
|
139
|
+
1. **Pause/Resume**
|
|
140
|
+
- Currently restarts playback from beginning
|
|
141
|
+
- Full resume from pause position requires state tracking
|
|
146
142
|
|
|
147
|
-
|
|
148
|
-
|
|
149
|
-
|
|
150
|
-
3. **Format Info** - Identify which conversion path was used
|
|
143
|
+
2. **Instrument**
|
|
144
|
+
- Only uses piano soundfont
|
|
145
|
+
- Does not respect MIDI program changes (instrument selection)
|
|
151
146
|
|
|
152
|
-
|
|
147
|
+
3. **Performance**
|
|
148
|
+
- Large MIDI files (>10,000 notes) may cause lag
|
|
149
|
+
- All notes are scheduled at once
|
|
153
150
|
|
|
154
|
-
**
|
|
151
|
+
4. **Browser Support**
|
|
152
|
+
- Requires Web Audio API support
|
|
153
|
+
- Tested on Chrome, Firefox, Safari
|
|
154
|
+
|
|
155
|
+
## π Future Improvements
|
|
156
|
+
|
|
157
|
+
1. **Lyrics Display**
|
|
158
|
+
- Show synchronized lyrics during playback
|
|
159
|
+
- Highlight current lyric line
|
|
160
|
+
|
|
161
|
+
2. **Multiple Instruments**
|
|
162
|
+
- Load different soundfonts per track
|
|
163
|
+
- Respect MIDI program changes
|
|
164
|
+
|
|
165
|
+
3. **Better Pause**
|
|
166
|
+
- Resume from exact pause position
|
|
167
|
+
- Maintain note states
|
|
168
|
+
|
|
169
|
+
4. **Visualization**
|
|
170
|
+
- Piano roll display
|
|
171
|
+
- Waveform visualization
|
|
172
|
+
- Spectrum analyzer
|
|
173
|
+
|
|
174
|
+
5. **Playback Controls**
|
|
175
|
+
- Speed control (0.5x, 1x, 2x)
|
|
176
|
+
- Volume control
|
|
177
|
+
- Seek bar (click to jump)
|
|
178
|
+
|
|
179
|
+
## π Code Structure
|
|
180
|
+
|
|
181
|
+
```
|
|
182
|
+
demo-simple.html
|
|
183
|
+
βββ UI Components
|
|
184
|
+
β βββ Play/Pause/Stop buttons
|
|
185
|
+
β βββ Progress bar
|
|
186
|
+
β βββ Time display
|
|
187
|
+
β βββ Status panel
|
|
188
|
+
β
|
|
189
|
+
βββ MIDI Player Object
|
|
190
|
+
β βββ ac: AudioContext
|
|
191
|
+
β βββ instrument: Soundfont instance
|
|
192
|
+
β βββ midiData: Parsed MIDI
|
|
193
|
+
β βββ State: isPlaying, isPaused, etc.
|
|
194
|
+
β
|
|
195
|
+
βββ Functions
|
|
196
|
+
βββ initMidiPlayer() - Initialize audio
|
|
197
|
+
βββ parseMidiData() - Parse MIDI from base64
|
|
198
|
+
βββ playMidi() - Start playback
|
|
199
|
+
βββ pauseMidi() - Pause playback
|
|
200
|
+
βββ stopMidi() - Stop playback
|
|
201
|
+
βββ ticksToSeconds() - Convert MIDI ticks to time
|
|
155
202
|
```
|
|
156
|
-
|
|
203
|
+
|
|
204
|
+
## β
Verification
|
|
205
|
+
|
|
206
|
+
### Server Running
|
|
207
|
+
```bash
|
|
208
|
+
npm run demo
|
|
209
|
+
# Server: http://localhost:3000
|
|
210
|
+
# Demo: http://localhost:3000/demo-simple.html
|
|
157
211
|
```
|
|
158
212
|
|
|
159
|
-
|
|
160
|
-
1.
|
|
161
|
-
2.
|
|
162
|
-
3. Convert to KAR
|
|
163
|
-
4.
|
|
164
|
-
|
|
213
|
+
### Test Conversion
|
|
214
|
+
1. Open: `http://localhost:3000/demo-simple.html`
|
|
215
|
+
2. Select: `001_original_emk.emk`
|
|
216
|
+
3. Click: "π Convert to KAR"
|
|
217
|
+
4. Verify: Tempo = 79 BPM, Duration = 4:43
|
|
218
|
+
|
|
219
|
+
### Test Playback
|
|
220
|
+
1. Click: "βΆοΈ Play"
|
|
221
|
+
2. Verify: Piano notes play
|
|
222
|
+
3. Verify: Progress bar moves
|
|
223
|
+
4. Verify: Time display updates
|
|
224
|
+
5. Click: "βΉοΈ Stop"
|
|
225
|
+
6. Verify: Playback stops, progress resets
|
|
165
226
|
|
|
166
227
|
---
|
|
167
228
|
|
|
168
|
-
|
|
229
|
+
## π Status: β
Complete
|
|
230
|
+
|
|
231
|
+
**Demo Page Features:**
|
|
232
|
+
- β
EMK file list
|
|
233
|
+
- β
File selection
|
|
234
|
+
- β
EMK analysis (before conversion)
|
|
235
|
+
- β
EMK to KAR conversion
|
|
236
|
+
- β
Metadata display
|
|
237
|
+
- β
Comparison table (EMK vs KAR)
|
|
238
|
+
- β
KAR file download
|
|
239
|
+
- β
**MIDI Player** (NEW!)
|
|
240
|
+
|
|
241
|
+
**Ready for testing and demonstration!** π
|
|
@@ -0,0 +1,317 @@
|
|
|
1
|
+
# π Documentation Index
|
|
2
|
+
|
|
3
|
+
**@karaplay/file-coder v1.5.1+**
|
|
4
|
+
Complete guide to EMK/KAR conversion and testing
|
|
5
|
+
|
|
6
|
+
---
|
|
7
|
+
|
|
8
|
+
## π Getting Started
|
|
9
|
+
|
|
10
|
+
### For Users
|
|
11
|
+
|
|
12
|
+
1. **[README.md](./README.md)** β START HERE
|
|
13
|
+
- Installation and quick start
|
|
14
|
+
- Main API documentation
|
|
15
|
+
- Features and examples
|
|
16
|
+
- Browser/Server usage
|
|
17
|
+
|
|
18
|
+
2. **[BROWSER_API.md](./BROWSER_API.md)**
|
|
19
|
+
- Client-side conversion guide
|
|
20
|
+
- Next.js integration
|
|
21
|
+
- Browser examples
|
|
22
|
+
|
|
23
|
+
---
|
|
24
|
+
|
|
25
|
+
## π΅ Song Conversion
|
|
26
|
+
|
|
27
|
+
### Main Workflow
|
|
28
|
+
|
|
29
|
+
3. **[EMK_TO_KAR_WORKFLOW.md](./EMK_TO_KAR_WORKFLOW.md)**
|
|
30
|
+
- Complete EMK β KAR pipeline
|
|
31
|
+
- Step-by-step guide
|
|
32
|
+
- Advanced options
|
|
33
|
+
|
|
34
|
+
4. **[HOWTOEMKTONCN.md](./HOWTOEMKTONCN.md)**
|
|
35
|
+
- EMK to NCN conversion
|
|
36
|
+
- Technical details
|
|
37
|
+
|
|
38
|
+
---
|
|
39
|
+
|
|
40
|
+
## β±οΈ Tempo & Duration
|
|
41
|
+
|
|
42
|
+
### Understanding Tempo
|
|
43
|
+
|
|
44
|
+
5. **[TEMPO_TRICKS_SUMMARY.md](./TEMPO_TRICKS_SUMMARY.md)** β BEST PRACTICES
|
|
45
|
+
- How to use @tonejs/midi correctly
|
|
46
|
+
- Common pitfalls and solutions
|
|
47
|
+
- ZXIO vs MThd formats
|
|
48
|
+
- Why duration decreases when tempo increases
|
|
49
|
+
|
|
50
|
+
6. **[WHY_DURATION_DECREASES.md](./WHY_DURATION_DECREASES.md)**
|
|
51
|
+
- Mathematical explanation
|
|
52
|
+
- Tempo-duration relationship
|
|
53
|
+
|
|
54
|
+
---
|
|
55
|
+
|
|
56
|
+
## π§ͺ Testing & Validation
|
|
57
|
+
|
|
58
|
+
### Test Suite
|
|
59
|
+
|
|
60
|
+
7. **[EMK_TEST_SUITE_README.md](./EMK_TEST_SUITE_README.md)** β TESTING GUIDE
|
|
61
|
+
- Complete test suite documentation
|
|
62
|
+
- How to run tests
|
|
63
|
+
- Debugging failed tests
|
|
64
|
+
- Best practices
|
|
65
|
+
|
|
66
|
+
8. **[EMK_SONGS_INFO.md](./EMK_SONGS_INFO.md)**
|
|
67
|
+
- Song information database
|
|
68
|
+
- Expected results for each file
|
|
69
|
+
- Format statistics
|
|
70
|
+
- Verification checklist
|
|
71
|
+
|
|
72
|
+
9. **[EMK_TEST_SUITE_SUMMARY.txt](./EMK_TEST_SUITE_SUMMARY.txt)**
|
|
73
|
+
- Quick reference summary
|
|
74
|
+
- Test results overview
|
|
75
|
+
- Statistics
|
|
76
|
+
|
|
77
|
+
10. **[EMK_REFERENCE_DATA.json](./EMK_REFERENCE_DATA.json)**
|
|
78
|
+
- Machine-readable reference data
|
|
79
|
+
- Used by test scripts
|
|
80
|
+
- Auto-generated from conversions
|
|
81
|
+
|
|
82
|
+
---
|
|
83
|
+
|
|
84
|
+
## π§ Technical Details
|
|
85
|
+
|
|
86
|
+
### Problem Solving
|
|
87
|
+
|
|
88
|
+
11. **[KAR_FILE_VALIDATION_SOLUTION.md](./KAR_FILE_VALIDATION_SOLUTION.md)**
|
|
89
|
+
- KAR file validation
|
|
90
|
+
- Quality checks
|
|
91
|
+
|
|
92
|
+
12. **[BROWSER_KAR_CORRUPTION_FIX.md](./BROWSER_KAR_CORRUPTION_FIX.md)**
|
|
93
|
+
- Browser-specific issues
|
|
94
|
+
- Corruption fixes
|
|
95
|
+
|
|
96
|
+
13. **[BUG_FIX_SUMMARY.md](./BUG_FIX_SUMMARY.md)**
|
|
97
|
+
- Historical bug fixes
|
|
98
|
+
- Solutions applied
|
|
99
|
+
|
|
100
|
+
---
|
|
101
|
+
|
|
102
|
+
## π Demo & Examples
|
|
103
|
+
|
|
104
|
+
### Live Demo
|
|
105
|
+
|
|
106
|
+
14. **[DEMO_ENHANCED.md](./DEMO_ENHANCED.md)**
|
|
107
|
+
- Demo page documentation
|
|
108
|
+
- Features and usage
|
|
109
|
+
|
|
110
|
+
15. **[demo-simple.html](./demo-simple.html)**
|
|
111
|
+
- Live demo page
|
|
112
|
+
- Run: `npm run demo`
|
|
113
|
+
- Browser: http://localhost:3000
|
|
114
|
+
|
|
115
|
+
16. **[examples/NextJSComponent.tsx](./examples/NextJSComponent.tsx)**
|
|
116
|
+
- React/Next.js example
|
|
117
|
+
- Client-side conversion
|
|
118
|
+
|
|
119
|
+
---
|
|
120
|
+
|
|
121
|
+
## π Release Notes
|
|
122
|
+
|
|
123
|
+
### Version History
|
|
124
|
+
|
|
125
|
+
17. **[RELEASE_v1.5.1.md](./RELEASE_v1.5.1.md)** β LATEST
|
|
126
|
+
- Validation utilities
|
|
127
|
+
- Enhanced documentation
|
|
128
|
+
- Test suite
|
|
129
|
+
|
|
130
|
+
18. **[RELEASE_v1.5.0.md](./RELEASE_v1.5.0.md)**
|
|
131
|
+
- ZXIO tempo fix (1.24x)
|
|
132
|
+
- Duration accuracy improvements
|
|
133
|
+
|
|
134
|
+
19. **[RELEASE_v1.4.9.md](./RELEASE_v1.4.9.md)**
|
|
135
|
+
- ZXIO format support improvements
|
|
136
|
+
|
|
137
|
+
20. **[RELEASE_v1.4.7.md](./RELEASE_v1.4.7.md)**
|
|
138
|
+
- ZXIO "zxio" header support
|
|
139
|
+
|
|
140
|
+
21. **Previous Releases:**
|
|
141
|
+
- v1.4.0 - v1.4.6: See individual release notes
|
|
142
|
+
- v1.3.0 - v1.3.9: See individual release notes
|
|
143
|
+
- v1.1.1 - v1.2.0: See individual release notes
|
|
144
|
+
|
|
145
|
+
---
|
|
146
|
+
|
|
147
|
+
## π― Quick Reference
|
|
148
|
+
|
|
149
|
+
### Common Tasks
|
|
150
|
+
|
|
151
|
+
| Task | Documentation | Command |
|
|
152
|
+
|------|---------------|---------|
|
|
153
|
+
| **Convert EMK to KAR** | [README.md](./README.md#emk-to-kar-workflow-complete-pipeline) | `convertEmkToKar()` |
|
|
154
|
+
| **Validate KAR file** | [TEMPO_TRICKS_SUMMARY.md](./TEMPO_TRICKS_SUMMARY.md#4-validation-functions) | `validateKarTempo()` |
|
|
155
|
+
| **Run tests** | [EMK_TEST_SUITE_README.md](./EMK_TEST_SUITE_README.md#-quick-start) | `npm run test:emk` |
|
|
156
|
+
| **Fix tempo issues** | [TEMPO_TRICKS_SUMMARY.md](./TEMPO_TRICKS_SUMMARY.md#6-common-pitfalls) | Auto-fixed in v1.5.0+ |
|
|
157
|
+
| **Browser usage** | [BROWSER_API.md](./BROWSER_API.md) | `convertEmkFileToKar()` |
|
|
158
|
+
| **Run demo** | [DEMO_ENHANCED.md](./DEMO_ENHANCED.md) | `npm run demo` |
|
|
159
|
+
|
|
160
|
+
---
|
|
161
|
+
|
|
162
|
+
## π By Topic
|
|
163
|
+
|
|
164
|
+
### For Developers
|
|
165
|
+
|
|
166
|
+
**Converting Files:**
|
|
167
|
+
- [README.md](./README.md) - Main API
|
|
168
|
+
- [EMK_TO_KAR_WORKFLOW.md](./EMK_TO_KAR_WORKFLOW.md) - Complete workflow
|
|
169
|
+
- [BROWSER_API.md](./BROWSER_API.md) - Client-side
|
|
170
|
+
|
|
171
|
+
**Understanding Tempo:**
|
|
172
|
+
- [TEMPO_TRICKS_SUMMARY.md](./TEMPO_TRICKS_SUMMARY.md) - β Best practices
|
|
173
|
+
- [WHY_DURATION_DECREASES.md](./WHY_DURATION_DECREASES.md) - Explanation
|
|
174
|
+
- [RELEASE_v1.5.0.md](./RELEASE_v1.5.0.md) - ZXIO fix
|
|
175
|
+
|
|
176
|
+
**Testing:**
|
|
177
|
+
- [EMK_TEST_SUITE_README.md](./EMK_TEST_SUITE_README.md) - β Complete guide
|
|
178
|
+
- [EMK_SONGS_INFO.md](./EMK_SONGS_INFO.md) - Reference data
|
|
179
|
+
- [EMK_REFERENCE_DATA.json](./EMK_REFERENCE_DATA.json) - Test data
|
|
180
|
+
|
|
181
|
+
### For QA / Testing
|
|
182
|
+
|
|
183
|
+
**Quality Assurance:**
|
|
184
|
+
- [EMK_TEST_SUITE_README.md](./EMK_TEST_SUITE_README.md) - Test procedures
|
|
185
|
+
- [EMK_SONGS_INFO.md](./EMK_SONGS_INFO.md) - Expected results
|
|
186
|
+
- [KAR_FILE_VALIDATION_SOLUTION.md](./KAR_FILE_VALIDATION_SOLUTION.md) - Validation
|
|
187
|
+
|
|
188
|
+
**Troubleshooting:**
|
|
189
|
+
- [TEMPO_TRICKS_SUMMARY.md](./TEMPO_TRICKS_SUMMARY.md) - Common issues
|
|
190
|
+
- [BUG_FIX_SUMMARY.md](./BUG_FIX_SUMMARY.md) - Known bugs & fixes
|
|
191
|
+
- [EMK_TEST_SUITE_README.md](./EMK_TEST_SUITE_README.md#-debugging-failed-tests) - Debugging
|
|
192
|
+
|
|
193
|
+
### For End Users
|
|
194
|
+
|
|
195
|
+
**Getting Started:**
|
|
196
|
+
1. [README.md](./README.md) - Install and basic usage
|
|
197
|
+
2. [DEMO_ENHANCED.md](./DEMO_ENHANCED.md) - Try the demo
|
|
198
|
+
3. [examples/NextJSComponent.tsx](./examples/NextJSComponent.tsx) - Code examples
|
|
199
|
+
|
|
200
|
+
**Understanding Results:**
|
|
201
|
+
- [WHY_DURATION_DECREASES.md](./WHY_DURATION_DECREASES.md) - Why duration changes
|
|
202
|
+
- [EMK_SONGS_INFO.md](./EMK_SONGS_INFO.md) - Song information
|
|
203
|
+
|
|
204
|
+
---
|
|
205
|
+
|
|
206
|
+
## π Statistics
|
|
207
|
+
|
|
208
|
+
### Documentation Coverage
|
|
209
|
+
|
|
210
|
+
- **Total Documents:** 21+ files
|
|
211
|
+
- **API Documentation:** 3 files
|
|
212
|
+
- **Technical Guides:** 7 files
|
|
213
|
+
- **Testing Documentation:** 4 files
|
|
214
|
+
- **Release Notes:** 15+ files
|
|
215
|
+
- **Examples:** 2 files
|
|
216
|
+
|
|
217
|
+
### Lines of Documentation
|
|
218
|
+
|
|
219
|
+
- **README.md:** ~290 lines
|
|
220
|
+
- **Test Suite Docs:** ~1,200 lines
|
|
221
|
+
- **Tempo Guides:** ~500 lines
|
|
222
|
+
- **Release Notes:** ~3,000 lines
|
|
223
|
+
- **Total:** ~5,000+ lines
|
|
224
|
+
|
|
225
|
+
---
|
|
226
|
+
|
|
227
|
+
## π Learning Paths
|
|
228
|
+
|
|
229
|
+
### Path 1: Basic User (15 minutes)
|
|
230
|
+
|
|
231
|
+
1. Read [README.md](./README.md) - Quick Start section
|
|
232
|
+
2. Try the demo: `npm run demo`
|
|
233
|
+
3. Copy example from [examples/NextJSComponent.tsx](./examples/NextJSComponent.tsx)
|
|
234
|
+
|
|
235
|
+
### Path 2: Integration Developer (1 hour)
|
|
236
|
+
|
|
237
|
+
1. [README.md](./README.md) - Full API
|
|
238
|
+
2. [BROWSER_API.md](./BROWSER_API.md) - Client-side API
|
|
239
|
+
3. [EMK_TO_KAR_WORKFLOW.md](./EMK_TO_KAR_WORKFLOW.md) - Workflow
|
|
240
|
+
4. [TEMPO_TRICKS_SUMMARY.md](./TEMPO_TRICKS_SUMMARY.md) - Best practices
|
|
241
|
+
|
|
242
|
+
### Path 3: Library Contributor (3 hours)
|
|
243
|
+
|
|
244
|
+
1. [README.md](./README.md) - Overview
|
|
245
|
+
2. [TEMPO_TRICKS_SUMMARY.md](./TEMPO_TRICKS_SUMMARY.md) - Technical details
|
|
246
|
+
3. [EMK_TEST_SUITE_README.md](./EMK_TEST_SUITE_README.md) - Testing
|
|
247
|
+
4. [RELEASE_v1.5.0.md](./RELEASE_v1.5.0.md) - Recent changes
|
|
248
|
+
5. Source code in `src/`
|
|
249
|
+
|
|
250
|
+
### Path 4: QA Tester (2 hours)
|
|
251
|
+
|
|
252
|
+
1. [EMK_TEST_SUITE_README.md](./EMK_TEST_SUITE_README.md) - Test suite
|
|
253
|
+
2. [EMK_SONGS_INFO.md](./EMK_SONGS_INFO.md) - Expected results
|
|
254
|
+
3. Run: `npm run test:emk`
|
|
255
|
+
4. [TEMPO_TRICKS_SUMMARY.md](./TEMPO_TRICKS_SUMMARY.md) - Debugging
|
|
256
|
+
|
|
257
|
+
---
|
|
258
|
+
|
|
259
|
+
## π Getting Help
|
|
260
|
+
|
|
261
|
+
### If you need to...
|
|
262
|
+
|
|
263
|
+
**Convert a file:**
|
|
264
|
+
β See [README.md](./README.md#emk-to-kar-workflow-complete-pipeline)
|
|
265
|
+
|
|
266
|
+
**Fix tempo issues:**
|
|
267
|
+
β See [TEMPO_TRICKS_SUMMARY.md](./TEMPO_TRICKS_SUMMARY.md#6-common-pitfalls)
|
|
268
|
+
|
|
269
|
+
**Run tests:**
|
|
270
|
+
β See [EMK_TEST_SUITE_README.md](./EMK_TEST_SUITE_README.md#-quick-start)
|
|
271
|
+
|
|
272
|
+
**Understand duration changes:**
|
|
273
|
+
β See [WHY_DURATION_DECREASES.md](./WHY_DURATION_DECREASES.md)
|
|
274
|
+
|
|
275
|
+
**Debug a conversion:**
|
|
276
|
+
β See [EMK_TEST_SUITE_README.md](./EMK_TEST_SUITE_README.md#-debugging-failed-tests)
|
|
277
|
+
|
|
278
|
+
**Use in browser:**
|
|
279
|
+
β See [BROWSER_API.md](./BROWSER_API.md)
|
|
280
|
+
|
|
281
|
+
**Check song info:**
|
|
282
|
+
β See [EMK_SONGS_INFO.md](./EMK_SONGS_INFO.md)
|
|
283
|
+
|
|
284
|
+
---
|
|
285
|
+
|
|
286
|
+
## π Document Status
|
|
287
|
+
|
|
288
|
+
| Document | Status | Last Updated |
|
|
289
|
+
|----------|--------|--------------|
|
|
290
|
+
| README.md | β
Current | 2026-01-13 |
|
|
291
|
+
| TEMPO_TRICKS_SUMMARY.md | β
Current | 2026-01-13 |
|
|
292
|
+
| EMK_TEST_SUITE_README.md | β
Current | 2026-01-13 |
|
|
293
|
+
| EMK_SONGS_INFO.md | β
Current | 2026-01-13 |
|
|
294
|
+
| RELEASE_v1.5.1.md | β
Current | 2026-01-13 |
|
|
295
|
+
| Other docs | β
Current | Various |
|
|
296
|
+
|
|
297
|
+
---
|
|
298
|
+
|
|
299
|
+
## π External Resources
|
|
300
|
+
|
|
301
|
+
### npm Package
|
|
302
|
+
|
|
303
|
+
- **Package:** [@karaplay/file-coder](https://www.npmjs.com/package/@karaplay/file-coder)
|
|
304
|
+
- **Version:** 1.5.1+
|
|
305
|
+
- **License:** ISC
|
|
306
|
+
|
|
307
|
+
### Dependencies
|
|
308
|
+
|
|
309
|
+
- [@tonejs/midi](https://www.npmjs.com/package/@tonejs/midi) - MIDI parsing (recommended)
|
|
310
|
+
- [karaoke-player](https://www.npmjs.com/package/karaoke-player) - KAR playback
|
|
311
|
+
- [iconv-lite](https://www.npmjs.com/package/iconv-lite) - TIS-620 encoding
|
|
312
|
+
|
|
313
|
+
---
|
|
314
|
+
|
|
315
|
+
**Last Updated:** 2026-01-13
|
|
316
|
+
**Maintained by:** @karaplay/file-coder team
|
|
317
|
+
**Status:** β
Complete and Up-to-Date
|