+
+ setSelection({ kind: "source" })}
+ />
+ {(patch?.source?.oscillators ?? []).map((osc: any, index: number) => (
+ setSelection({ kind: "oscillator", index })}
+ drag={
+ document?.editableStructure.oscillators && !controlsDisabled
+ ? {
+ group: "oscillator",
+ index,
+ onMove: (from, to) => edit({ type: "moveOscillator", from, to }),
+ }
+ : undefined
+ }
+ actions={
+ document?.editableStructure.oscillators ? (
+ 1}
+ index={index}
+ count={patch.source.oscillators.length}
+ onMove={(to) => edit({ type: "moveOscillator", from: index, to })}
+ onRemove={() => edit({ type: "removeOscillator", index })}
+ />
+ ) : null
+ }
+ />
+ ))}
+
+ {patch?.source?.filter && (
+
setSelection({ kind: "filter" })}
+ actions={
+ <>
+ {patch.source.filter.cutoffLfo && (
+ {
+ event.stopPropagation();
+ setSelection({ kind: "lfo" });
+ }}
+ >
+ LFO
+
+ )}
+ {patch.source.filter.cutoffLfo && document?.editableStructure.cutoffLfo && (
+ {
+ event.stopPropagation();
+ edit({ type: "removeCutoffLfo" });
+ }}
+ >
+ − LFO
+
+ )}
+ {document?.editableStructure.filter && (
+ {
+ event.stopPropagation();
+ edit({ type: "removeFilter" });
+ }}
+ >
+ Remove
+
+ )}
+ >
+ }
+ />
+ )}
setSelection({ kind: "source" })}
+ connector
+ title="Envelope"
+ detail="Amplitude"
+ selected={selection.kind === "envelope"}
+ onClick={() => setSelection({ kind: "envelope" })}
/>
- {(patch?.source?.oscillators ?? []).map((osc: any, index: number) => (
+ {(patch?.effects ?? []).map((effect: any, index: number) => (
setSelection({ kind: "oscillator", index })}
+ connector
+ key={`effect-${index}`}
+ title={effect.type === "saturator" ? "Saturator" : "Stereo delay"}
+ detail={`Effect ${index + 1}`}
+ selected={selection.kind === "effect" && selection.index === index}
+ onClick={() => setSelection({ kind: "effect", index })}
drag={
- document?.editableStructure.oscillators && !busy
+ document?.editableStructure.effects && !controlsDisabled
? {
- group: "oscillator",
+ group: "effect",
index,
- onMove: (from, to) => edit({ type: "moveOscillator", from, to }),
+ onMove: (from, to) => edit({ type: "moveEffect", from, to }),
}
: undefined
}
actions={
- document?.editableStructure.oscillators ? (
+ document?.editableStructure.effects ? (
1}
+ label={`Effect ${index + 1}`}
+ disabled={controlsDisabled}
+ canRemove
index={index}
- count={patch.source.oscillators.length}
- onMove={(to) => edit({ type: "moveOscillator", from: index, to })}
- onRemove={() => edit({ type: "removeOscillator", index })}
+ count={patch.effects.length}
+ onMove={(to) => edit({ type: "moveEffect", from: index, to })}
+ onRemove={() => edit({ type: "removeEffect", index })}
/>
) : null
}
/>
))}
-