scheduler-node

Sample perfect Audioworklet MIDI Scheduler Node


License
MIT
Install
npm install scheduler-node@2.0.1

Documentation

scheduler-node

Sample perfect Audioworklet MIDI Scheduler Node

npm i scheduler-node pnpm add scheduler-node yarn add scheduler-node

API

# Clock

    # constructor()
    # buffer  =  ...

      Float64Array

    # coeff
    # internalTime
    # offsetFrame

# SchedulerEvent

    # constructor(data)
    # id  =  ...

      string

    # midiEvent  =  ...

      {

      # data

        Uint8Array

      # receivedTime

        number

      }

    # toJSON()

      toJSON()  =>

        {

        # id  =  ...

          string

        # midiEvent  =  ...

          {

          # data  =  ...

            Uint8Array

          # receivedTime  =  ...

            number

          }

        }

# SchedulerEventGroup

    # constructor(eventGroup)
    # id  =  ...

      string

    # loopPoints  =  ...

      Float64Array

    # onRequestNotes

      # (turn, total)

        # turn

          number

        # total

          number

        (turn, total)  =>

          void

    # scheduler
    # targets  =  ...
    # 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  =  ...

        }

# SchedulerEventGroupNode
# SchedulerNode

    # constructor(context)
    # context

      BaseAudioContext

    # eventGroups  =  ...
    # node

      AudioWorkletNode

    # targetNodes  =  ...
    # worklet
    # addEventGroup(eventGroup)
    # connect(targetNode)
    # disconnect(targetNode)
    # removeEventGroup(eventGroup)
    # 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)  =>

    # register(context)

      # context

        BaseAudioContext

      register(context)  =>

        Promise<void>

# SchedulerTarget
# SchedulerTargetNode

    # constructor(context, name, options)

      # new SchedulerTargetNode()

    # id  =  ...

      string

    # schedulerTarget  =  ...
    # worklet
    # init()

      init()  =>

        Promise<void>

    # processMidiEvent(midiEvent)

      # midiEvent

        MIDIMessageEvent

      processMidiEvent(midiEvent)  =>

        void

# SchedulerSyncedSetPayload
# LoopKind
# LoopKind  =  ...

    {

    # Live  =  2

      2

    # Loop  =  1

      1

    # Once  =  0

      0

    }

Credits

Contributing

Fork or edit and submit a PR.

All contributions are welcome!

License

MIT © 2023 stagas