Ecosyste.ms: Awesome

An open API service indexing awesome lists of open source software.

Awesome Lists | Featured Topics | Projects

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

Awesome Lists containing this project

README

        


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 # targetNodes  =  ... # clear()


    clear()  =>


      void
# connect(targetNode) # destroy()


    destroy()  =>


      void
# disconnect(targetNode) # resume(targetNode) # suspend(targetNode) # SchedulerNode # 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
- [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)