====== Creating Music with Code ======
By [[yiler-huang| Yiler Huang]]
===== Play Songs with Konduktiva =====
In Konduktiva, users are allowed to input chord progressions using Roman numerals and melodies using relative semitone. This makes it possible to recreate existing songs using Konduktiva.
Konduktiva utilizes a system called Quantized maps. A Quantized map is like a scheduler for events or information, so that the right note can be played at the right time. This system is used to manipulate things such as chord types (chord map), root note (root map), MIDI velocity (velocity map) etc.
Users can use this block of code to input the chord progression of John Coltrane's Giant Steps into Konduktiva:
addChordProgressionFromRomanNumeral(e, "giantSteps", 64, [0, 2, 4, 6, 8, 12, 14, 16, 18, 20, 22, 24, 28, 30, 32, 36, 38, 40, 44, 46, 48, 52, 54, 56, 60, 62], ["Imaj7", "bIII7", "bVImaj7", "bI7", "IIImaj7", "bVII7", "bIII7", "bVImaj7", "bI7", "IIImaj7", "V7", "Imaj7", "bV7", "bI7", "IIIma7", "bVII7", "bIII7", "bVImaj7", "IIm7", "V7", "Imaj7", "bV7", "bI7", "IIImaj7", "IIm7", "V7"], "B")
Giant Steps played with Konduktiva:
Because Konduktiva uses MIDI signal to communicate with MIDI instruments, users can also capture the output via a digital audio workstation (DAW):
===== Music Generation =====
==== Generating Chord Progressions ====
I made an algorithm that is capable of generating chord progressions based on the "stableness" of each chord. The more stable a chord is, the more likely the next chord is going to be an unstable one, and the more unstable a chord is, the more likely the next chord is going to be a stable one. This function also utilizes chord substitution methods such as secondary dominant, tritone substitution, and minor subdominant.
A short demo of chord progression generation:
==== Generating Melodies ====
I also made an algorithm that can generate melodies based on probabilities and mathematical rules. Users can decide what key the melody is in, the length of the melody, and the scale the algorithm uses to generate the melody.
Here is a demo of a generated melody based on the A minor harmonic minor scale: