Sonic Pi Monthly Challenge #6

Hello Sonic Pi’ers!

Who’s up for another challenge? – #6 Microtonal music.

Inspired by this reply by @Hussein – however, for flexibility, let’s simply focus on creating a piece of microtonal music, unless you want to follow the ‘Electronic Music: Systems, Techniques and Control’ in that thread.

Instructions:

  1. Make a piece of microtonal music using the built in synths and samples or by using external samples, it’s up to you – Any style, any length.

  2. Post the code and audio links (Youtube/Soundcloud) into this topic.

If you want, tell us a little about your creative process.

The deadline for this challenge is 30th September.

Code and audio links will get added to the challenge repo

Happy coding! :computer:

5 Likes

Here’s a link to my submission, “Modes of the Fasilitonic,” which I’m characterizing as microtonal jazz: a guitarist comps over some changes with the rhythm section (drums, no bass, so the guitar goes low), then a trumpet and tenor exchange lines over the chord changes. I use 19-EDO for my tuning and a 12-note scale specified by the intervals [0, 2, 2, 1, 2, 2, 2, 1, 2, 2, 2, 1] in 19-EDO (the “FASILITONIC”) that I thought sounded good with the chord intervals 1, 7, 10, 12, 14, and 17, which are spaced kind of like a 13th chord would be in diatonic jazz. The tonics move through a circle of eighths (as opposed to the diatonic circle of fifths), with the actual chords based at first on the III-VIII progression, which I thought sounds good while moving things forward, as II-V’s do in 12-EDO. Subsequently, there are other chords indicated by my mode function, for example (mode 13, FASILITONIC) would be the 12-note scale you get when you start at note 13 of the FASILITONIC. If you set the tuning to 12-EDO, mode 5 would be the scale you get when you play the 8 notes starting from G if your scale is DIATONIC.

My sequencer FASÍLITU, which is Finally A Sequencer Í Like To Use, makes temporal modulation and microtonality fluid for live coding performance with hardware and plugins. It microtunes polyphonically in real time using MTS or pitch bend, depending on the synth. In this one, I use pitch bend microtuning in all eight channels of an Omnisphere multi for the chords.

You fasilitu a form on its stage like this:

fasilitu form, root, config

A root is a [MIDI octave, degree] pair so that you can put in any number for degree to accommodate the microtuning in effect. If the number’s too big, it goes into the next octave in the expected way. A config contains parameters of all the synths to be output to, such as the microtuning and modulations for CC, OSC, channels, ports, and other stuff. A form specifies an array of intervals and a stage, which is a pattern of tacti and rests to traverse those intervals. A stage is a pattern of 1’s and 0’s represented by binary integers like this:

0b10001000 (like a kick)
0b00100010 (like a snare)
0b11111111 (like a ride)

All the tacti perform in one beat so that you can alternate tuplet patterns like this:

0b10001000, 0b1000100, 0b101

In addition to the video, I can paste the code here if anyone’s interested, but running it requires the FASÍLITU library that I developed, which is rather large to paste here.

2 Likes

Just two weeks left to get your submissions in for this challenge. It would be good to see some more coming in :+1:

If you’re unsure how to make your music microtonal, you could simply use the following:

use_tuning :meantone
use_debug false
use_cue_logging false

#set :rootNote, 30
defonce :setRootNoteStart do
  set :rootNote, 30
end

setRootNoteStart()

live_loop :rootSetter do
  tick
  if get(:rootNote) > 130
    set :rootNote, 30
    tick_reset
  else
    set :rootNote, get(:rootNote) + look
  end
  sleep 4
end

define :getNotes do | var, x |
  tempArray = []
  x.times do
    tempArray.append(get(:rootNote) + rand(var))
  end
  return tempArray
end

define :getSleeps do | x |
  sls = []
  x.times do
    sls.append([0.125, 0.25, 0.5, 0.75, 1, 2].sample)
  end
  return sls
end

live_loop :s1 do
  tick
  if tick > 100
    tick_reset
  end
  use_synth :piano
  with_fx :reverb, damp: range(0, 0.5, 0.05).mirror.look, room: range(0.1, 0.9, 0.05).mirror.look do
    play_pattern_timed getNotes(rand(5)+1, 5), getSleeps(4), amp: range(0.2, 0.8, 0.01).ramp.look
  end
end

live_loop :s2 do
  tick
  use_synth :fm
  with_fx :distortion, distort: range(0.1, 0.9, 0.01).mirror.look, mix: range(0.1, 0.8, 0.03).mirror.look do
    with_fx :hpf, cutoff: range(0.1, 129, 0.5).mirror.look, mix: 0.8 do
      
      play_pattern_timed getNotes(3, 7), getSleeps(5), amp: range(0, 1, 0.01).mirror.look
    end
  end
end

live_loop :s3 do
  tick
  use_synth [:tri, :pretty_bell, :sine, :saw, :hoover].sample
  with_fx :ping_pong, feedback: range(0.1, 0.6, 0.1).to_a.sample, phase: [0.111, 0.333, 0.666, 0.999].sample, mix: rand(10) / 10.0 do
    play range(get(:rootNote) - 10, get(:rootNote) - 9, 0.01).to_a.sample, amp: range(0.2, 0.6, 0.05).mirror.look
    sleep [0.25, 0.5, 0.75, 1, 1.5, 2].sample
  end
end

my effort of using the tick / look as the “rootNote” and have a small range based on the note… is that microtonal? sounds like a horrendous noise anyway… ho ho
I was using “ramps” after finally “getting it” (how to make / use them) recently.
Not quite Autechre… but, I can see how they might approach using random to render sections, then nab the good bits!

1 Like
###################### Winter Sun , Summer Rain ##########################

mn=[:r]                                         #set midi-number 0 as rest
s=[]                                            #pretty_bell track
t=[]                                            #pluck track
u=[]                                            #fm track
m=[0,0,0,0,64,81,90,96,120]                     #scale
p=[0,1,2,3,4,5,6,7,8,9]                         #possibilities

for f in 1..1023
  mn[f]=hz_to_midi(f*4)
end                                             #use frequencies as notes

loop do
  for i in 0..15
    if choose(p)==0 then s[i]=mn[choose(m)]; end #fill pretty_bell track
    if choose(p)==1 then t[i]=mn[choose(m)]; end #fill pluck track
    if choose(p)==2 then u[i]=mn[choose(m)]; end #fill fm track
    synth :pretty_bell, note: s[i], release: 0.1 #play pretty_bell
    synth :pluck, note: t[i]                     #play pluck
    synth :fm, note: u[i]-12, amp: 0.5           #play fm
    sleep 0.25                                   #rest
  end
end
3 Likes

Here’s a simple experiment, using some microtonal chords I got from here.

use_bpm 100

root = 220
chords = [[1/1.0,  5/4.0,   3/2.0],
          [3/2.0, 15/8.0,   9/4.0],
          [9/8.0, 45/32.0, 27/16.0],
          [9/8.0,  3/2.0,   9/5.0],
          [3/2.0,  2/1.0,  24/10.0],
          [1/1.0,  5/4.0,   3/2.0]]

in_thread do
  (chords.length * chords[0].length * 2 - 1).times do
    sleep 0.5
    sample :drum_cymbal_closed
    sleep 0.5
  end
end

in_thread do
  (chords.length * chords[0].length).times do
    sleep 1
    sample :bd_fat, amp: 4
    sleep 1
  end
end

in_thread do
  use_synth :blade
  use_synth_defaults attack: 0.25, release: 1.5
  chords.each do |chord|
    3.times do
      in_thread do
        chord.each do |r|
          play hz_to_midi(root * r)
          sleep 0.125
        end
      end
      sleep 2
    end
  end
end

in_thread do
  use_synth :sine
  use_synth_defaults release: 1, amp: 2
  chords.take(chords.length - 1).each do |chrd|
    chrd.each do |r|
      2.times do
        play hz_to_midi(root * r / 2)
        sleep 1
      end
    end
  end
  chrd = chords.last
  chrd.take(chrd.length - 1).each do |r|
    2.times do
      play hz_to_midi(root * r / 2)
      sleep 1
    end
  end
  chrd.each do |r|
    play hz_to_midi(root * r / 2), release: 3, amp: 1
  end
end
2 Likes

Thanks for all the submissions, some good experiments in here :slight_smile:
I’ll get the repo updated shortly.
:fire:

2 Likes

Late for the party but since there is no new challenge yet ill dare to enter my neverending piece titled: “Late fall”


path="~/.sonic-pi/store/default/cached_samples/"
sample_name = "loopyloop"
sample_path = path+sample_name+".wav"
File.delete(sample_path) if File.exist?(sample_path)

s = (scale :d2, :zirguleli_suznak, num_octaves: 3)

seq = [0.5,0.25,0.125].ring
sample_length = 4
seq_length = seq[0]

synths = [:hollow, :piano]
use_synth :hollow

live_loop :play_notes do
  i = tick
  with_fx :record, buffer: buffer(sample_name.to_sym,sample_length), pre_amp: 0.5 do
    sample sample_path if i>0
    sample_length.times do |n|
      play s[i+n]
      sleep seq_length
    end
  end
  
  if i % seq_length == 0
    seq_length = seq[i+1]
    use_synth synths[i%synths.length]
  end
  
  if i % 20 == 0
    print "Its shuffle time!"
    s = s.shuffle
  end
  
  load_sample sample_path if i>0
end

with_fx :reverb, room: 0.8 do
  live_loop :play_buffer, sync: :play_notes do
    sample sample_path
    sleep sample_length
    sample_free sample_path
  end
end

This piece is recording and looping samples together to form a longer piece and harmonies. Since it’s using suznak scale I think it falls under microtonal music. I was inspired by some looper videos on youtube and wanted to try if same idea works for algorithmic compositions.

EDIT:

This could also be a theme for a future challenge. Include some aspect of live sample recording and manipulation in the spirit of minimalist old school tape looping or modern live looping. Listen to some Steve Reich or Brian Eno for inspiration or watch molecular music box or Algorithmic piano from youtube.