Improve MIDI search and add browser playback engines.
This commit is contained in:
@@ -1,4 +1,4 @@
|
||||
import type { NoteEvent, StructuralFeatures, MotifConfig, SynthLayer } from '../types';
|
||||
import type { NoteEvent, StructuralFeatures, MotifConfig } from '../types';
|
||||
import { MIDIProcessor } from '../midi/MIDIProcessor';
|
||||
import { MIDIParser } from '../midi/MIDIParser';
|
||||
import { MIDIService } from '../services/MIDIService';
|
||||
@@ -106,6 +106,12 @@ export class MotifEngine {
|
||||
}
|
||||
}
|
||||
|
||||
setVolume(volume: number): void {
|
||||
if (this.synthesisEngine) {
|
||||
this.synthesisEngine.setVolume(volume);
|
||||
}
|
||||
}
|
||||
|
||||
private generateSyntheticMIDI(songName: string): NoteEvent[] {
|
||||
// Generate procedural MIDI based on song name hash
|
||||
const hash = this.simpleHash(songName);
|
||||
|
||||
@@ -76,7 +76,7 @@ export class RoleMapper {
|
||||
};
|
||||
}
|
||||
|
||||
private calculateRoleScores(features: TrackFeatures, globalFeatures: StructuralFeatures): Map<Role, number> {
|
||||
private calculateRoleScores(features: TrackFeatures, _globalFeatures: StructuralFeatures): Map<Role, number> {
|
||||
const scores = new Map<Role, number>();
|
||||
|
||||
// Bass scoring
|
||||
@@ -130,7 +130,7 @@ export class RoleMapper {
|
||||
return scores;
|
||||
}
|
||||
|
||||
private allocateRoles(roleScores: Map<number, Map<Role, number>>, trackEvents: Map<number, NoteEvent[]>): Map<number, Role> {
|
||||
private allocateRoles(roleScores: Map<number, Map<Role, number>>, _trackEvents: Map<number, NoteEvent[]>): Map<number, Role> {
|
||||
const assignments = new Map<number, Role>();
|
||||
const assignedRoles = new Set<Role>();
|
||||
|
||||
|
||||
Reference in New Issue
Block a user