diff --git a/src/lib/chips/nes/NESPreviewRow.svelte b/src/lib/chips/nes/NESPreviewRow.svelte new file mode 100644 index 0000000..9245a8a --- /dev/null +++ b/src/lib/chips/nes/NESPreviewRow.svelte @@ -0,0 +1,408 @@ + + +
+
+ + {#snippet children()} + {#if isPreviewPlaying} + + {:else} + + {/if} + {/snippet} + + Preview playground +
+
+
+ Inst +
+ {instrumentId} +
+
+ + +
+ Note +
noteInputEl?.focus()} + onkeydown={handleNoteKeyDown} + onkeyup={handleNoteKeyUp} + onblur={() => { + if (activeNotes.length > 0) { + lastPlayedNotes = activeNotes.map((n) => n.note); + } + activeNotes = []; + }}> + {activeNotes.length > 0 + ? activeNotes.map((n) => n.note).join(' ') + : lastPlayedNotes.length > 0 + ? lastPlayedNotes.join(' ') + : '—'} +
+
+
+
\ No newline at end of file diff --git a/src/lib/chips/nes/index.ts b/src/lib/chips/nes/index.ts index eb4de0d..9eb8cb1 100644 --- a/src/lib/chips/nes/index.ts +++ b/src/lib/chips/nes/index.ts @@ -1,14 +1,17 @@ -import { NES_CHIP as NES_CHIP_CORE } from './core'; -import NESInstrumentEditor from './NESInstrumentEditor.svelte'; - -export const NES_CHIP = { - ...NES_CHIP_CORE, - instrumentEditor: NESInstrumentEditor -} as const; - -export { NESProcessor } from './processor'; -export { NESConverter } from './adapter'; -export { NESFormatter } from './formatter'; -export { NESChipRenderer } from './renderer'; -export { NESInstrumentEditor }; -export { NES_CHIP_SCHEMA } from './schema'; +import { NES_CHIP as NES_CHIP_CORE } from './core'; +import NESInstrumentEditor from './NESInstrumentEditor.svelte'; +import NESPreviewRow from './NESPreviewRow.svelte'; + +export const NES_CHIP = { + ...NES_CHIP_CORE, + instrumentEditor: NESInstrumentEditor, + previewRow: NESPreviewRow +} as const; + +export { NESProcessor } from './processor'; +export { NESConverter } from './adapter'; +export { NESFormatter } from './formatter'; +export { NESChipRenderer } from './renderer'; +export { NESInstrumentEditor }; +export { NESPreviewRow }; +export { NES_CHIP_SCHEMA } from './schema';