// Node type definitions for the audio node graph editor // Each node type defines its inputs, outputs, parameters, and HTML template /** * Signal types for node ports * These match the backend SignalType enum */ export const SignalType = { AUDIO: 'audio', // Blue circles MIDI: 'midi', // Green squares CV: 'cv' // Orange diamonds }; /** * Node category for organization in the palette */ export const NodeCategory = { INPUT: 'input', GENERATOR: 'generator', EFFECT: 'effect', UTILITY: 'utility', OUTPUT: 'output' }; /** * Get CSS class for a port based on its signal type */ export function getPortClass(signalType) { return `connector-${signalType}`; } /** * Node type catalog * Maps node type names to their definitions */ export const nodeTypes = { Oscillator: { name: 'Oscillator', category: NodeCategory.GENERATOR, description: 'Oscillator with multiple waveforms and CV modulation', inputs: [ { name: 'V/Oct', type: SignalType.CV, index: 0 }, { name: 'FM', type: SignalType.CV, index: 1 } ], outputs: [ { name: 'Audio', type: SignalType.AUDIO, index: 0 } ], parameters: [ { id: 0, name: 'frequency', label: 'Frequency', min: 20, max: 20000, default: 440, unit: 'Hz' }, { id: 1, name: 'amplitude', label: 'Amplitude', min: 0, max: 1, default: 0.5, unit: '' }, { id: 2, name: 'waveform', label: 'Waveform', min: 0, max: 3, default: 0, unit: '' } ], getHTML: (nodeId) => `
| File | Range | Root | Vel | |
|---|---|---|---|---|
| No layers loaded | ||||