This is an old revision of the document!
Action Functions
Overview: This tutorial will teach you about what actions function do in Konduktiva and how they work.
Things To Note: This tutorial assumes you have already installed Konduktiva successfully using the Konduktiva installation instructions and have read through and understood the first steps tutorial. The tutorial also assumes that you have imported Konduktiva to K variable and assigned any of the example MusicalEnvironments to e.
An Action Function is the function the player calls when the Konduktiva scheduler tells it that it is time to do something. The action function the player uses can be controlled at the variable e.players.playerName.action. It should be a string and the strings refer to a variable which is a function in the e.actions object.
//Code will work if you have imported Konduktiva to K variable and assigned any of the example MusicalEnvironments to e. //View all the actions functions. console.log(e.actions) //View the action function players exampleMidiPlayer1 is using: console.log(e.players.exampleMidiPlayer1.action)
To test if the action function is being triggered you can assign the player to use the default action function and turn on verbose:
e.players.exampleMidiPlayer1.action = 'default' e.players.exampleMidiPlayer1.verbose = true e.play("exampleMidiPlayer1")
And assuming that you have the other maps left configured like the example MusicalEnvironment configured it you should see logging like this:
Hi this is the default action function being triggered This is the session: exampleMidiPlayer1 This is the beat: 1561
If you do not, restart Konduktiva and assign the MusicalEnvironment to e again.