NoteRegion
interface NoteRegion extends LoopableRegion, NoteEventOwner {
uuid: string
position: number
duration: number
complete: number
mute: boolean
label: string
hue: number
loopDuration: number
loopOffset: number
events: readonly NoteEvent[]
track: NoteTrack
remove(): void
addEvent(props?: NoteEventProps): NoteEvent
addEvents(events: readonly Partial<Pick<NoteEvent, 'pitch' | 'position' | 'duration' | 'velocity' | 'cents' | 'playCount' | 'playCurve' | 'chance'>>[]): readonly NoteEvent[]
clearEvents(): void
}Region holding notes
Hierarchy
Properties
uuid: string
Inherited from uuid
Unique id
position: number
Inherited from position
Start position in PPQN
duration: number
Inherited from duration
Length in PPQN (seconds for non-synced audio regions)
complete: number
Inherited from complete
End position (position + duration)
mute: boolean
Inherited from mute
Mute the region
label: string
Inherited from label
Custom label
hue: number
Inherited from hue
Color hue (0 to 360)
loopDuration: number
Inherited from loopDuration
Loop cycle length in PPQN (seconds for non-synced audio regions)
loopOffset: number
Inherited from loopOffset
Loop start offset in PPQN (seconds for non-synced audio regions)
events: readonly NoteEvent[]
Inherited from events
All notes sorted by position
track: NoteTrack
The note track this region belongs to
- See:
Methods
remove(): void
Inherited from remove
Remove the region
Returns
void
addEvent(props?: NoteEventProps): NoteEvent
Inherited from addEvent
Add a note (defaults: position 0, duration 1/16, pitch 60, velocity 100/127)
Parameters
props(NoteEventProps, optional)
Returns
addEvents(
events: readonly Partial<Pick<NoteEvent, 'pitch' | 'position' | 'duration' | 'velocity' | 'cents' | 'playCount' | 'playCurve' | 'chance'>>[],
): readonly NoteEvent[]
Inherited from addEvents
Add many notes at once
Parameters
events(readonly Partial<Pick<NoteEvent, "pitch" | "position" | "duration" | "velocity" | "cents" | "playCount" | "playCurve" | "chance">>[])
Returns
Example
region.addEvents([60, 64, 67].map((pitch, index) => ({position: index * PPQN.Quarter, duration: PPQN.Quarter, pitch})))clearEvents(): void
Inherited from clearEvents
Remove all notes
Returns
void