This is an old revision of the document!
Creating Players
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 Konduktiva installation instructions and have read through and understood the 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.
Configuration Object
One useful tool to help create players is using configuration objects.
The function recordConfigurationDataIntoMusicalEnvironment will take a configuration object and convert that to QuantizedMaps and put it into the right areas of a MusicalEnvironment.
There are many configuration options in the configuration object so, there are functions to help with the creation of these configuration objects.
The function emptyConfigObj will return a configuration object with all the available configuration options set to undefined.
let emptyConfig = K.emptyConfigObj() console.log(emptyConfig) /* { total: undefined, noteValuesKeyspan: undefined, octaveMapKespan: undefined, noteDurationKeyspan: undefined, rootMapKeyspan: undefined, modeFilterKeyspan: undefined, modeMapKeyspan: undefined, channelKeyspan: undefined, noteValuesKeys: undefined, rootMapKeys: undefined, octaveMapKeys: undefined, noteDurationKeys: undefined, velocityKeys: undefined, modeFilterKeys: undefined, modeMapKeys: undefined, channelKeys: undefined, noteValues: undefined, bools: undefined, rootMap: undefined, octaveMap: undefined, noteDurations: undefined, velocity: undefined, polyphonyMap: undefined, modeFilter: undefined, modeMap: undefined, channelValues: undefined } undefined */
Run this to view what type of input each configuration option is expecting:
K.emptyConfigObj.toString()
Or view an empty configuration object with the expected type input each configuration object is expecting here:
{ total: undefined, //number noteValuesKeyspan: undefined, //number octaveMapKespan: undefined, //number noteDurationKeyspan: undefined, //number rootMapKeyspan: undefined, //number modeFilterKeyspan: undefined, //number modeMapKeyspan: undefined, //number rootMapKeyspan: undefined, //number channelKeyspan: undefined, //number noteValuesKeys: undefined, //number rootMapKeys: undefined, //number octaveMapKeys: undefined, //[number] noteDurationKeys: undefined, //[number] velocityKeys: undefined, //[number] modeFilterKeys: undefined, //[number] modeMapKeys: undefined, //[number] rootMapKeys: undefined, //[number] channelKeys: undefined, //[number] noteValues: undefined, //[[number],[number]] bools: undefined, //[booleans] rootMap: undefined, //[Musical letter notation] octaveMap: undefined, //[number] noteDurations: undefined, //[number] velocity: undefined, //[number] polyphonyMap: undefined, //[number] modeFilter: undefined, //[number] modeMap: undefined, //[number] rootMap: undefined, //[string] channelValues: undefined, //[number] }