Differences
This shows you the differences between two versions of the page.
| Both sides previous revision Previous revision Next revision | Previous revision | ||
| creating-players [2024/02/29 16:50] – steve.wang | creating-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:// | + | **Things To Note:** This tutorial assumes you have already installed Konduktiva successfully using the [[https:// |
| + | <code javascript> | ||
| + | const K = require(' | ||
| + | let e = K.setUpMusicalEnvironment(K.defaultConfigurationObject, | ||
| + | </ | ||
| Line 115: | Line 119: | ||
| </ | </ | ||
| - | ==== Parameters | + | ==== Parameters |
| === noteValueData === | === noteValueData === | ||
| The configuration object. | The configuration object. | ||
| Line 128: | Line 132: | ||
| //Create configuration object: | //Create configuration object: | ||
| let simpleMelodyData = K.R.clone(K.simpleMelodyDataTemplate) | let simpleMelodyData = K.R.clone(K.simpleMelodyDataTemplate) | ||
| + | // | ||
| simpleMelodyData.velocity = [100, 100, 100, 100] | simpleMelodyData.velocity = [100, 100, 100, 100] | ||
| - | simpleMelodyData.rhythmMap = [1, 2, 3, 4] | + | simpleMelodyData.rhythmMap = [1, 1, 1, 1] |
| simpleMelodyData.noteValues = [[1], [2], [3], [4]] | simpleMelodyData.noteValues = [[1], [2], [3], [4]] | ||
| simpleMelodyData.rootMap = [ ' | simpleMelodyData.rootMap = [ ' | ||
| //Add it to MuiscalEnvironment: | //Add it to MuiscalEnvironment: | ||
| - | recordConfigurationDataIntoMusicalEnvironment(simpleMelodyData, | + | K.recordConfigurationDataIntoMusicalEnvironment(simpleMelodyData, |
| </ | </ | ||
| Line 163: | Line 168: | ||
| //Create configuration object: | //Create configuration object: | ||
| let simpleMelodyData = K.R.clone(K.simpleMelodyDataTemplate) | let simpleMelodyData = K.R.clone(K.simpleMelodyDataTemplate) | ||
| + | // | ||
| simpleMelodyData.velocity = [100, 100, 100, 100] | simpleMelodyData.velocity = [100, 100, 100, 100] | ||
| - | simpleMelodyData.rhythmMap = [1, 2, 3, 4] | + | simpleMelodyData.rhythmMap = [1, 1, 1, 1] |
| simpleMelodyData.noteValues = [[1], [2], [3], [4]] | simpleMelodyData.noteValues = [[1], [2], [3], [4]] | ||
| simpleMelodyData.rootMap = [ ' | simpleMelodyData.rootMap = [ ' | ||
| Line 174: | Line 180: | ||
| New example starts here: | New example starts here: | ||
| <code javascript> | <code javascript> | ||
| + | //make or modify player to use info: | ||
| + | K.assignPlayerForMusicSynthesizerMidiOutput(e, | ||
| + | //configure legatoMap: | ||
| + | e.players.exampleMidiPlayer1.legatoMap = ' | ||
| + | |||
| + | //signal to player to start playing: | ||
| + | e.play(' | ||
| + | </ | ||
| + | |||
| + | ===== configObjCreation ===== | ||
| + | Number -> [Number] -> [Number] -> [String] -> [[Number]] -> [Number] -> [Number] -> Object | ||
| + | |||
| + | A useful tool for creating very basic configuration objects. | ||
| + | |||
| + | ==== Syntax ==== | ||
| + | <code javascript> | ||
| + | K.configObjCreation (total, keys, octave, root, note, noteDuration, | ||
| + | </ | ||
| + | |||
| + | ==== Paramters ==== | ||
| + | === total === | ||
| + | They keyspan of the QuantizedMaps. Also the total variable in the configuration object. | ||
| + | === keys ==== | ||
| + | The keys of the QuantizedMaps. | ||
| + | === octave === | ||
| + | The value of the octave maps | ||
| + | === root === | ||
| + | The value of the root maps. | ||
| + | === note === | ||
| + | The value of the note maps. | ||
| + | === noteDuration === | ||
| + | The value of the noteDuration maps. | ||
| + | === velocity=== | ||
| + | The value of the velocity maps. | ||
| + | |||
| + | ==== Example ==== | ||
| + | <code javascript> | ||
| + | let basicConfig = K.configObjCreation(4, | ||
| </ | </ | ||