NoteEventOwner
interface NoteEventOwner {
events: readonly NoteEvent[]
addEvent(props?: NoteEventProps): NoteEvent
addEvents(events: readonly Partial<Pick<NoteEvent, 'velocity' | 'chance' | 'pitch' | 'velocityFade' | 'position' | 'duration' | 'cents' | 'playCount' | 'playCurve' | 'repeatLength'>>[]): readonly NoteEvent[]
groupEvents(events: readonly NoteEvent[], mode?: NoteGroupMode): NoteGroup
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, 'velocity' | 'chance' | 'pitch' | 'velocityFade' | 'position' | 'duration' | 'cents' | 'playCount' | 'playCurve' | 'repeatLength'>>[],
): readonly NoteEvent[]
Add many notes at once
Parameters
events(readonly Partial<Pick<NoteEvent, "velocity" | "chance" | "pitch" | "velocityFade" | "position" | "duration" | "cents" | "playCount" | "playCurve" | "repeatLength">>[])
Returns
Example
CODE
region.addEvents([60, 64, 67].map((pitch, index) => ({position: index * PPQN.Quarter, duration: PPQN.Quarter, pitch})))- See:
groupEvents(
events: readonly NoteEvent[],
mode?: NoteGroupMode,
): NoteGroup
Group notes of this region or clip, so they decide their chance together. Notes leave their previous group
Parameters
events(readonly NoteEvent[])mode(NoteGroupMode, optional)
Returns
Example
CODE
const chord = region.addEvents([60, 64, 67].map(pitch => ({pitch, duration: PPQN.Quarter})))
region.groupEvents(chord, "play-all").chance = 50- See:
clearEvents(): void
Remove all notes
Returns
void