quantizedmaps-tutorial

This is an old revision of the document!


What Are QuantizedMaps?

This tutorial assumes you have completed and understood the installation processand the first steps tutorial.

QuantizedMap is a class to nodejs:

K.QuantizedMap
//[class QuantizedMap]

The instance of QuantizedMap is used to store data in Konduktiva. You will see it used everywhere. For example, assuming you have e as a default MusicalEnvironment:

//Make e variable a default MusicalEnvironment:
let e = K.setUpDefaultMusicalEnvironment()

console.log(e.noteMaps)
//It is full of QuantizedMaps. We can know that because after the variable name, it will say QuantizedMap like this "p2: QuantizedMap {". We can also verify that using code:

console.log(e.noteMaps.p2 instanceof K.QuantizedMap)

THe full QuantizedMap documentation can be found here but generally keys represents the timing. Values represents the values that should be used at a specific timing and keyspan is the total.

The QuantizedMaps are all recorded in different variables in the MusicalEnvironment but they are only used when the players are told to use them. For example:

//The modeMap variable in e.players.exampleMidiPlayer4.noteMap is p4
console.log(e.players.exampleMidiPlayer4.noteMap)
//So that means when the player is going to play something, it will look at:
console.log(e.noteMaps.p4)
  • quantizedmaps-tutorial.1700881758.txt.gz
  • Last modified: 2023/11/24 19:09
  • by steve.wang