A simple harmonizer

Hello, I bring you a simple harmonizer, it is based on the relationship that exists between the major scale and the minor scale. It is known that the minor scale associated with any major scale is the one generated three semitones below.
If we generate two matrices, one with the notes of the major scale and the other with the associated minor scale, we can make when desired, sound the equivalent note of the associated minor scale.


# Escala Mayor y Menor asociada

em = 48

escalaMy = scale(em, :major,num_octaves: 6)
escalaMn = scale(em-3, :minor,num_octaves: 6)

live_loop :a do
  q = rrand_i(7,13)
  use_synth :pluck
  play escalaMy[q]
  play escalaMn[q] if one_in(3)
  '''midi_note_on escalaMy[q],velocity: 64,channel: 1
  midi_note_on escalaMn[q],velocity: 64,channel:2 if one_in(3)'''
  sleep 0.5
  #midi_all_notes_off
end
3 Likes

Here is a little extension of the idea

use_random_seed 2

em = 48
escalaMy = scale(em, :major, num_octaves: 2)
escalaMn = scale(em-3, :minor, num_octaves: 2)

escala1 = scale(:C3, :ionian, num_octaves: 2)
escala3 = scale(:E3, :phrygian, num_octaves: 2)
escala4 = scale(:F3, :lydian, num_octaves: 2)
escala5 = scale(:G3, :mixolydian, num_octaves: 2)
escala6 = scale(:A2, :aeolian, num_octaves: 2)


use_synth :pluck
use_synth_defaults release: 2.5, coef: 0.4

with_fx :reverb, mix: 0.4 do
  with_fx :flanger, wave: 3, depth: 7, decay: 2 do
    live_loop :a do
      q = [7, 8, 9, 11, 13].choose
      
      play escala1[q]
      play [escala3[q], escala4[q]].choose if one_in(3)
      play [escala5[q], escala6[q]].choose if one_in(5)
      
      '''midi_note_on escalaMy[q],velocity: 64,channel: 1
  midi_note_on escalaMn[q],velocity: 64,channel:2 if one_in(3)'''
      sleep 0.5
      #midi_all_notes_off
    end
  end
end

The scales

em = 48
escalaMy = scale(em, :major, num_octaves: 2)
escalaMn = scale(em-3, :minor, num_octaves: 2)

are identical to

escala1 = scale(:C3, :ionian, num_octaves: 2)
escala6 = scale(:A2, :aeolian, num_octaves: 2)

just a different way of writing them down. These scales have a distance of a sixth (actually, the A scale is transposed one octave down, so its effectively 3 halftones below the C).

The other scales escala3, escala4, escala5 just extend the same concept to parallel scales at a distance of the third, fourth and fifth interval. When combined to 3 notes, these intervals will constitute various chords, such as major, minor, sus4, and major6, minor6, depending on the selected base note and the optional notes added randomly.

EDIT: Just realized that this piece offers a great opportunity for training your ears: Listen to it and always decide which interval was played. Was it the third or the fourth? Was there a sixth or the fifth? Eventually you want to slow down a bit and increase the sleep time. Could this be used in music education classes? Maybe also add more difficult intervals for advanced exercices?

3 Likes