Ecosyste.ms: Awesome
An open API service indexing awesome lists of open source software.
https://github.com/stagas/scheduler-node
Sample perfect Audioworklet MIDI Scheduler Node
https://github.com/stagas/scheduler-node
Last synced: 13 days ago
JSON representation
Sample perfect Audioworklet MIDI Scheduler Node
- Host: GitHub
- URL: https://github.com/stagas/scheduler-node
- Owner: stagas
- License: mit
- Created: 2022-04-25T17:42:05.000Z (over 2 years ago)
- Default Branch: main
- Last Pushed: 2023-02-28T06:39:33.000Z (over 1 year ago)
- Last Synced: 2024-10-15T06:01:55.922Z (29 days ago)
- Language: TypeScript
- Size: 112 KB
- Stars: 4
- Watchers: 2
- Forks: 0
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
- License: LICENSE
Awesome Lists containing this project
README
#
scheduler-nodeSample perfect Audioworklet MIDI Scheduler Node
npm i scheduler-node
pnpm add scheduler-node
yarn add scheduler-node
## API
#
Clock
SchedulerEvent
# constructor
(data)
# new SchedulerEvent
()
# data
= {}
Partial<SchedulerEvent>
id
= ...
string
midiEvent
= ...
toJSON
()
toJSON() =>
SchedulerEventGroup
# constructor
(eventGroup)
# new SchedulerEventGroup
()
# eventGroup
= {}
Partial<SchedulerEventGroup>
id
= ...
string
loopPoints
= ...
Float64Array
onRequestNotes
scheduler
# targets
= ...
ImmSet<SchedulerTarget>
loop
loopEnd
loopStart
setMidiEvents
(turnEvents, turn, clear) # turnEvents
MIDIMessageEvent [] []
turn
= 0
number
clear
boolean
setMidiEvents(turnEvents, turn, clear) =>
MIDIMessageEvent [] []
setNotes
(turnNotes, turn, clear) # turnNotes
NoteEvent [] []
turn
= 0
number
clear
boolean
setNotes(turnNotes, turn, clear) =>
MIDIMessageEvent [] []
toJSON
()
toJSON() =>
- {
# id
= ...
string
loopPoints
= ...
Float64Array
targets
= ...
ImmSet<SchedulerTarget>
SchedulerEventGroupNode
# constructor
(schedulerNode)
eventGroup
= ...
# onconnectchange
schedulerNode
# targetNodes
= ...
Set<SchedulerTargetNode>
clear
()
clear() =>
- void
connect
(targetNode) # targetNode
connect(targetNode) =>
destroy
()
destroy() =>
- void
disconnect
(targetNode) # targetNode
disconnect(targetNode) =>
- void
resume
(targetNode) # targetNode
resume(targetNode) =>
- void
suspend
(targetNode) # targetNode
suspend(targetNode) =>
- void
SchedulerNode
# constructor
(context)
context
BaseAudioContext
eventGroups
= ...
SyncedSet<SchedulerEventGroup, SchedulerSyncedSetPayload>
node
AudioWorkletNode
targetNodes
= ...
Set<SchedulerTargetNode>
worklet
Agent<SchedulerProcessor, SchedulerNode>
addEventGroup
(eventGroup) # eventGroup
addEventGroup(eventGroup) =>
connect
(targetNode) # targetNode
connect(targetNode) =>
disconnect
(targetNode) # targetNode
disconnect(targetNode) =>
- void
removeEventGroup
(eventGroup) # eventGroup
removeEventGroup(eventGroup) =>
- void
requestNextEvents
(eventGroupId, turn, total) # eventGroupId
string
turn
= 0
number
total
= 4
number
requestNextEvents(eventGroupId, turn, total) =>
- void
setBpm
(bpm) # bpm
number
setBpm(bpm) =>
- void
setClockBuffer
(clockBuffer) # clockBuffer
Float64Array
setClockBuffer(clockBuffer) =>
- void
start
(playbackStartTime, offsetStartTime) # playbackStartTime
number
offsetStartTime
number
start(playbackStartTime, offsetStartTime) =>
- void
stop
()
stop() =>
- void
create
(context) # context
BaseAudioContext
create(context) =>
Promise<SchedulerNode>
register
(context) # context
BaseAudioContext
register(context) =>
Promise<void>
SchedulerTarget
# constructor
(data)
# new SchedulerTarget
()
# data
= {}
Partial<SchedulerTarget>
id
= ...
string
midiQueue
= ...
MessageQueue
SchedulerTargetNode
# constructor
(context, name, options)
# new SchedulerTargetNode
()
id
= ...
string
schedulerTarget
= ...
# worklet
Agent<SchedulerTargetProcessor, SchedulerTargetNode>
init
()
init() =>
Promise<void>
processMidiEvent
(midiEvent) # midiEvent
MIDIMessageEvent
processMidiEvent(midiEvent) =>
- void
SchedulerSyncedSetPayload
# targets
ImmSet<SchedulerTarget>
LoopKind
ValuesOf<typeof LoopKind>
LoopKind
= ...
## Credits
- [alice-bob](https://npmjs.org/package/alice-bob) by [stagas](https://github.com/stagas) – transport agnostic strongly typed duplex rpc interfaces
- [event-toolkit](https://npmjs.org/package/event-toolkit) by [stagas](https://github.com/stagas) – Toolkit for DOM events.
- [everyday-types](https://npmjs.org/package/everyday-types) by [stagas](https://github.com/stagas) – Everyday utility types
- [everyday-utils](https://npmjs.org/package/everyday-utils) by [stagas](https://github.com/stagas) – Everyday utilities
- [immutable-map-set](https://npmjs.org/package/immutable-map-set) by [stagas](https://github.com/stagas) – Immutable Map and Set objects
- [json-objectify](https://npmjs.org/package/json-objectify) by [stagas](https://github.com/stagas) – Like JSON.stringify but without the stringify part.
- [serialize-whatever](https://npmjs.org/package/serialize-whatever) by [stagas](https://github.com/stagas) – Serialize and deserialize whatever.
- [synced-set](https://npmjs.org/package/synced-set) by [stagas](https://github.com/stagas) – Synchronize a Set collection of objects across a wire.
- [webaudio-tools](https://npmjs.org/package/webaudio-tools) by [stagas](https://github.com/stagas) – Useful tools for WebAudio.
## Contributing
[Fork](https://github.com/stagas/scheduler-node/fork) or [edit](https://github.dev/stagas/scheduler-node) and submit a PR.
All contributions are welcome!
## License
MIT © 2023 [stagas](https://github.com/stagas)