Show pageOld revisionsBacklinksBack to top This page is read only. You can view the source, but not change it. Ask your administrator if you think this is wrong. ====== Create CC Changes For A Player to Follow ====== **Overview: ** This tutorial will teach you how to use Konduktiva to send MIDI Control Change(CC) messages. **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> The example below is based on Yoshimi. Click [[https://yoshimi.github.io/docs/user-guide/mlearn/mlearn.html|here]] to read more about MIDI CC in Yoshimi. A player that sends controlChange messages will not send other MIDI messages anymore. After configured, it will only send MIDI control change messages and nothing more. To configure a player to ONLY send MIDI CC messages change the action function and define the controlChangeMap variable in the player. <code javascript> //Changing action function: e.players.exampleMidiPlayer1.action = 'sendMidiCCMessages' </code> The key to making Konduktiva send control change messages is the //controlChangeMap// variable in the //MusicalEnvironment//. //QuantizedMaps// stored in //controlChangeMap// variable. Create a controlChange map and add it to //e.controlChangeMaps//. I will call this one //p1// <code javascript> e.controlChangeMaps.p1 = new K.QuantizedMap(10, [0, 2, 4, 6, 8], [{ controller: 37, value: 80, channel: 0 }, { controller: 37, value: 120, channel: 0 }, { controller: 37, value: 60, channel: 0 }, { controller: 37, value: 70, channel: 0 }, { controller: 37, value: 100, channel: 0} ]) </code> In Yoshimi, this will change whatever you assign 37 to. Next I will ensure the exampleMidiPlayer1 uses it: <code javascript> e.players.exampleMidiPlayer1.controlChangeMap = 'p1' </code> Now I can play it and if your music synthesizer accepts MIDI CC, if the specific controller and value is configured to change something in your music synthesizer, and if the channel is correct, you might here or see a change in the music synthesizer session. <code javascript> e.play('exampleMidiPlayer1') </code> [[http://konduktiva.org/doku.php?id=action-functions|Click here to learn about action functions an important part about how Konduktiva works]] midi-cc.txt Last modified: 2024/03/18 19:55by steve.wang