quantizedmaps-tutorial

Differences

This shows you the differences between two versions of the page.

Link to this comparison view

Both sides previous revision Previous revision
Next revision
Previous revision
quantizedmaps-tutorial [2024/02/19 16:25] – [Changing modeMap used] steve.wangquantizedmaps-tutorial [2024/08/09 00:25] (current) steve.wang
Line 3: Line 3:
 **Overview: ** This tutorial will teach you about QuantizedMaps and how they are used inside of Konduktiva. **Overview: ** This tutorial will teach you about QuantizedMaps and how they are used inside of Konduktiva.
  
-**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 that you have imported Konduktiva to the //K// variable and assigned any of the example MusicalEnvironments to the //e// variable.+**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. 
 +<code javascript> 
 +const K = require('konduktiva'
 +let e = K.setUpMusicalEnvironment(K.defaultConfigurationObject,4,'exampleMidiPlayer'
 +</code> 
 <markdown> <markdown>
  
Line 16: Line 21:
 ``` ```
 //Make e variable a default MusicalEnvironment: //Make e variable a default MusicalEnvironment:
-let e = K.setUpDefaultMusicalEnvironment()+let e = K.setUpMusicalEnvironment(K.defaultConfigurationObject,4,'exampleMidiPlayer')
  
 console.log(e.noteMaps) console.log(e.noteMaps)
Line 35: Line 40:
  
 ====== Adding QuantizedMaps To The MusicalEnvironment ====== ====== Adding QuantizedMaps To The MusicalEnvironment ======
 +
 +Konduktiva has three main ways for users to add their music into the MusicalEnironment. Having multiple means for this was necessary to provide appropriate interfaces for different use cases and users. The first is the most direct yet potentially dangerous way: to add things directly to the MusicalEnvironment. This is the quickest way for those who know their way around the system, but it will not stop the user from inputting incorrect types of information or inputting things in the wrong format. The second way of doing this is using configuration objects which allows the user to place all the data into a JavaScript object under specific property names. This method is usually only used when the MusicalEnvironment is created or when a new Player is created because the usage of this method automatically removes the old data without further confirmation (the method users are advised to start the MusicalEnvironment in these tutorials). There is limited error checking for this part of the process. The third way which is recommended for novice users: the addMap method of the MusicalEnvironment. This method has extensive error checking and it will do actions like convert or format data when necessary. The error thrown will also inform the user of what needs to be fixed.
 +
 The recommended way to change specific variables in the MusicalEnvironment is to use the addMap method because it checks for many different types of errors and common mistakes when coding quickly. However, if you are confident and need more speed you can choose to directly interact with the MusicalEnvironment object. Here are some examples The recommended way to change specific variables in the MusicalEnvironment is to use the addMap method because it checks for many different types of errors and common mistakes when coding quickly. However, if you are confident and need more speed you can choose to directly interact with the MusicalEnvironment object. Here are some examples
 ===== Changing Octaves ===== ===== Changing Octaves =====
Line 83: Line 91:
 ) )
 //OR //OR
-e.noteMaps[e.players.exampleMidiPlayer4.noteMap] = new QuantizedMap(5, [0, 1, 2, 3, 4], [ [40],[50], [60], [70], [80]])+e.noteMaps[e.players.exampleMidiPlayer4.noteMap] = new K.QuantizedMap(5, [0, 1, 2, 3, 4], [ [40],[50], [60], [70], [80]])
 </code> </code>
  
Line 121: Line 129:
 e.players.exampleMidiPlayer1.action = 'sendChordMidiInfo' e.players.exampleMidiPlayer1.action = 'sendChordMidiInfo'
 </code> </code>
-Or click here to learn more about action functions.+ 
 +[[music_generation|Click here to learn about music generation and generating melodies in Konduktiva]]
  
  
  • quantizedmaps-tutorial.1708388732.txt.gz
  • Last modified: 2024/02/19 16:25
  • by steve.wang