Originally Posted by
oro
Hi,
Wanting to give back to the community and being new to
Sonic Pi and
SpectraStrobe sessions, I decided to use
ChatGPT to create a simple session over the weekend. I was only able to create the attached AudioStrobe session.
FWIW, here is the Sonic Pi code for the attached file.
Code:
# See chat https://chat.openai.com/chat/ed9ea0e0-666b-49ee-b819-672069512ccc
# CONSTANTS
FREQUENCY_TO_COLOR = {
174.0 => [1, 0, 0], # red
285.0 => [1, 0.5, 0], # orange
396.0 => [1, 1, 0], # yellow
417.0 => [0, 1, 0], # green
528.0 => [0, 0, 1], # blue
639.0 => [0.5, 0, 1], # indigo
741.0 => [1, 0, 1], # violet
852.0 => [1, 1, 1] # white
}
FREQUENCY_DURATION = 5
PAUSE_DURATION = 3
REFERENCE_FREQUENCY = 18200
RED_FREQUENCY = 18700
GREEN_FREQUENCY = 19200
BLUE_FREQUENCY = 19700
PAN_FREQUENCY = 20
# FUNCTIONS
define :play_strobe do |freq, color|
puts "freq: #{freq}"
use_synth :dark_ambience
use_synth_defaults amp: 2, sustain: FREQUENCY_DURATION
play hz_to_midi(freq)
strobe_channel(color)
end
define :strobe_channel do |color|
use_synth :saw
use_synth_defaults amp: 0.5, sustain: FREQUENCY_DURATION, note_slide: 0.01
with_fx :slicer, phase: 0.25 do
control note: [RED_FREQUENCY, GREEN_FREQUENCY, BLUE_FREQUENCY], note_slide: FREQUENCY_DURATION do |n|
play n, note_slide: FREQUENCY_DURATION
control hpf: 80, note: n, amp: color.shift
control hpf: 80, note: n + 1, amp: color[1]
control hpf: 80, note: n + 2, amp: color[2]
end
end
end
# MAIN CODE
loop do
FREQUENCY_TO_COLOR.each do |freq, color|
play_strobe(freq, color)
sleep FREQUENCY_DURATION
end
sleep PAUSE_DURATION
end
And here is the prompt I used to create it:
Code:
Using what you know about the SpectraStrobe audio format, and as a programmer using the Sonic Pi v3.3.1 program,
I want you to write a multitrack song using the Solfeggio frequencies with the duration of 30 seconds for each frequency and a 3 second
pause between each frequency.
Requirements:
Store frequency duration and pause duration in variables
Please make each frequency binaural with the root frequency being the Solfeggio frequency.
Include the red, orange, yellow, green, blue, indigo, violet, and white colors with one color for each Solfeggio frequency.
Ensure that the following frequencies display the corresponding colors:
174.0 hz displays red
285.0 hz displays orange
396.0 hz displays yellow
417.0 hz displays green
528.0 hz displays blue
639.0 hz displays indigo
741.0 hz displays violet
852.0 hz displays white
The song needs a reference track as described below:
The reference track is an 18.2 kHz sine wave tone that is modulated by a pulse wave at 10 hz per channel with the second channel
being 180 degrees out of phase. The easiest way to program the reference channel is to create an automatic pan function set to
a square wave at 20 hz.
Only use these valid FX methods and their valid options:
:autotuner
:band_eq
:bitcrusher
:bpf
:compressor
:distortion
:echo
:eq
:flanger
:gverb
:hpf
:ixi_techno
:krush
:level
:lpf
:mono
:nbpf
:nhpf
:nlpf
:normaliser
:nrbpf
:nrhpf
:nrlpf
:octaver
:pan
:panslicer
:ping_pong
:pitch_shift
:rbpf
:record
:reverb
:rhpf
:ring_mod
:rlpf
:slicer
:sound_out
:sound_out_stereo
:tanh
:tremolo
:vowel
:whammy
:wobble
Please only use valid arguments or options for the methods, especially the :lpf and :hpf methods.
The :cutoff option value must be less than 131. The sine, spectrastrobe, and spectral_strobe methods
are NOT valid Sonic Pi FX methods so please do NOT use them.
Cheers,
Oro
Bookmarks