Add test models page and synth presets.

This commit is contained in:
b1rdmania
2025-12-20 12:09:20 +00:00
parent 98e95c1001
commit b7a79e93c9
8 changed files with 900 additions and 75 deletions
+8 -4
View File
@@ -1,4 +1,4 @@
import type { NoteEvent, MotifConfig } from '../types';
import type { NoteEvent, MotifConfig, SynthModel } from '../types';
import { MIDIProcessor } from '../midi/MIDIProcessor';
import { MIDIParser } from '../midi/MIDIParser';
import { MIDIService } from '../services/MIDIService';
@@ -27,13 +27,17 @@ export class MotifEngine {
this.roleMapper = new RoleMapper();
}
async generateFromMIDI(events: NoteEvent[], transformMode: 'passthrough' | 'procedural' = 'passthrough'): Promise<void> {
async generateFromMIDI(
events: NoteEvent[],
transformMode: 'passthrough' | 'procedural' = 'passthrough',
model: SynthModel = 'nes_gb'
): Promise<void> {
// Initialize audio context using shared unlock (iOS compatibility)
if (!this.audioContext) {
this.audioContext = await unlockAudio();
}
this.synthesisEngine = new SynthesisEngine(this.audioContext, this.config);
this.synthesisEngine = new SynthesisEngine(this.audioContext, this.config, model);
if (transformMode === 'passthrough') {
// Direct playback mode - play MIDI as-is without transformations
@@ -107,7 +111,7 @@ export class MotifEngine {
this.audioContext = await unlockAudio();
}
this.synthesisEngine = new SynthesisEngine(this.audioContext, this.config);
this.synthesisEngine = new SynthesisEngine(this.audioContext, this.config, 'nes_gb');
this.synthesisEngine.setupLayers(roleAssignments);
}