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
- See:
Methods
addEvent(props?: NoteEventProps): NoteEvent
Add a note (defaults: position 0, duration 1/16, pitch 60, velocity 100/127)
Parameters
props(NoteEventProps, optional)
Returns
- See:
addEvents(
events: readonly Partial<Pick<NoteEvent, 'pitch' | 'position' | 'duration' | 'velocity' | 'cents' | 'playCount' | 'playCurve' | 'chance'>>[],
): readonly NoteEvent[]
Add many notes at once
Parameters
events(readonly Partial<Pick<NoteEvent, "pitch" | "position" | "duration" | "velocity" | "cents" | "playCount" | "playCurve" | "chance">>[])
Returns
Example
CODE
region.addEvents([60, 64, 67].map((pitch, index) => ({position: index * PPQN.Quarter, duration: PPQN.Quarter, pitch})))- See:
clearEvents(): void
Remove all notes
Returns
void