create an empty project and add a Gemfile
cd ~/Desktop
mkdir project-name
cd project-name
touch Gemfile
Rails: | |
Enabled: true | |
# Commonly used screens these days easily fit more than 80 characters. | |
Metrics/LineLength: | |
Max: 120 | |
# Too short methods lead to extraction of single-use methods, which can make | |
# the code easier to read (by naming things), but can also clutter the class | |
Metrics/MethodLength: |
javascript: Promise.all([import('https://unpkg.com/turndown@6.0.0?module'), import('https://unpkg.com/@tehshrike/readability@0.2.0'), ]).then(async ([{ | |
default: Turndown | |
}, { | |
default: Readability | |
}]) => { | |
/* Optional vault name */ | |
const vault = ""; | |
/* Optional folder name such as "Clippings/" */ |
The Sonic Pi file moonlightSonata-RF.rb which plays Beethoven's Moonlight Sonata 1st Movement requires the use of the Grand Piano samples from the Sonatina Symphonic Orchestra produced by Matthias Westlund.
Unfortunately this is no longer available from his website https://sso.mattiaswestlund.net/ However there is an alternative available at https://github.com/peastman/sso from where you can download the library. It is coverd by a https://creativecommons.org/licenses/sampling+/1.0/ Download and expand on your Desktop, or other suitable location and then set the link in the program at line 9 appropraitely for your installation.
The file should be run using the run_file "/path/to/file/location" command as it is too long to run from a Sonic Pi buffer.
An alternative version using the built in piano synth in Sonic Pi is included for comparison.
So, let’s flip a coin: if it’s heads, play a drum, if it’s tails, play a cymbal. Easy. We can emulate a coin flip with our one_in function (introduced in the section on randomness) specifying a probability of 1 in 2: one_in(2). We can then use the result of this to decide between two pieces of code, the code to play the drum and the code to play the cymbal: | |
loop do | |
if one_in(2) | |
sample :drum_heavy_kick | |
else | |
sample :drum_cymbal_closed | |
end | |