====== How noteMaps, rootMaps and, octaveMaps work together to produce a midi note ======
** Overview: ** This tutorial teaches you how to use three different things, rootMaps, chordMaps, noteMaps, in Konduktiva to get the same effect in 3 different ways.
**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.
const K = require('konduktiva')
let e = K.setUpMusicalEnvironment(K.defaultConfigurationObject,4,'exampleMidiPlayer')
rootMaps, chordMaps and, noteMaps work are combined to get the final midi note sent. I will use an example to explain it.
let root = 'C'
let octave = 8
let note = 6
let finalNote = K.Note.midi(root + octave) + note
console.log(finalNote) //144
It is basically just an equation. So, for instance we want the result 12 there are a few different ways can go about this.
//Using root and octave:
K.Note.midi('C' + 0) + 0
//Using note:
K.Note.midi('C' + -1) + 12