disable unused param check for building; updated version number; avoid relying on constructor.name to determine class type due to class name mangling.
This commit is contained in:
Generated
+4
-4
@@ -1,12 +1,12 @@
|
|||||||
{
|
{
|
||||||
"name": "kgsp",
|
"name": "K.G.Studio",
|
||||||
"version": "0.0.0",
|
"version": "0.5.0",
|
||||||
"lockfileVersion": 3,
|
"lockfileVersion": 3,
|
||||||
"requires": true,
|
"requires": true,
|
||||||
"packages": {
|
"packages": {
|
||||||
"": {
|
"": {
|
||||||
"name": "kgsp",
|
"name": "K.G.Studio",
|
||||||
"version": "0.0.0",
|
"version": "0.5.0",
|
||||||
"dependencies": {
|
"dependencies": {
|
||||||
"class-transformer": "^0.5.1",
|
"class-transformer": "^0.5.1",
|
||||||
"idb": "^8.0.3",
|
"idb": "^8.0.3",
|
||||||
|
|||||||
+2
-2
@@ -1,7 +1,7 @@
|
|||||||
{
|
{
|
||||||
"name": "kgsp",
|
"name": "K.G.Studio",
|
||||||
"private": true,
|
"private": true,
|
||||||
"version": "0.0.0",
|
"version": "0.5.0",
|
||||||
"type": "module",
|
"type": "module",
|
||||||
"scripts": {
|
"scripts": {
|
||||||
"dev": "vite",
|
"dev": "vite",
|
||||||
|
|||||||
@@ -230,6 +230,8 @@ export class KGAudioInterface {
|
|||||||
// Clear any existing scheduled events
|
// Clear any existing scheduled events
|
||||||
this.clearScheduledEvents();
|
this.clearScheduledEvents();
|
||||||
|
|
||||||
|
console.log("Preparing playback");
|
||||||
|
|
||||||
try {
|
try {
|
||||||
// Set project BPM and time signature FIRST (this affects timing calculations)
|
// Set project BPM and time signature FIRST (this affects timing calculations)
|
||||||
Tone.Transport.bpm.value = project.getBpm();
|
Tone.Transport.bpm.value = project.getBpm();
|
||||||
@@ -246,9 +248,13 @@ export class KGAudioInterface {
|
|||||||
const trackId = track.getId().toString();
|
const trackId = track.getId().toString();
|
||||||
const audioBus = this.trackAudioBuses.get(trackId);
|
const audioBus = this.trackAudioBuses.get(trackId);
|
||||||
|
|
||||||
|
console.log(`Track ${trackId} has audio bus: ${audioBus ? 'true' : 'false'}; type: ${track.getType()}`);
|
||||||
|
|
||||||
if (audioBus && track.getType() === 'MIDI') {
|
if (audioBus && track.getType() === 'MIDI') {
|
||||||
track.getRegions().forEach(region => {
|
track.getRegions().forEach(region => {
|
||||||
if (region.constructor.name === 'KGMidiRegion') {
|
console.log(`Region ${region.getId().toString()}: type: ${region.getCurrentType()}`);
|
||||||
|
|
||||||
|
if (region.getCurrentType() === 'KGMidiRegion') {
|
||||||
const midiRegion = region as unknown as { getNotes: () => KGMidiNote[] };
|
const midiRegion = region as unknown as { getNotes: () => KGMidiNote[] };
|
||||||
|
|
||||||
// Get notes from region (assuming it has a getNotes method)
|
// Get notes from region (assuming it has a getNotes method)
|
||||||
|
|||||||
@@ -35,7 +35,7 @@ export class RemoveTrackCommand extends KGCommand {
|
|||||||
this.originalTrackIndex = trackToRemove.getTrackIndex();
|
this.originalTrackIndex = trackToRemove.getTrackIndex();
|
||||||
|
|
||||||
// Store instrument if it's a MIDI track
|
// Store instrument if it's a MIDI track
|
||||||
if (trackToRemove.constructor.name === 'KGMidiTrack' && 'getInstrument' in trackToRemove) {
|
if (trackToRemove.getCurrentType() === 'KGMidiTrack' && 'getInstrument' in trackToRemove) {
|
||||||
this.originalInstrument = (trackToRemove as KGMidiTrack).getInstrument();
|
this.originalInstrument = (trackToRemove as KGMidiTrack).getInstrument();
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
@@ -313,7 +313,7 @@ export const useProjectStore = create<ProjectState>((set, get) => {
|
|||||||
|
|
||||||
// Type guard to check if track is KGMidiTrack
|
// Type guard to check if track is KGMidiTrack
|
||||||
const isMidiTrack = (track: KGTrack): track is KGMidiTrack => {
|
const isMidiTrack = (track: KGTrack): track is KGMidiTrack => {
|
||||||
return track.constructor.name === 'KGMidiTrack' && 'getInstrument' in track;
|
return track.getCurrentType() === 'KGMidiTrack' && 'getInstrument' in track;
|
||||||
};
|
};
|
||||||
|
|
||||||
// Check if instrument changed (only for MIDI tracks)
|
// Check if instrument changed (only for MIDI tracks)
|
||||||
@@ -455,7 +455,7 @@ export const useProjectStore = create<ProjectState>((set, get) => {
|
|||||||
const trackId = track.getId().toString();
|
const trackId = track.getId().toString();
|
||||||
// Get instrument from track model if it's a MIDI track
|
// Get instrument from track model if it's a MIDI track
|
||||||
let instrument: InstrumentType = 'acoustic_grand_piano'; // Default fallback
|
let instrument: InstrumentType = 'acoustic_grand_piano'; // Default fallback
|
||||||
if (track.constructor.name === 'KGMidiTrack' && 'getInstrument' in track) {
|
if (track.getCurrentType() === 'KGMidiTrack' && 'getInstrument' in track) {
|
||||||
instrument = (track as KGMidiTrack).getInstrument();
|
instrument = (track as KGMidiTrack).getInstrument();
|
||||||
}
|
}
|
||||||
audioInterface.createTrackSynth(trackId, instrument);
|
audioInterface.createTrackSynth(trackId, instrument);
|
||||||
|
|||||||
+2
-2
@@ -21,8 +21,8 @@
|
|||||||
|
|
||||||
/* Linting */
|
/* Linting */
|
||||||
"strict": true,
|
"strict": true,
|
||||||
"noUnusedLocals": true,
|
"noUnusedLocals": false,
|
||||||
"noUnusedParameters": true,
|
"noUnusedParameters": false,
|
||||||
"erasableSyntaxOnly": false,
|
"erasableSyntaxOnly": false,
|
||||||
"noFallthroughCasesInSwitch": true,
|
"noFallthroughCasesInSwitch": true,
|
||||||
"noUncheckedSideEffectImports": true
|
"noUncheckedSideEffectImports": true
|
||||||
|
|||||||
Reference in New Issue
Block a user