creating-players

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
creating-players [2024/02/29 18:29] steve.wangcreating-players [2024/03/18 20:22] (current) – [Example] steve.wang
Line 3: Line 3:
 **Overview: ** This tutorial will teach you how to create your own players like the ones that came with the example MusicalEnvironment. **Overview: ** This tutorial will teach you how to create your own players like the ones that came with the example MusicalEnvironment.
  
-**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 that you have imported Konduktiva to the //K// variable and assigned any of the example MusicalEnvironments 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> 
 +const K = require('konduktiva'
 +let e = K.setUpMusicalEnvironment(K.defaultConfigurationObject,4,'exampleMidiPlayer', K.exampleMusicalEnvironmentsExtraConfig) 
 +</code>
  
  
Line 130: Line 134:
 //K.simpleMelodyDataTemplate is a simple template of a configuration object //K.simpleMelodyDataTemplate is a simple template of a configuration object
 simpleMelodyData.velocity = [100, 100, 100, 100] simpleMelodyData.velocity = [100, 100, 100, 100]
-simpleMelodyData.rhythmMap = [1, 234]+simpleMelodyData.rhythmMap = [1, 111]
 simpleMelodyData.noteValues = [[1], [2], [3], [4]] simpleMelodyData.noteValues = [[1], [2], [3], [4]]
 simpleMelodyData.rootMap = [ 'C', 'C', 'C', 'C' ] simpleMelodyData.rootMap = [ 'C', 'C', 'C', 'C' ]
  
 //Add it to MuiscalEnvironment: //Add it to MuiscalEnvironment:
-recordConfigurationDataIntoMusicalEnvironment(simpleMelodyData, 'p1', e)+K.recordConfigurationDataIntoMusicalEnvironment(simpleMelodyData, 'p1', e)
 </code> </code>
  
Line 166: Line 170:
 //K.simpleMelodyDataTemplate is a simple template of a configuration object //K.simpleMelodyDataTemplate is a simple template of a configuration object
 simpleMelodyData.velocity = [100, 100, 100, 100] simpleMelodyData.velocity = [100, 100, 100, 100]
-simpleMelodyData.rhythmMap = [1, 234]+simpleMelodyData.rhythmMap = [1, 111]
 simpleMelodyData.noteValues = [[1], [2], [3], [4]] simpleMelodyData.noteValues = [[1], [2], [3], [4]]
 simpleMelodyData.rootMap = [ 'C', 'C', 'C', 'C' ] simpleMelodyData.rootMap = [ 'C', 'C', 'C', 'C' ]
Line 178: Line 182:
 //make or modify player to use info: //make or modify player to use info:
 K.assignPlayerForMusicSynthesizerMidiOutput(e, 'p1','exampleMidiPlayer1') K.assignPlayerForMusicSynthesizerMidiOutput(e, 'p1','exampleMidiPlayer1')
 +//configure legatoMap:
 +e.players.exampleMidiPlayer1.legatoMap = 'default'
  
 //signal to player to start playing: //signal to player to start playing:
  • creating-players.1709260199.txt.gz
  • Last modified: 2024/02/29 18:29
  • by steve.wang