NoteEventOwner

interface NoteEventOwner { events: readonly NoteEvent[] addEvent(props?: NoteEventProps): NoteEvent addEvents(events: readonly Partial<Pick<NoteEvent, 'pitch' | 'position' | 'duration' | 'velocity' | 'cents' | 'playCount' | 'playCurve' | 'chance'>>[]): readonly NoteEvent[] clearEvents(): void }

Common surface of note regions and clips


Properties

events: readonly NoteEvent[]

readonly

All notes sorted by position

Methods

addEvent(props?: NoteEventProps): NoteEvent

Add a note (defaults: position 0, duration 1/16, pitch 60, velocity 100/127)

Parameters

Returns

addEvents( events: readonly Partial<Pick<NoteEvent, 'pitch' | 'position' | 'duration' | 'velocity' | 'cents' | 'playCount' | 'playCurve' | 'chance'>>[], ): readonly NoteEvent[]

Add many notes at once

Parameters

Returns

Example

CODE
region.addEvents([60, 64, 67].map((pitch, index) => ({position: index * PPQN.Quarter, duration: PPQN.Quarter, pitch})))

clearEvents(): void

Remove all notes

Returns

  • void