Differences
This shows you the differences between two versions of the page.
Both sides previous revision Previous revision Next revision | Previous revision | ||
first_steps [2024/02/15 19:55] – steve.wang | first_steps [2024/11/03 23:04] (current) – steve.wang | ||
---|---|---|---|
Line 1: | Line 1: | ||
- | ====== First Steps ====== | + | ====== First Steps with Konduktiva====== |
- | **Overview: ** This tutorial will act as a guide about how to get started after installating Konduktiva. See how to [[https:// | + | **Overview: ** This tutorial will act as a guide about how to get started after installating Konduktiva. See how to [[https:// |
**Things To Note: ** Only follow this tutorial after you have correctly followed the installation instructions. | **Things To Note: ** Only follow this tutorial after you have correctly followed the installation instructions. | ||
Line 7: | Line 7: | ||
<code bash> node</ | <code bash> node</ | ||
- | Run the following line of code in the REPL which will load the Konduktiva library if you have installed it throught npm. For loading using other methods go to [[|https:// | + | Run the following line of code in the REPL which will load the Konduktiva library if you have installed it throught npm: |
<code javascript> | <code javascript> | ||
const K = require(' | const K = require(' | ||
</ | </ | ||
+ | |||
+ | NOTE: await import is not supported | ||
After this is loaded, you will need to open one instance of MIDI output. Next, setup a default/ | After this is loaded, you will need to open one instance of MIDI output. Next, setup a default/ | ||
<code javascript> | <code javascript> | ||
- | let e = K.setUpMusicalEnvironment(0) | + | let e = K.setUpMusicalEnvironment(K.defaultConfigurationObject, |
</ | </ | ||
Line 31: | Line 33: | ||
</ | </ | ||
- | Before you can start playing music, you have to connect Konduktiva to your music synthesizer of choice. On Linux, I will be using [[https:// | ||
- | {{ : | ||
+ | Before you can start playing music, you have to connect Konduktiva to your music synthesizer of choice. [[connecting-konduktiva-to-music-synthesizer-using-carla|Click here to learn how to do so]] | ||
- | If you did change the settings remember to restart the Carla engine. You can restart the Carla engine by clicking " | ||
- | < | + | Now you can start playing some beats. Ensure you music synthesizer |
- | <img src=' | + | |
- | </ | + | |
- | + | ||
- | Next click the " | + | |
- | + | ||
- | + | ||
- | IMG | + | |
- | + | ||
- | Scroll around the Patchbay and look for the midi bridges, the should have red tags in them indicating they are midi. | + | |
- | + | ||
- | IMG | + | |
- | + | ||
- | In one of the midi bridges, | + | |
- | + | ||
- | IMG | + | |
- | + | ||
- | If you use your mouse to hold down in the "Midi Through: | + | |
- | + | ||
- | GIF | + | |
- | + | ||
- | Next configure | + | |
- | + | ||
- | {{ : | + | |
- | Now you can start playing some beats. Try this command to allow one player to start playing. | + | |
<code javascript> | <code javascript> | ||
e.play(' | e.play(' | ||
</ | </ | ||
- | You should here something like this: | ||
- | {{ : | ||
- | You can also restart the node session by cressing CTRL + D in the terminal and typing node again. Then you might want to try some of these other functions: | ||
- | < | + | Stop it by doing this: |
- | let e = K.setUpMusicalEnvironment(0) | + | < |
- | e.play(' | + | e.stop(' |
- | //OR | + | |
- | let e = K.setUpMusicalEnvironment(1) | + | |
- | e.play(' | + | |
- | //OR | + | |
- | let e = K.setUpMusicalEnvironment(3) | + | |
- | e.play(' | + | |
</ | </ | ||
- | REMEMBER to restart nodejs everytime you run one of those functions. As you learn more about Konduktiva, you will learn other ways to do this so you do not have to restart node every single time. | + | You should here something like this: |
- | Konduktiva can send MIDI messages to more than one music synthesizer session. Try opening another session of your music synthesizer then try this function: | + | {{ :default-config-obj-audio.mp3 |}} |
- | < | + | You can also restart the node session by pressing CTRL + D in the terminal and typing node again. Then you might want to try some of these other functions: |
- | let e = K.setUpMusicalEnvironment(2) | + | |
- | e.play(' | + | |
- | e.play(' | + | |
- | </ | + | The configuration object (first argument controls the type of sound you hear. Try passing in a different configuration object and some extra configurations (last argument). |
- | You should here both your music synthesizer sessions playing different things. It should sound something like this: | ||
- | |||
- | {{ : | ||
- | Next open 2 more music synthesizer session. 4 in total and run the code below: | ||
- | < | ||
- | let e = K.setUpMusicalEnvironment(4) | ||
- | e.play(' | ||
- | e.play(' | ||
- | e.play(' | ||
- | e.play(' | ||
- | </ | ||
- | |||
- | |||
- | This might sound something like this: | ||
- | {{ : | ||
- | |||
- | You can allow multiple players to play simultaneously: | ||
<code javascript> | <code javascript> | ||
- | e.play(' | + | let e = K.setUpMusicalEnvironment(K.lsystemData, |
- | e.play('exampleMidiPlayer4') | + | |
- | e.play(' | + | |
</ | </ | ||
- | All the exampleMidiPlayers should be playing now. | + | {{ : |
- | After each line you should here an extra layer of sound. | + | Konduktiva can send MIDI messages to more than one music synthesizer session. Try opening another session |
- | It might sound something like this: | + | < |
+ | let e = K.setUpMusicalEnvironment(K.defaultConfigurationObject, | ||
- | {{ : | + | e.play(' |
+ | e.play(' | ||
- | To stop a specific session. This will stop exampleMidiPlayer3 player: | ||
- | <code javascript> | ||
- | e.stop(' | ||
</ | </ | ||
Line 132: | Line 76: | ||
</ | </ | ||
- | Explanation of K.setUpMusicalEnvironment function: | + | You should here both your music synthesizer sessions playing the same thing but with different voices. It should sound something like this: |
- | Argument 0 is for the most basic. | + | ADD AUDIO HERE |
- | Argument 1 is for slightly more complex than the most basic | + | |
- | Argument 2 is for two players. | + | |
- | Argument 3 is for more complex and longer single player | + | |
- | Argument 4 is for 4 players | + | |
- | + | To here different sounds try these function calls. Remember to restart nodejs | |
- | All the variables that control the music can be set by using the beginner friendly musicalEnvironment configuration objects. Example configuration objects can be found in the file [[https:// | + | |
- | + | ||
- | Recommended reading [[https:// | + | |
- | + | ||
- | ====== Changing Things Played With Existing QuantizedMaps ====== | + | |
- | The sound output can be easily changed by simply switching the data the player looks at without creating any new data. | + | |
- | ====== Changing notes played ===== | + | |
- | This will cause the notes to loop between 0 to 3. | + | |
<code javascript> | <code javascript> | ||
- | e.players.exampleMidiPlayer1.noteMap | + | let e = K.setUpMusicalEnvironment(K.circleOfFifthChords,1,'exampleMidiPlayer', K.exampleMusicalEnvironmentsExtraConfig) |
- | //To look at the information being used: | + | |
- | console.log(e.noteMaps.default) | + | |
- | </ | + | |
- | ====== Changing modeMap used ===== | + | |
- | This will cause the chord progression form ionian, to phrygian, then to mixolydian. | + | |
- | <code javascript> | + | |
- | e.players.exampleMidiPlayer1.modeMap = 'default' | + | |
- | //To look at the information being used: | + | |
- | console.log(e.modeMaps.default) | + | |
- | </ | + | |
- | ====== Changing melody used ===== | + | |
- | This will cause the player to cycle between the notes 0 to 3. | + | |
- | <code javascript> | + | |
- | e.players.exampleMidiPlayer1.noteMap = ' | + | |
- | //To look at the information being used: | + | |
- | console.log(e.noteMaps.default) | + | |
- | </ | + | |
- | ====== Playing Chords ===== | + | let e = K.setUpMusicalEnvironment(K.circleOfFifthMelody, |
- | To play chords another action function will have to be used. To switch action functions do this: | + | |
- | <code javascript> | + | |
- | e.players.exampleMidiPlayer1.action = 'sendChordMidiInfo' | + | |
</ | </ | ||
- | Or click here to learn more about action functions. | ||
- | ====== Next Steps ====== | + | circleOfFifthChords: |
- | 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 ===== | + | |
- | For example, if I wanted to change the octaves of exampleMidiPlayer4 without changing timing I would do this: | + | circleOfFifthMelody: |
- | <code javascript> | + | {{ :yoshimi-10_circleoffifthmelody_session_2024-03-12.mp3 |}} |
- | //Identify which octave map exampleMidiPlayer4 is looking at: | + | |
- | e.players.exampleMidiPlayer4.octaveMap | + | |
- | //Next (the safer way): | + | |
- | | + | |
- | e.players.exampleMidiPlayer4.octaveMap, | + | |
- | e.octaveMaps[e.players.exampleMidiPlayer4.octaveMap].keyspan, | + | |
- | e.octaveMaps[e.players.exampleMidiPlayer4.octaveMap].keys, | + | |
- | [[ 6 ], [ 6 ], [ 6 ], [ 6 ], [ 6 ], [ 6 ], [ 6 ], [ 6 ], [ 6 ], [ 6 ], [ 6 ], [ 6 ]] | + | |
- | ) | + | |
- | //to see the changes: | + | |
- | console.log(e.octaveMaps[e.players.exampleMidiPlayer4.octaveMap].values) | + | |
- | //OR do this the less safe way but potentially faster with more control: | ||
- | e.octaveMaps[e.players.exampleMidiPlayer4.octaveMap].values =[[ 6 ], [ 6 ], [ 6 ], [ 6 ], [ 6 ], [ 6 ], [ 6 ], [ 6 ], [ 6 ], [ 6 ], [ 6 ], [ 6 ]] | ||
- | //to see the changes: | + | All the variables that control the music can be set by using the beginner friendly musicalEnvironment configuration objects. Example |
- | console.log(e.octaveMaps[e.players.exampleMidiPlayer4.octaveMap].values) | + | |
- | </ | + | |
- | ===== Changing RhythmMap ===== | + | |
- | Example | + | |
- | <code javascript> | + | |
- | //Recommended safe way: | + | |
- | e.addMap(' | + | |
- | e.players.exampleMidiPlayer4.rhythmMap, | + | |
- | e.rhythmMaps[e.players.exampleMidiPlayer4.rhythmMap].values[0].keyspan, | + | |
- | e.rhythmMaps[e.players.exampleMidiPlayer4.rhythmMap].values[0].keys, | + | |
- | [2, 4, 6] | + | |
- | ) | + | |
- | //other potentially faster way: | + | |
- | e.rhythmMaps[e.players.exampleMidiPlayer4.rhythmMap].values[0].values = [2, 4, 6] | + | |
- | </ | + | |
- | ===== Changing Melody, Notes or Chords ==== | + | Recommended |
- | Example of changing notes played for exampleMidiPlayer4 Similar to [[http:// | + | |
- | <code javascript> | + | |
- | //Recommended | + | |
- | e.addMap(' | + | |
- | e.players.exampleMidiPlayer4.noteMap, | + | |
- | 5, | + | |
- | [0, 1, 2, 3, 4], | + | |
- | [ [40],[50], [60], [70], [80]] | + | |
- | ) | + | |
- | //OR | + | |
- | e.noteMaps[e.players.exampleMidiPlayer4.noteMap] = new QuantizedMap(5, | + | |
- | </ | + | |
- | + | ||
- | ===== Changing The MusicalEnvironment In General ===== | + | |
- | + | ||
- | To change things in the MusicalEnviornment, | + | |
- | Or read about the different ways to generate music [[http:// | + | [[quantizedmaps-tutorial|Click to learn about QuantizedMaps and how they are used in Konduktiva]] |