This is an old revision of the document!
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.
Ensure you have 4 sessions of a music synthesizer that supports MIDI control change messages. Yoshimi recommend for Linux and Surge is recommended for MacOS.
Things To Note: This tutorial assumes you have already installed Konduktiva successfully using the Konduktiva installation instructions and have read through and understood the 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.
The example below is based on Yoshimi. Click here to read more about MIDI CC in Yoshimi.
The key to making Konduktiva send control change messages is the controlChangeMap variable in the MusicalEnvironment. QuantizedMaps stored in controlChangeMap variable.
First create a controlChange map and add it to e.controlChangeMaps. I will call this one p4
e.controlChangeMaps.p4 = 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} ])
In Yoshimi, this will change whatever you assign 37 to.
Next I will ensure the exampleMidiPlayer4 uses it:
e.players.exampleMidiPlayer4.controlChangeMap = 'p4'
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.
e.play('exampleMidiPlayer4')
Click here to learn about action functions an important part about how Konduktiva works