Differences
This shows you the differences between two versions of the page.
Both sides previous revision Previous revision | |||
quantizedmaps-tutorial [2025/08/13 16:50] – steve.wang | quantizedmaps-tutorial [2025/08/13 23:43] (current) – steve.wang | ||
---|---|---|---|
Line 32: | Line 32: | ||
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 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 | + | //The modeMap variable in e.players.exampleMidiPlayer4.noteMap is default |
console.log(e.players.exampleMidiPlayer4.noteMap) | console.log(e.players.exampleMidiPlayer4.noteMap) | ||
//So that means when the player is going to play something, it will look at: | //So that means when the player is going to play something, it will look at: | ||
- | console.log(e.noteMaps.p4) | + | console.log(e.noteMaps.default) |
``` | ``` | ||
</ | </ | ||
Line 50: | Line 50: | ||
//Identify which octave map exampleMidiPlayer4 is looking at: | //Identify which octave map exampleMidiPlayer4 is looking at: | ||
e.players.exampleMidiPlayer4.octaveMap | e.players.exampleMidiPlayer4.octaveMap | ||
+ | | ||
+ | //see what it looks like currently | ||
+ | console.log(e.octaveMaps[e.players.exampleMidiPlayer4.octaveMap].values) | ||
+ | |||
//Next (the safer way): | //Next (the safer way): | ||
- | | + | |
- | e.players.exampleMidiPlayer4.octaveMap, | + | e.players.exampleMidiPlayer4.octaveMap, |
e.octaveMaps[e.players.exampleMidiPlayer4.octaveMap].keyspan, | e.octaveMaps[e.players.exampleMidiPlayer4.octaveMap].keyspan, | ||
- | e.octaveMaps[e.players.exampleMidiPlayer4.octaveMap].keys, | + | e.octaveMaps[e.players.exampleMidiPlayer4.octaveMap].keys, |
[[ 6 ], [ 6 ], [ 6 ], [ 6 ], [ 6 ], [ 6 ], [ 6 ], [ 6 ], [ 6 ], [ 6 ], [ 6 ], [ 6 ]] | [[ 6 ], [ 6 ], [ 6 ], [ 6 ], [ 6 ], [ 6 ], [ 6 ], [ 6 ], [ 6 ], [ 6 ], [ 6 ], [ 6 ]] | ||
) | ) | ||
Line 70: | Line 74: | ||
<code javascript> | <code javascript> | ||
// | // | ||
- | e.addMap(' | + | e.addMap(' |
- | e.players.exampleMidiPlayer4.rhythmMap, | + | e.players.exampleMidiPlayer4.rhythmMap, |
- | e.rhythmMaps[e.players.exampleMidiPlayer4.rhythmMap].values[0].keyspan, | + | e.rhythmMaps[e.players.exampleMidiPlayer4.rhythmMap].values[0].keyspan, |
- | e.rhythmMaps[e.players.exampleMidiPlayer4.rhythmMap].values[0].keys, | + | e.rhythmMaps[e.players.exampleMidiPlayer4.rhythmMap].values[0].keys, |
[2, 4, 6] | [2, 4, 6] | ||
) | ) | ||
Line 84: | Line 88: | ||
<code javascript> | <code javascript> | ||
// | // | ||
- | e.addMap(' | + | e.addMap(' |
- | e.players.exampleMidiPlayer4.noteMap, | + | e.players.exampleMidiPlayer4.noteMap, |
- | 5, | + | 5, |
- | [0, 1, 2, 3, 4], | + | [0, 1, 2, 3, 4], |
[ [40],[50], [60], [70], [80]] | [ [40],[50], [60], [70], [80]] | ||
) | ) | ||
Line 103: | Line 107: | ||
The sound output can be easily changed by simply switching the data the player looks at without creating any new data. | The sound output can be easily changed by simply switching the data the player looks at without creating any new data. | ||
====== Changing notes played ===== | ====== Changing notes played ===== | ||
- | This will cause the notes to loop between 0 to 11. | + | This will cause the notes to loop between 0 to 11. |
<code javascript> | <code javascript> | ||
e.players.exampleMidiPlayer1.noteMap = ' | e.players.exampleMidiPlayer1.noteMap = ' | ||
Line 131: | Line 135: | ||
[[music_generation|Click here to learn about music generation and generating melodies in Konduktiva]] | [[music_generation|Click here to learn about music generation and generating melodies in Konduktiva]] | ||
- | |||