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 18:20] – 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 130: | Line 134: | ||
| // | // | ||
| 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 166: | Line 170: | ||
| // | // | ||
| 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 178: | Line 182: | ||
| //make or modify player to use info: | //make or modify player to use info: | ||
| K.assignPlayerForMusicSynthesizerMidiOutput(e, | K.assignPlayerForMusicSynthesizerMidiOutput(e, | ||
| + | //configure legatoMap: | ||
| + | e.players.exampleMidiPlayer1.legatoMap = ' | ||
| //signal to player to start playing: | //signal to player to start playing: | ||
| e.play(' | 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, | ||
| </ | </ | ||