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/18 20:23] steve.wangaction-functions [2024/04/24 17:37] (current) – [midiSequencedRhythm/callMusicSynthesizerRhythm:] steve.wang
Line 7: Line 7:
 const K = require('konduktiva') const K = require('konduktiva')
 let e = K.setUpMusicalEnvironment(K.defaultConfigurationObject,4,'exampleMidiPlayer', K.exampleMusicalEnvironmentsExtraConfig) let e = K.setUpMusicalEnvironment(K.defaultConfigurationObject,4,'exampleMidiPlayer', K.exampleMusicalEnvironmentsExtraConfig)
- 
 </code> </code>
  
Line 40: 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 62: 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 76: 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.1710818631.txt.gz
  • Last modified: 2024/03/18 20:23
  • by steve.wang