custom-actions

This is an old revision of the document!


How to write an action function

include arguments for player and current beat

(player,beat) ⇒ {do something here}

(player,beat) ⇒ {myAction()}

store them in the actions property of the MusicalEnvironment as a key with the action name and the function as the value.

e.addAction('actionName',action function)

Because JavaScript is single threaded, a computationally heavy action function could block the next events, and that's especially weird for events that are supposed to be simultaneous or temporally near.

needs a WebSocket tutorial

  • custom-actions.1673250720.txt.gz
  • Last modified: 2023/01/08 23:52
  • by renick