Set the environment variables
Install nano(or not if you intend to use vi)
yum install -y nano
Open ~/.profile with nano ~/.profile and add the following:
| # the following script will import Philadelphia Crime Data | |
| # Parts I and II, create a summary based on year, month, and crime type | |
| # and will create a basic map in leaflet using the first 1000 incidents | |
| # you will need to install dplyr, leaflet, readr, lubridate, and stringr | |
| # packages ( install.packages('package name') ) | |
| rm(list = ls()) | |
| library(dplyr) | |
| library(leaflet) | |
| library(readr) |
| module Main where | |
| import Control.Monad.Eff | |
| import Data.Array (replicate, (!!), updateAt) | |
| import Data.Maybe.Unsafe (fromJust) | |
| import Data.Nullable (toMaybe) | |
| import Prelude | |
| import DOM.HTML (window) | |
| import DOM.HTML.Document (body) |
| #Rotating binary rhythms by Robin Newman, January 2016 | |
| #This piece was inspired by an article I read at http://bernhardwagner.net/musings/RPABN.html | |
| #I played with the idea and extended it to give the current piece. | |
| #set_sched_ahead_time! 4 #I set this when recording on a Pi2 to prevent errors | |
| use_debug false | |
| ######### three user settings below ########### | |
| rvol=0.6 #balance these two vol settings to taste (0-1) | |
| lvol=1 | |
| numpasses=4 #set for number of passes required (pattern repeats after 4 passes) |
| defmodule Any do | |
| def remove(str, char) do | |
| remove("", str, char) | |
| end | |
| def remove(newstr, << char :: binary-size(1), rest :: binary >>, char) do | |
| remove(newstr, rest, char) | |
| end | |
| def remove(newstr, << first :: binary-size(1), rest :: binary >>, char) do | |
| remove(newstr <> first, rest, char) | |
| end |
| -- LUA WARNINGS | |
| -- Array starts from index 1 | |
| -- obj.func() is equivalent to obj:func() | |
| -- Loop: | |
| -- for start_, end_ do | |
| -- end | |
| -- Condition: | |
| -- if <condition> then | |
| -- end | |
| -- Function: |
| use_synth :piano | |
| use_bpm 148 | |
| play(chord(:F1, :minor), amp: 2, release: 16) | |
| # play(:Gs3, release: 16) | |
| # play(:C2, release: 16) | |
| # play(:F1, release: 16) | |
| sleep 3 |
| # Guitar Strumming - by Emlyn | |
| # This tries to work out the guitar (or ukulele etc.) fingering for arbitrary chords (and tuning). | |
| # It seems to work reasonably well for basic chords, but is quite naive and probably makes many mistakes. | |
| # Ideas, bug reports, fixes etc. gratefully received, just comment below, or tweet @emlyn77. | |
| # Feel free to make use of this code as you like (with attribution if you feel like it, but you don't have to). | |
| # Thanks to @Project_Hell_CK for fixing the tuning, and spotting that it gets chord(:f, :major) not quite right. | |
| # Next note higher or equal to base note n, that is in the chord c | |
| define :next_note do |n, c| | |
| # Make sure n is a number |
| # "The Optimized Badass" | |
| # Sonic Pi v2.11 | |
| # ---------------------------------------- | |
| # Samples used in this song can be downloaded from: | |
| # https://dl.dropboxusercontent.com/u/657073/sonicpi/badass-samples.zip | |
| # Unpack and put them into your samples folder. | |
| # ---------------------------------------- | |
| # This file is too long to be played from the Sonic Pi IDE | |
| # Instead of pasting this code, just enter the following into the Sonic Pi editor: | |
| # run_file "/path/to/this_file.rb" |
Set the environment variables
Install nano(or not if you intend to use vi)
yum install -y nano
Open ~/.profile with nano ~/.profile and add the following:
| #Fy gar her o'er with Straw arranged for Sonic Pi by Robin Newman, May 2017 | |
| #anon scottish song | |
| #music from The harpsichord or spinnet miscellany by Robert Bremner (c 1765) | |
| use_synth :blade #makes a good harpsichord sound when gverb added | |
| use_bpm 140 | |
| #note values relative to crotchet=1 | |
| m=2;cd=1.5;c=1;q=0.5;sq=0.25;dsq=0.125;hdsq=0.0625;qd=0.75 | |
| define :shake do |n,d,f=0| #quick entry for ornament |