Sample perfect Audioworklet MIDI Scheduler Node
npm i scheduler-node
pnpm add scheduler-node
yarn add scheduler-node
# Clock
# constructor
() # buffer
= ...
# coeff
# internalTime
# offsetFrame
# SchedulerEvent
# constructor
(data) # id
= ...
# midiEvent
= ...
{
# data
# receivedTime
}
# toJSON
()
toJSON () =>
{
# id
= ...
# midiEvent
= ...
{
# data
= ...
# receivedTime
= ...
}
}
# SchedulerEventGroup
# constructor
(eventGroup)
# new SchedulerEventGroup
()
# id
= ...
# loopPoints
= ...
# onRequestNotes
# (turn, total)
# turn
# total
(turn, total) =>
# scheduler
# targets
= ...
# loop
# loopEnd
# loopStart
# setMidiEvents
(turnEvents, turn, clear)
# turnEvents
# turn
= 0
# clear
setMidiEvents (turnEvents, turn, clear) =>
# setNotes
(turnNotes, turn, clear)
# turnNotes
# turn
= 0
# clear
setNotes (turnNotes, turn, clear) =>
# toJSON
()
toJSON () =>
{
# id
= ...
# loopPoints
= ...
# targets
= ...
}
# SchedulerEventGroupNode
# constructor
(schedulerNode)
# new SchedulerEventGroupNode
()
# eventGroup
= ...
# onconnectchange
# schedulerNode
# targetNodes
= ...
# clear
() # connect
(targetNode)
# targetNode
connect (targetNode) =>
# destroy
() # disconnect
(targetNode) # resume
(targetNode)
# targetNode
resume (targetNode) =>
# suspend
(targetNode)
# targetNode
suspend (targetNode) =>
# SchedulerNode
# constructor
(context) # context
# eventGroups
= ...
# node
# targetNodes
= ...
# worklet
# addEventGroup
(eventGroup) # connect
(targetNode)
# targetNode
connect (targetNode) =>
# disconnect
(targetNode) # removeEventGroup
(eventGroup) # requestNextEvents
(eventGroupId, turn, total)
# eventGroupId
# turn
= 0
# total
= 4
requestNextEvents (eventGroupId, turn, total) =>
# setBpm
(bpm) # setClockBuffer
(clockBuffer) # start
(playbackStartTime, offsetStartTime)
# playbackStartTime
# offsetStartTime
start (playbackStartTime, offsetStartTime) =>
# stop
() # create
(context)
# context
create (context) =>
# register
(context)
# context
register (context) =>
# SchedulerTarget
# constructor
(data) # id
= ...
# midiQueue
= ...
# SchedulerTargetNode
# constructor
(context, name, options)
# new SchedulerTargetNode
()
# id
= ...
# schedulerTarget
= ...
# worklet
# init
() # processMidiEvent
(midiEvent)
# SchedulerSyncedSetPayload
# LoopKind
# LoopKind
= ...
{
# Live
= 2
# Loop
= 1
# Once
= 0
}
Fork or edit and submit a PR.
All contributions are welcome!
MIT © 2023 stagas