Project
interface Project {
name: string
bpm: number
timeSignature: TimeSignature
baseFrequency: number
duration: number
loop: LoopArea
meta: ProjectMeta
groove: GrooveShuffle
output: OutputAudioUnit
audioUnits: readonly AnyAudioUnit[]
instrumentUnits: readonly InstrumentAudioUnit<keyof Instruments>[]
auxUnits: readonly AuxAudioUnit[]
groupUnits: readonly GroupAudioUnit[]
markers: readonly Marker[]
tempoTrack: TempoTrack
signatureTrack: SignatureTrack
modulators: readonly AnyModulator[]
findAudioUnit(label: string): Nullable<AnyAudioUnit>
addInstrumentUnit<K extends keyof Instruments>(key: K, props?: AudioUnitProps, instrument?: DeepPartial<Instruments[K]>): InstrumentAudioUnit<K>
addAuxUnit(props?: BusAudioUnitProps): AuxAudioUnit
addGroupUnit(props?: BusAudioUnitProps): GroupAudioUnit
addMarker(props?: MarkerProps): Marker
addModulator<K extends keyof Modulators>(kind: K, props?: DeepPartial<Modulators[K]>): Modulators[K]
openInStudio(): void
mixdown(options?: MixdownOptions): Promise<AudioData>
}A project under construction or the one open in the studio. Hand it back with Project.openInStudio
Properties
name: string
Project name
bpm: number
Tempo in bpm (30 to 1000)
timeSignature: TimeSignature
Time signature. Assign an object or set its fields
- See:
baseFrequency: number
Tuning reference in Hz (400 to 480, default 440)
duration: number
Project length in PPQN
loop: LoopArea
Loop range
- See:
meta: ProjectMeta
Project metadata
- See:
groove: GrooveShuffle
Global shuffle groove
- See:
output: OutputAudioUnit
Primary output unit
- See:
audioUnits: readonly AnyAudioUnit[]
All units ordered by index
- See:
instrumentUnits: readonly InstrumentAudioUnit<keyof Instruments>[]
Instrument units
auxUnits: readonly AuxAudioUnit[]
Auxiliary (send effect) units
- See:
groupUnits: readonly GroupAudioUnit[]
Group (bus) units
- See:
markers: readonly Marker[]
Timeline markers sorted by position
- See:
tempoTrack: TempoTrack
Tempo automation
- See:
signatureTrack: SignatureTrack
Time signature changes
- See:
modulators: readonly AnyModulator[]
All modulators ordered by index
- See:
Methods
findAudioUnit(label: string): Nullable<AnyAudioUnit>
Find a unit by its label
Parameters
label(string)
Returns
addInstrumentUnit<
K extends keyof Instruments,
>(
key: K,
props?: AudioUnitProps,
instrument?: DeepPartial<Instruments[K]>,
): InstrumentAudioUnit<K>
Add an instrument unit. It comes with one default track matching the instrument.
Type Parameters
Kextendskeyof Instruments
Parameters
key(K) — Instrument typeprops(AudioUnitProps, optional) — Unit settingsinstrument(DeepPartial<Instruments[K]>, optional) — Initial instrument parameters
Returns
Example
const synth = project.addInstrumentUnit("Vaporisateur", {label: "Lead", volume: -6}, {cutoff: 2400, resonance: 0.4})addAuxUnit(props?: BusAudioUnitProps): AuxAudioUnit
Add an auxiliary (send effect) unit
Parameters
props(BusAudioUnitProps, optional)
Returns
- See:
addGroupUnit(props?: BusAudioUnitProps): GroupAudioUnit
Add a group (bus) unit
Parameters
props(BusAudioUnitProps, optional)
Returns
- See:
addMarker(props?: MarkerProps): Marker
Add a marker
Parameters
props(MarkerProps, optional)
Returns
- See:
addModulator<
K extends keyof Modulators,
>(
kind: K,
props?: DeepPartial<Modulators[K]>,
): Modulators[K]
Add a modulator
Type Parameters
Kextendskeyof Modulators
Parameters
kind(K)props(DeepPartial<Modulators[K]>, optional)
Returns
Example
const steps = project.addModulator("Steps", {count: 8, rateSync: 10})
steps.setSteps([1, 0, 0.5, 0, 1, 0, 0.5, 0.25])- See:
openInStudio(): void
Open the project in the studio (replaces the current project). Throws if the project is invalid
Returns
void
mixdown(options?: MixdownOptions): Promise<AudioData>
Render this project (including unapplied edits) to audio. Does not require openInStudio. Throws if the project is invalid
Parameters
options(MixdownOptions, optional)
Returns
Promise<AudioData>
Example
const audio = await project.mixdown()
await openDAW.saveFile(WavFile.encodeFloats(audio), `${project.name}.wav`, "audio/wav")- See: