action-functions

Differences

This shows you the differences between two versions of the page.

Link to this comparison view

Both sides previous revision Previous revision
Next revision
Previous revision
action-functions [2024/03/10 20:01] steve.wangaction-functions [2024/04/24 17:37] (current) – [midiSequencedRhythm/callMusicSynthesizerRhythm:] steve.wang
Line 5: Line 5:
 **Things To Note:** This tutorial assumes you have already installed Konduktiva successfully using the [[https://github.com/renickbell/konduktiva|Konduktiva installation]] instructions and have read through and understood the [[:first_steps|first steps tutorial]]. The tutorial also assumes 2 things. One, Konduktiva has been assigned to the //K// variable. Two, user created a Musical Environment using the //setUpMusicalEnvironment// function using //K.defaultConfigurationObject// as the first argument and //'exampleMidiPlayer'// as the third argument then, assigned the output to the //e// variable. **Things To Note:** This tutorial assumes you have already installed Konduktiva successfully using the [[https://github.com/renickbell/konduktiva|Konduktiva installation]] instructions and have read through and understood the [[:first_steps|first steps tutorial]]. The tutorial also assumes 2 things. One, Konduktiva has been assigned to the //K// variable. Two, user created a Musical Environment using the //setUpMusicalEnvironment// function using //K.defaultConfigurationObject// as the first argument and //'exampleMidiPlayer'// as the third argument then, assigned the output to the //e// variable.
 <code javascript> <code javascript>
-let K = require('./src/combined.js') +const K = require('konduktiva') 
-let e = K.setUpMusicalEnvironment(K.defaultConfigurationObject,4,'exampleMidiPlayer')+let e = K.setUpMusicalEnvironment(K.defaultConfigurationObject,4,'exampleMidiPlayer', K.exampleMusicalEnvironmentsExtraConfig)
 </code> </code>
  
Line 39: Line 39:
 ==== default: ==== ==== default: ====
 {{ :default-action-funciton-flowchart.svg |}} {{ :default-action-funciton-flowchart.svg |}}
-==== midiSequencedRhythm/callMusicSynthesizerRhythm: ==== 
  
-{{ :midisequencedrhythm-callmusicsynthesizerrhythm--action-function-flowchart.svg |}} 
 ==== sendNotesMidiInfo: ===== ==== sendNotesMidiInfo: =====
  
Line 61: Line 59:
 <code javascript> <code javascript>
 const K = require('konduktiva') const K = require('konduktiva')
-let e = K.setUpMusicalEnvironment(1)+let e = K.setUpMusicalEnvironment(K.defaultConfigurationObject,4,'exampleMidiPlayer', K.exampleMusicalEnvironmentsExtraConfig)
 </code> </code>
  
Line 75: Line 73:
     console.log('Hi this is my new action function called testAction.')     console.log('Hi this is my new action function called testAction.')
     console.log('testAction playerName: ', playerName)     console.log('testAction playerName: ', playerName)
-    console.log('testAction beat: ', b)+    console.log('testAction beat: ', e.currentBeat())
 } }
 </code> </code>
 +
 +Notice we did not use b argument. The b argument is for next onset. To get beat use e.currentBeat().
  
 Next we have to make it so the players in the MusicalEnvironment can use it. To do so, we have the add it to the actions object of the MusicalEnvironment: Next we have to make it so the players in the MusicalEnvironment can use it. To do so, we have the add it to the actions object of the MusicalEnvironment:
  • action-functions.1710126118.txt.gz
  • Last modified: 2024/03/10 20:01
  • by steve.wang