mercury-examples
Version:
Package with examples and tutorials for the Mercury language
1 lines • 72.6 kB
JavaScript
(function(f){if(typeof exports==="object"&&typeof module!=="undefined"){module.exports=f()}else if(typeof define==="function"&&define.amd){define([],f)}else{var g;if(typeof window!=="undefined"){g=window}else if(typeof global!=="undefined"){g=global}else if(typeof self!=="undefined"){g=self}else{g=this}g.MercuryTutorialsExamples=f()}})(function(){var define,module,exports;return function(){function r(e,n,t){function o(i,f){if(!n[i]){if(!e[i]){var c="function"==typeof require&&require;if(!f&&c)return c(i,!0);if(u)return u(i,!0);var a=new Error("Cannot find module '"+i+"'");throw a.code="MODULE_NOT_FOUND",a}var p=n[i]={exports:{}};e[i][0].call(p.exports,function(r){var n=e[i][1][r];return o(n||r)},p,p.exports,r,e,n,t)}return n[i].exports}for(var u="function"==typeof require&&require,i=0;i<t.length;i++)o(t[i]);return o}return r}()({1:[function(require,module,exports){exports.Examples=JSON.parse('{\n "00_sample-and-time": "// play different samples\\n// at different time intervals\\nset tempo 95\\n\\nnew sample piano_a time(1)\\nnew sample piano_c time(1/2)\\nnew sample piano_f time(1/3)\\nnew sample piano_g time(1/4)\\n\\n// add reverb fx to all samples\\nset all fx(reverb 0.4 3)",\n "01_offset-in-time": "// multiple samples make up a beat\\n// using a time offset as \\n// second argument\\nset tempo 131\\n\\nnew sample kick_909 time(1/4)\\nnew sample snare_909 time(1/2 1/4)\\nnew sample hat_909 time(1/4 1/8)\\nnew sample hat_909_open time(1 15/16)\\nnew sample clap_909 time(5/16)\\n\\n// short slapback reverb\\nset all fx(reverb 0.5 2)",\n "02_linear-beat": "// choose 15 random samples from a list of\\n// predefined samplename. Play those samples \\n// sequentially for every time interval\\nset tempo 112\\n\\n// randomseed makes sure every run the \\n// random values are the same\\nset randomSeed 1234\\n\\nlist samples [tabla_lo tabla_hi tabla_mid tabla_hi_short]\\nlist selection choose(15 samples)\\n\\nnew sample selection time(1/16)\\nnew sample kick_house time(1/4)\\n\\nset all fx(reverb 0.3 3)",\n "03_sample-scrubbing": "// make 2 different position lists of 16 values \\n// from a randomFloat() method and combine them\\n// into one list. Fade-in the sample in 1 ms, \\n// Play it for 50 ms and fade-out 2 in ms with shape()\\nset tempo 131\\n\\n// randomseed makes sure every run the \\n// random values are the same\\n// try some different values to hear the result\\nset randomSeed 3141\\n\\nlist pos1 randomFloat(16 0 0.2)\\nlist pos2 randomFloat(16 0.2 0.3)\\nlist offset join(pos1 pos1 pos1 pos2)\\n\\nnew sample harp_up time(1/16) shape(1 80) start(offset) gain(2)\\n\\nset all fx(reverb 0.5 11)",\n "04_possibility-rhythm": "// make a rhythm with ones and zeroes\\n// in a list. A value between one and zero is\\n// a probability (for example 0.5 = 50% chance)\\nset tempo 83\\n\\nnew sample kick_909 time(1/4)\\n\\n// try changing the values in the list\\n// try adding/removing values as well\\nlist rhythm [1 0 0 1 0.1 0.5 0.2]\\nnew sample bamboo_g time(1/16) beat(rhythm)\\n\\nset all fx(reverb 0.4 3)",\n "05_synth-and-note": "// play a melody from a list of semitones\\n// use different octaves with the second\\n// argument in the note() method\\nset tempo 98\\n\\n// star wars melody as relative intervals\\nlist jedi [-5 0 2 3 5 3 -5 -5 0 2 3 -5 3 0 7 5]\\n\\nnew synth sine name(luke)\\n set luke note(jedi 2) shape(5 300) time(1/6)\\n\\nnew synth sine name(leia)\\n set leia note(jedi 3) shape(5 90) time(1/8)\\n\\n// apply a reverb, distortion and distortion to all synths\\nset all fx(reverb 0.3 9) fx(drive 5) fx(delay 1/12 2/12 0.8)",\n "06_generative-melody": "// generate a small theme from a sine function \\n// and transform it with various methods like\\n// invert(), join() and clone()\\nset tempo 98\\n// set a scale to map all the notes to\\nset scale minor_pentatonic b\\n\\nlist theme sine(16 5 0 24)\\nlist variation invert(theme 0 24)\\nlist phrase join(theme variation)\\nlist section clone(phrase 0 5 9 7)\\n\\nnew synth triangle name(arpy)\\n set arpy time(1/16) shape(1 170) note(section 0)\\n \\n // give the synth random panning, a filter and a delay\\n set arpy pan(random) fx(filter low 2300 0.4) fx(delay 4/16 5/16 0.8)",\n "07_granular-playback": "// simple granular timestretching is achieved\\n// by quickly playing short grains of a sample\\n// and changing the offset of the playback\\nset tempo 120\\n\\n// a position ramp up-down over 2000 values\\nlist pos sineFloat(1100 1 0 0.5)\\n\\n// small detuning for every sample playback\\nlist detune randomFloat(1000 0.95 1.05)\\n\\nnew sample bowl_mid name(grain)\\n set grain time(1/32) shape(4 1/40 4) \\n set grain offset(pos) pan(random)\\n set grain fx(delay 3/16 5/16 0.7)\\n set grain speed(detune)",\n "08_modulating-fx": "// combine multiple effects modulated in time by lists\\n// to create interesting synthesized sounds\\nset tempo 132\\nset scale minor c\\n\\nnew synth saw note([0 1 [12 24 19 36]] 0) name(syn)\\n // modulate the length of the note with a cosine function\\n set syn shape(1 cosine(128 3.14 50 300)) time(1/16) \\n // randomnes to the slide between notes and the overdrive fx\\n set syn slide([[100 0] 0 0]) fx(drive random(4 2 15)) \\n // slowly rise the filter cutoff frequency\\n set syn fx(filter low spread(32 200 3500) 0.6)\\n // change delaytimes every 16 notes\\n set syn fx(delay repeat([1/32 3/16] 16) 1/8 0.8)",\n "09_lofi-hiphop": "// A lo-fi beat with amenbreak chops and a pitchshifted \\n// rhodes sample on the offbeat\\nset tempo 87\\nset scale minor c\\nset randomSeed 3210\\n\\n// chopped amen break\\nnew loop amen time(1/16) start(choose(16 spreadFloat(16)))\\n\\n// hihats and a kick-hat-snare-hat beat\\nnew sample hat_808 time(1/16) pan(random) gain(0.5)\\nnew sample [kick_dub hat_808_open snare_rock hat_808_open] time(1/4)\\n\\nnew sample rhodes_8bit name(rhodes)\\n set rhodes time(1/4 1/8) fx(shift repeat([0 3 7 2] 8))\\n set rhodes shape(1 1/8 1) fx(reverb 0.3 7)",\n "10_techno-acid": "// techno/acid beat with random closed/open hihat\\n// kick has some delay and distortion\\n// saw synthesizer with random cutoff frequency on the filter\\nset tempo 131\\n\\nnew sample kick_909 time(1/4) name(kick)\\n set kick speed(0.9) fx(drive 5) gain(0.9) \\n set kick fx(delay 7/16 6/16 0.7)\\n\\nnew sample [[hat_808 hat_808_open]] time(1/4 1/8)\\n\\nnew synth saw time(1/16) shape(1 1/32 1) name(bass)\\n set bass fx(filter random(16 50 3000))\\n set bass fx(reverb 0.5 5) super(3 0.01532)",\n "11_808-beat": "// 808 beats\\n// change the tempo\\nset tempo 115\\n// try different numbers to create new random patterns\\nset randomSeed 9832\\n\\n// various sounds in a list\\nlist manySounds [kick_808 hat_808 hat_808_half maracas_808 snare_808 tom_808]\\n// choose 16 names randomly from the list\\nlist pattern choose(16 manySounds)\\n\\n// play the sounds with a squash effect and random panning \\n// on left/right speaker\\nnew sample pattern time(1/16) fx(squash 5) pan(random)",\n "12_drone-synths": "// A synth that functions as bass drone \\n// Combined with a short high pitch synth with delay\\n// Creating in a melody from a lookup scale list\\nset tempo 124\\n// set a scale\\nset scale harmonic_minor c\\n\\n// some note numbers for bass synth\\nlist notes [3 7 5 8]\\nnew synth saw note(notes 0) time(4) name(drone)\\n set drone super(3 0.1132) shape(off) fx(squash 5)\\n set drone fx(reverb 0.6 5) fx(filter low 1500 0.4)\\n\\n// create a melody for the lead synth\\nlist melody cosine(16 5.32 0 12)\\nnew synth sine note(melody 2) time(1/2) name(lead)\\n set lead shape(1 120) super(3 0.021) fx(distort 10)\\n set lead fx(delay 3/16 4/16 0.8) fx(reverb 0.5 3)",\n "13_beethovens-fifth": "// The first two measures of Beethovens 5th Symphony\\n// Using 3 synths with squarewave oscillators in 3 different octaves\\n// The notes are repeated in a list together with notelengths\\n// The timediv is used to divide quarter notes into 16th\\n\\n// The key is C minor\\nset scale minor c\\nset tempo 70\\n\\n// The notes are g, eb, f, d\\nlist notes [7 3 5 2]\\nlist lengths [1/16 1/1]\\nprint notes lengths\\n\\n// Three synths in different octaves playing the same notes\\nnew synth square note(notes 1) \\nnew synth square note(notes)\\nnew synth square note(notes -1)\\n\\n// These settings are set for all the synths above\\nset all time(1/4) timediv([4 1]) play([0 1 1 1 1 0 0 0 0 0]) \\nset all shape(1 lengths) super(3 0.11) fx(reverb 0.4 5) \\n",\n "14_great-fairys-fountain": "// The Legend of Zelda - Ocarina of Time - The Great Fairy\'s Fountain\\n// The first 4 measures of this melody, generated using algorithmic process\\n// lacing the lead notes with the repetitive arpegiator and joining the 4 bars\\n\\nset tempo 80\\n// we\'ll set the scale to none in order for the exact notenames to work correctly\\nset scale none\\n\\nlist m1 flat(lace([a5 g5 f#5 g5] duplicate([[d5 bb4 g4]] 4)))\\nlist m2 flat(lace([g5 f5 e5 f5] duplicate([[c5 a4 f4]] 4)))\\nlist m3 flat(lace([f5 e5 d#5 e5] duplicate([[bb4 g4 e4]] 4)))\\nlist m4 flat(lace([e5 d5 c#5 d5] duplicate([[a4 f4 d4]] 4)))\\nlist total join(m1 m2 m3 m4)\\n\\nnew synth square note(total 0) shape(1 1/8) time(1/16) fx(reverb 0.5 4)\\n",\n "15_bladerunner-ish": "// A soundscape inspired by BLADE RUNNER\'s composer Vangelis\\n// Multiple saw oscillators with detuning. A dorian melody \\n// generated as a list. Notes slide slowly from one to another\\n// The syntsh have various filtering, reverb and compression\\n\\nset tempo 35\\nset scale dorian d\\nset randomSeed 4328\\n\\nlist notes shuffle(spreadInclusive(8 0 12))\\nnew synth saw note(notes 0) time(2/1) pan(random) slide(1/2)\\nnew synth saw note(notes -1) time(2/1) pan(random) slide(1/2)\\nset all fx(filter low 4/1 1500 5000 0.4)\\n\\nnew synth saw note(notes 1) time(1/2) timediv([1 1 2]) slide(1/16) fx(filter low 2/1 1500 3500 0.7)\\nset all super(3 0.132) shape(off)\\nset all fx(reverb 0.7 10) fx(compress) human(100)\\n",\n "16_polysynth-chords": "// A composition using 2 polyphonic synths for chords and melody\\nset tempo 110\\nset randomSeed 4831\\nset scale dorian d\\n\\n// main chord progression is a 2-dimensional list generated from numerals\\nlist progression chordsFromNumerals([I7 IIIm7 IV7 V7])\\nprint progression\\n// chord progression used in the polySynth\\nnew polySynth saw name(chrd)\\n set chrd note(progression 1) time(2/1) shape(1 2/1) fx(triggerFilter low 1/1 1/1 4000 100) super(3 0.132)\\n\\n// chord progression flattened to 1d list, repeated with octave offset\\nlist melody add(repeat(flat(progression) 2) [0 12])\\nprint melody\\n// the melody is played by another polySynth with overlapping adsrs\\nnew polySynth saw name(lead)\\n set lead note(melody 2) time(1/8) shape(1 2/1) super(3 0.112) gain(0.6) fx(triggerFilter low 1 1/6 5000 100) \\n// some effects applied to all instruments above\\nset all fx(squash 1) fx(reverb 0.4 7)\\n\\n// list of drum samples\\nlist drums choose(17 [hat_808 kick_808 snare_808])\\nnew sample drums time(1/8) gain(0.7) fx(degrade 0.7) fx(delay 3/16 5/16 0.9) timediv([1 1 1 2])\\n"\n}\n');exports.Tutorials=JSON.parse('{\n "-tutorials": "// Welcome to the Mercury Playground ^^\\n// click \\"play\\" to start the code\\n// adjust the code below:\\n\\nlist kickBeat [1 0.01 0.1 1 0]\\nnew sample kick_house time(1/16) play(kickBeat)\\n\\nlist hatBeat euclid(16 7)\\nnew sample hat_909 time(1/16) play(hatBeat) pan(0.5)\\n\\nnew sample snare_hvy time(1 3/4)\\n\\nlist positions sineFloat(16 6.523 0 0.6)\\nlist pitch repeat([2 1 1 0.84 0.94] 16)\\nnew sample chimes_l time(1/16) shape(1 70 5) name(stut)\\n\\tset stut offset(positions) pan(random) gain(1) speed(pitch)\\n",\n "000-intro": "// === TUTORIAL 000: Intro ===\\n// Welcome to the Mercury tutorials!\\n// These short tutorials will teach you everything \\n// about the Mercury live coding language\\n\\n// Lines starting with \'//\' are comments and are not part of the code\\n// (un)comment lines with Option+/ (or by backspacing the //)\\n\\n// Uncomment the line below and click \'play\' above\\n// to hear the harp sample play\\n// new sample harp_up time(1)\\n",\n "101-sample": "// === TUTORIAL 101: Sample ===\\n// You can play a soundfile with \'new sample\' \\n// followed by the samplename, for example: kick_909\\n// Start the code with \'play\' or Alt + Enter\\n// Stop the sound with \'silence\' or Alt + .\\n\\nnew sample kick_909\\n// Try some other sounds like: hat_909, chimes, kalimba_e\\n// You can find all the sounds by clicking the menu \'sounds\'\\n// When you select a sound from the menu it is pasted on the \\n// location of the cursor in the editor",\n "102-time": "// === TUTORIAL 102: Time ===\\n// A sound is played once per bar by default.\\n// You can change how often a sound is played in one measure/bar.\\n// For example 1/4 means 1 bar divided by 4, so 4 times per measure.\\n// 1/16 means 16 times per measure, etc.\\n\\nnew sample kick_909 time(1/4)\\n// Try for example: 1/8, 3/16, 1/6, 5/32",\n "103-sounds": "// === TUTORIAL 103: Sounds ===\\n// Code multiple sounds simply by creating extra lines \\n// starting with \'new sample\', followed by a sound name\\n\\nnew sample kick_909 time(3/8)\\nnew sample hat_909 time(1/8)\\nnew sample snare_909 time(1/2)\\n\\n// Try various time() arguments and add extra sounds",\n "104-tempo": "// === TUTORIAL 104: Tempo ===\\n// We can change the tempo and other settings\\n// with the \'set\' keyword\\n\\nset tempo 115\\n\\nnew sample kick_808_dist time(3/8)\\nnew sample hat_808 time(1/16)\\nnew sample snare_808 time(1/2)\\n\\n// Some genres are defined by there own bpm range\\n// Try for example tempo 86 for HipHop, \\n// or 162 for Drum\'n\'Bass",\n "105-offset": "// === TUTORIAL 105: Offset ===\\n// We can keep the time interval the same, but play \\n// sounds at a different position in the bar by \\n// using a second argument for the offset\\n\\nnew sample kalimba_g time(1)\\nnew sample kalimba_a time(1 3/16)\\nnew sample kalimba_e time(1 3/8)\\n\\n// These sounds all play 1 time per measure\\n// one starts at offset 0, one at 3/16 and one at 3/8\\n// Try different offsets like 1/16, 3/4, 1/32",\n "106-rhythm": "// === TUTORIAL 106: Rhythm ===\\n// With a list we can make more complex patterns, like a beat of 1\'s and 0\'s\\n// A list is a collection of numbers (or words) written between \\n// square-brackets \\"[]\\" and seperated by spaces\\n// The list has a unique name that can be used in other functions\\n\\nlist hatBeat [1 0 1 0 0 1 0 1]\\nnew sample hat_808 time(1/16) play(hatBeat)\\n\\n// 1 means play the sounds, a 0 means skip it\\n// Try changing the values and length of the list \\n// For example: [1 0 1 1 0]",\n "107-beat": "// === TUTORIAL 107: Beat ===\\n// We can create multiple rhythms for different instruments \\n// with lists of various lengths to create an interesting beat\\n// Here the rhythm of the hihat is 7 long, and the tabla 5\\n\\nlist hatBeat [1 0 1 0 0 1 0]\\nnew sample hat_909 time(1/16) play(hatBeat)\\n\\nlist tablaBeat [1 0 1 1 0]\\nnew sample tabla_mid time(1/16) play(tablaBeat)\\n\\n// Try different rhythms combined with different times",\n "108-linear": "// === TUTORIAL 108: Linear ===\\n// We can also create a list of sound names instead\\n// to let one sample play the files sequentially\\n\\nlist drumSounds [kick_909 hat_909 snare_909 hat_909]\\nnew sample drumSounds time(1/8)\\n\\n// Try adding or removing some sound names\\n// For example add tabla_mid to the list\\n// Find other sounds in the drop-down menu below",\n "109-linear-beat": "// === TUTORIAL 109: Linear Beat ===\\n// We can now combine a list of sounds with a list of beats\\n// and add an extra sample 1/4th of the time to make a steady beat\\n\\nset tempo 114\\n\\nlist sounds [hat_909 snare_909 hat_909 tabla_mid tabla_hi]\\nlist beat [1 0 1 0 1 1]\\nnew sample sounds time(1/16) play(beat)\\n\\nnew sample kick_909 time(1/4)\\n\\n// It gradually becomes more complex and interesting\\n// Try different combinations of beats, sounds and time",\n "110-polyrhythm": "// === TUTORIAL 110: Polyrhythm ===\\n// We can also create a so called polyrhythm with time()\\n// A polyrhythm is a composite rhythm of different timing\\n// intervals within a measure\\n\\nnew sample kalimba_e time(1)\\nnew sample kalimba_g time(1/3)\\nnew sample kalimba_cis time(1/2)\\nnew sample kalimba_a time(1/4)\\n\\n// Try changing some of the time values to play with the polyrhythm",\n "111-chance": "// === TUTORIAL 111: Chance ===\\n// Instead of a 1 (100%) or 0 (0%) in the play method, \\n// we can also use a decimal-point value that represents\\n// a percentage of chance that the sound will play\\n\\nset tempo 115\\n\\nnew sample hat_808 time(1/16) play(0.6)\\n// play hat 60% of the time\\n\\nnew sample kick_808_dist time(1/8) play(0.3)\\n// play kick 30% of the time\\n\\nnew sample snare_808 time(1/2)\\n// by default the sound is played 100% of the time\\n\\n// Try some different percentages with values between 0 and 1",\n "112-chance-list": "// === TUTORIAL 112: Chance List ===\\n// It is also possible to add these chances in a list\\n// This helps to create more complex rhythms with small variations\\n\\nlist hatBeat [1 0.1 0.9 0.2]\\nnew sample hat_909 time(1/16) play(hatBeat)\\n// plays 100%, 10%, 90% and 20% in a sequence\\n\\nlist kickBeat [1 0.05]\\nnew sample kick_909 time(1/4) play(kickBeat)\\n// plays 90% and then 5% of the time\\n\\nnew sample clap_909 time(1 7/8)\\n\\n// Try to make other lists of probabilities",\n "113-speed": "// === TUTORIAL 113: Speed ===\\n// With the playback speed you do not affect the tempo, \\n// but instead the pitch of the sound (higher or lower)\\n// You can use this to create melodic like patterns\\n\\nlist pitch [1 0.5 0.25 1 2]\\nnew sample pluck_a time(1/8) speed(pitch)\\n\\n// Try some different values like 0.3, 1.8, 3.14, 11.16",\n "114-soundscape": "// === TUTORIAL 114: Soundscape ===\\n// We can combine multiple sounds with different \\n// speeds to create a kind of soundscape\\n\\nnew sample gong_hi time(4) speed(0.3)\\nnew sample bowl_hi time(3) speed(0.125)\\nnew sample drone_cymbal time(7) speed(0.25)\\n\\n// Experiment with different time and speed values\\n// You can use lists for the speed to even more create variations",\n "115-shape": "// === TUTORIAL 115: Shape ===\\n// Some samples sound quite long. We can make longer samples \\n// shorter with the shape() method, setting a fade-in \\n// and fade-out time in milliseconds\\n\\nnew sample harp_down time(1/3) shape(1 100)\\nnew sample bowl_hi time(1) shape(1000 2)\\n\\n// Try some different settings to hear the difference",\n "116-shape-list": "// === TUTORIAL 116: Shape List ===\\n// We can also use a list to change the length of fade-in \\n// and fade-out sequentially\\n\\nlist fadeIn [2 2 500]\\nlist fadeOut [20 20 100 20 500]\\nnew sample harp_down time(1/4) shape(fadeIn fadeOut)\\n\\n// Try some different values in the lists",\n "117-position": "// === TUTORIAL 117: Start Position ===\\n// For longer samples it can be useful to start the playback \\n// of the sound at a different position within the sample\\n// You can do that with the start() function by giving a \\n// value between 0 and 1 (0.5 is halfway through the sound)\\n\\nlist positions [0.7 0.2 0.3 0.2 0.5 0.1]\\nnew sample choir_01 time(1/8) start(positions) shape(1 100 1)\\n\\n// The list contains different starting positions in % of \\n// the length of the sound",\n "118-panning": "// === TUTORIAL 118: Panning ===\\n// We can make the composition sound more interesting by using the \\n// stereo field from our speakers (called panning).\\n// We can place a sound left with -1, right with 1 and center with 0\\n\\nnew sample violin_c time(1) pan(-1)\\nnew sample pluck_e time(1 3/16) pan(1)\\nnew sample bamboo_g time(1 4/16) pan(0)\\n\\n// Try some different values for the panning between -1 and 1",\n "119-panning-list": "// === TUTORIAL 119: Panning List ===\\n// Is with many functions we\'ve seen so far we can also \\n// use a list for the panning. Or use the argument \'random\' \\n// to randomize the panning\\n\\nlist panning [-1 -0.75 -0.5 -0.25 0 0.25 0.5 0.75 1]\\nnew sample hat_808 time(1/16) pan(panning)\\n// this sound will move from left to right\\n\\nnew sample tabla_mid time(1/4) pan(random)\\n// this sound will play at a random position in the stereofield",\n "120-volume": "// === TUTORIAL 120: Volume ===\\n// Sometimes you want some sounds to sound louder or softer \\n// than others. For this we can use the gain() method. \\n// A gain of 0 is off, a gain of 1 is the original volume \\n// of the soundfile, a gain of 2 is 2x louder (be careful!).\\n\\nnew sample wood_hit gain(0.8) pan(-1)\\nnew sample scrape gain(0.6)\\nnew sample wood_plate gain(0.7) pan(1)\\n\\n// Try some different values for the gain but be careful with\\n// values above 1!",\n "121-volume-list": "// === TUTORIAL 121: Volume List ===\\n// With a volume list we can change the volume over time\\n// to create more dynamics in the sound and make it more \\"human\\"\\n\\nlist dynamics [0.1 0.4 0.9 0.3 0.15 0.8 0.7 0.1]\\nlist sounds [tabla_hi tabla_hi_short tabla_mid]\\nnew sample sounds time(1/16) gain(dynamics)\\n\\n// Try some different list values",\n "122-time-divide": "// === TUTORIAL 122: Time Divide ===\\n// The timediv() method allows you to subdivide the timing \\n// into smaller portions based on a list of integer numbers\\n// The values from other lists are still inremented as they\\n// would when regularly playing the instrument\\n\\nset tempo 110\\n\\nnew sample hat_808 time(1/8) timediv([1 1 2 1 3 1 4 1])\\nnew sample [kick_808_dist snare_808] time(1/2) timediv([1 1 1 4]) play([1 1 0 0 0 1 1])\\n\\n// Try some different list values",\n "123-humanize": "// === TUTORIAL 122: Humanize ===\\n// Humanize the playback of an instrument with the human()\\n// method. The argument is a delay range in milliseconds with\\n// which the trigger of the sound is randomly delayed or rushed\\n\\nset tempo 110\\n\\nnew sample hat_808 time(1/16) human(10)\\nnew sample [kick_808_dist snare_808] time(1/2) human(100)\\n\\n// Try some different list values",\n "124-note-&-tune": "// === TUTORIAL 124: Note & Tune ===\\n// It is also possible to change the pitch of a sample with the \\n// note() function, similar to the note function in a synth \\n// (see tutorial 203). In the case the sample is not recorded at \\n// c4 (midi 60, 261.626Hz) you\'ll have to set the tune() in order \\n// to get the correct pitch transposition. Any adjustments to speed() \\n// will also affect the audible pitch together with note().\\n\\nset scale dorian eb\\nset tempo 100\\n\\nnew sample kalimba_a time(1/4) note([0 7 5 3] 2) tune(a3)\\nnew sample piano_e time(1/4 1/8) note([0 9 12 10 7 3] 1) tune(e3)\\n\\n// Try other samples to hear the melody and adjust the tune accordingly",\n "125-name-instruments": "// === TUTORIAL 125: Name Instruments ===\\n// Instruments can have a name. Giving the instrument a name gives two advantages:\\n// 1. Parameters can be set for the instrument on another line with `set <name>`\\n// 2. Re-evaluating code will transfer the current count to the new instrument.\\n// This will preserve continuity while sequencing (long) lists, instead\\n// of hearing the counter reset every time code is evaluated\\n\\nset tempo 100\\nset scale minor\\n\\nlist notes spread(13 0 24)\\nlist rhythm euclid(16 13)\\nnew synth saw note(notes 0) time(1/16) play(rhythm) name(synthy)\\n\\n// these parameters are send to the synth named \\"synthy\\"\\nset synthy fx(filter low 3000 0.3) fx(degrade 0.4) fx(delay)\\n\\n// try evaluating the code multiple times to hear the pattern does not reset",\n "201-synth": "// === TUTORIAL 201: Synth ===\\n// Instead of playing samples we can also create a synthesizer\\n// (synth) with \'new synth\' that generates a sound based on \\n// various types of waveforms\\n\\nnew synth saw\\n// new synth sine\\n// new synth square\\n// new synth triangle\\n\\n// Try these different types of synths by (un)commenting",\n "202-synth-time": "// === TUTORIAL 202: Synth Time ===\\n// Many of the functions from the \'sample\' can also be \\n// applied to the synth, for example with the time()\\n// we can choose the time interval it is triggered at\\n\\nnew synth saw time(1/8)\\n\\n// Try also: play(), gain(), pan() combined with lists\\n// See tutorials 106, 107, 110, 111, 112, 118, 120",\n "203-note": "// === TUTORIAL 203: Note ===\\n// To choose a note to play for the synth we use the note() \\n// function. This function expects a number as a semitone (half-step)\\n// on the piano-keyboard. The numbers can be positive or negative.\\n\\nnew synth saw time(1) note(0)\\nnew synth saw time(1 1/16) note(3)\\nnew synth saw time(1 3/16) note(7)\\n\\n// Try different note numbers like: -5, 12, 3.14",\n "204-melody": "// === TUTORIAL 204: Melody ===\\n// Similar to how we create a list for a rhythm we can\\n// also create a list of notes to create a melody\\n\\nset tempo 137\\n\\nlist melody [0 7 12 19 15 12 5 3 7 5 2]\\nnew synth saw time(1/16) note(melody)\\n\\n// Try some different values for the list to create \\n// other melodies",\n "205-octave": "// === TUTORIAL 205: Octave ===\\n// With a second argument in the note() function we can choose\\n// an octave offset. Stepping up one octave is the same as\\n// adding 12 to the semitone.\\n\\nset tempo 137\\n\\nlist theMelody [0 7 5 3 7 5 2]\\nlist theOctaves [0 0 0 1 1 1 2 2 2]\\nnew synth saw time(1/16) note(theMelody theOctaves)\\n\\n// Here the octave is changed every 3 notes",\n "206-scales": "// === TUTORIAL 206: Scales ===\\n// In many styles of music it is common to not use all the\\n// notes that are available to us (like all the keys on the piano)\\n// But instead use a subset of those notes. This is called a scale.\\n// The scale usually gives a certain feeling to the sound.\\n// For example major=happy and minor=sad (oversimplification)\\n\\nset tempo 115\\nset scale major\\n\\nlist melody [0 1 2 3 4 5 6 7 8 9 10 11 12]\\nnew synth saw time(1/16) note(melody 2)\\n\\n// Try changing the scale from major to minor and hear the difference\\n// You hear some notes twice, because some values between 0-12 \\n// don\'t fit in the scale, so they\'re shifted to the closest value\\n// that does belong to the scale",\n "207-more-scales": "// === TUTORIAL 207: More Scales ===\\n// There are many scales to choose from. If you like to see the \\n// complet entire list you can get it with scaleNames()\\n// Then \'print\' the list to the console\\n\\nlist scales scaleNames()\\nprint scales\\n\\nset tempo 143\\nset scale romanian_minor\\n\\nlist melody [12 11 10 9 8 7 6 5 4 3 2 1 0]\\nnew synth square time(1/16) note(melody 1)\\n\\n// Try some names of the scales you see in the console",\n "208-root": "// === TUTORIAL 208: Root ===\\n// A scale starts at a specified note. This note is the root.\\n// By default this root is a \'c\', but you can choose other roots\\n// like d, f#, gb etc. \\n\\nset tempo 97\\nset scale minor_pentatonic gb\\n\\nlist melody [12 11 10 9 8 7 6 5 4 3 2 1 0]\\nnew synth square time(1/16) note(melody 1)\\n\\n// Try some of the different roots to hear the difference",\n "209-synth-shape": "// === TUTORIAL 209: Synth Shape ===\\n// The shape() method for the synth allows us to create a longer\\n// or shorter sound with a fade-in/fade-out. We can also set \\n// the shape(off) resulting in a never stopping sound.\\n\\nnew synth triangle time(1/4) shape(1 1/16) note(0 2)\\nnew synth triangle time(1) shape(off)\\nnew synth triangle time(1/2) shape(1/4 10) note(0 1)",\n "210-synth-shape-list": "// === TUTORIAL 210: Synth Shape List ===\\n// And as you might have expected by now we can also use a \\n// list to modulate the length from the fade-in and fade-out times\\n\\nlist fadeOut [20 20 100 20 200 500]\\nnew synth saw time(1/16) shape(2 fadeOut)\\n// here the synth has an attack of 2 ms and a release depending on the list",\n "211-super-synth": "// === TUTORIAL 211: Super Synth ===\\n// The super synth is a synth that uses multiple\\n// waveforms at the same time with a small detuning to \\n// create a more richer sound\\n\\nnew synth saw time(1/16) super(0.142 3) shape(1 80 1)\\n\\n// Try different amounts of voices: 3, 5, 11\\n// Try different detunings: 1.021, 7.245, 12.032",\n "212-filter": "// === TUTORIAL 212: Filter ===\\n// The sound of the synth is still very bright. Most synths \\n// therefore use a filter to change the color of the sound. \\n// This can be done with the `fx(filter)`, the `fx()` is an \\n// effect function that allows us to change the sound in \\n// various ways. Read more about FX in chapter 3.\\n\\nnew synth saw time(1/16) fx(filter low 1200 0.6) shape(1 100)\\n// This filter removes high frequencies above 1200Hz (lowpass)\\n// And has a little resonance on the cutoff frequency\\n// Resonance results in a whistling sounding effect\\n// Try changing the 1200 to other values between 100-16000\\n// and the 0.6 to other values between 0.1 and 0.9",\n "213-filter-modulation-1": "// === TUTORIAL 213: Filter Modulation ===\\n// We can modulate the cutoff frequency and the resonance\\n// of the filter with values from two different lists\\n// Make sure the cutoffs are values between 50 and 18000 (Hz)\\n// and the resonance are values between 0 and 1\\n\\nlist cutoffs [200 400 700 1000]\\nlist qs [0.3 0.3 0.3 0.3 0.8]\\n\\nnew synth saw time(1/16) fx(filter low cutoffs qs) shape(1 80)\\n\\n// Try some different values for both",\n "213-filter-modulation-2": "// === TUTORIAL 213: Filter Modulation 2 ===\\n// We can make even more interesting filter modulations by adding\\n// a few extra arguments to the filter fx function.\\n// When doing that we can choose a low and high frequency range\\n// between which a sinewave, sawtooth up or sawtooth down can modulate\\n// The modulation time is designed by the division argument\\n\\nlist nts spread(5 0 12)\\nnew synth saw time(1/2) note(nts) shape(off) fx(filter low 1/1 100 4000 0.8)\\n// this filter modulates up and down once per bar between 100 and 4000 Hz with resonance 0.8\\n\\nnew synth saw time(1/16) note(nts 1) shape(off) fx(filter low 1/16 200 6000 0.6 0 0.05)\\n// this filter modulates down every 1/16 note from 6000 to 200 Hz with resonance of 0.6\\n// the 0.2 determins the slope curve the filter goes up/down with (try 0.05 and 1 to hear the difference)\\n\\n// arguments:\\n// fx(filter <type> <division> <low> <high> <resonance> <direction> <slope-curve>)",\n "213-filter-modulation": "// === TUTORIAL 213: Filter Modulation ===\\n// We can modulate the cutoff frequency and the resonance\\n// of the filter with values in a list\\n\\nlist cutoffs [200 400 700 1000]\\nlist qs [0.3 0.3 0.3 0.3 0.8]\\n\\nnew synth saw time(1/16) fx(filter low cutoffs qs) shape(1 80)\\n\\n// Try some different values for both",\n "214-note-slide": "// === TUTORIAL 214: Note Slide ===\\n// With the \'slide()\' function we can slide the pitch \\n// from one note to another (called portamento) in a specified\\n// amount of time (division or milliseconds)\\n\\nset tempo 123\\nset scale minor b\\n\\nlist bassLine repeat([3 2 0 -7] 4)\\nnew synth saw note(bassLine 0) shape(2 250) time(1/4) slide(1/8)\\n\\n// Try some different values for both",\n "220-polyphonic-synth": "// === TUTORIAL 220: polySynth ===\\n// The polySynth is a polyphonic synthesizer, this allows you\\n// to play overlapping notes or notes at the same time to generate\\n// chord progressions\\n\\nset tempo 80\\nset scale major c\\n\\n// a 2-dimensional list of notes plays all the notes at the same time\\nlist chord [ [0 4 5 7 8 10 12] ]\\nnew polySynth sine note(chord 2) time(1/2) shape(1 1/4) \\n\\n// Try some different values for to generate more chords",\n "221-chord-progression": "// === TUTORIAL 221: Chord Progression ===\\n// With the chordsFromNumerals function you can generate a\\n// 2-dimensional list containing the notes for the chords you specify\\n// Chords are numbered I to VII. Adding an \'m\' makes them minor\\n// It is also possible to add the 7, 9, 11 or 13th\\n\\nset tempo 100\\n// we can set the scale to none to allow all the notes to be played\\nset scale none\\n\\n// a chord progression in the style of the 4-chord-song\\nlist progression chordsFromNumerals([I IV V VIm])\\n// see in the console that the result is a 2d-list\\nprint progression\\n\\nnew polySynth sine note(progression 2) time(1/1) shape(1 3/4 1/4) \\n\\n// Try some different numerals to hear how the chords change",\n "222-overlapping-notes": "// === TUTORIAL 222: Overlapping Notes ===\\n// We can also generate a list of notes for an arpeggiator and\\n// let the notes overlap by creating a longer length than \\n// the space in between the notes\\n\\nset tempo 110\\nset scale none\\n\\n// here the chord progression is repeated 4 times and flattened into a 1d list\\nlist progression flat(repeat(chordsFromNumerals([I IV V VIm]) 4))\\nprint progression\\n\\n// hear how some of the notes are not played when we turn voice stealing off.\\n// You can change this by setting voice-stealing to \'on\', this is the default\\nnew polySynth sine note(progression 2) time(1/12) shape(1 1/1) steal(off)\\n",\n "223-polyphonic-sample": "// === TUTORIAL 223: Polyphonic Sample ===\\n// The polySample is a polyphonic sample player, allowing you to play\\n// overlapping sounds and also play notes with those sounds.\\n// \\n\\nset tempo 110\\nset scale none\\n\\n// here the chord progression is repeated 4 times and flattened into a 1d list\\nlist progression flat(repeat(chordsFromNumerals([I7 IV7 V7 VIm7]) 4))\\nprint progression\\n\\n// With the sample it is important to have voice stealing \'on\' when the shape is\\n// turned off. Otherwise all the voices will stay busy because there is no \\"fade-out\\"\\nnew polySample bamboo_g name(polySamp)\\n set polySamp note(progression 2) tune(67) time(1/16) shape(off) steal(on)\\n",\n "301-fx-delay": "// === TUTORIAL 301: FX Delay ===\\n// There are many different effects that can be added\\n// to your sounds. The Delay effect creates echos of the\\n// sound that slowly fade away in a rhythmic pattern\\n\\nset tempo 100\\nnew sample piano_g time(2) fx(delay 3/16 2/16 0.8)\\n\\n// The delay can have arguments for the left/right delaytimes\\n// in division. A decimal-point value 0-1 determines the amount of fade-out \\n// Try different delaytimes: 5/16, 3/4, 1/32, 1/12\\n// Try changing the values in the function to hear what happens\\n// It is also possible to modulate the parameters with lists",\n "302-fx-distortion": "// === TUTORIAL 302: FX Distortion ===\\n// With the distortion effect you can give the sound a crunchy\\n// quality, like it is sounding through a guitar amplifier\\n// fx(drive amount) - alias: distort\\n\\nset tempo 100\\n\\nlist amounts spread(5 10 50)\\nnew loop amen time(1) gain(0.6) fx(drive amounts)\\n\\n// Try changing the values in the function to hear what happens\\n// It is also possible to modulate the parameters with lists",\n "303-fx-reverb": "// === TUTORIAL 303: FX Reverb ===\\n// With the reverb effect you can place the sound in a \\n// small room or big church\\n\\nnew synth saw note(0 0) time(1) shape(1 1/4 1) fx(reverb 0.3 10)\\nnew synth saw note([0 3 7] 1) time(1/4) shape(1 1/32) fx(reverb 0.5 3)\\n\\n// The first decimal value determines the balance between original (dry)\\n// and reverb sound (wet). The second argument is the reverb time in \\n// seconds\\n// Try changing the values in the function to hear what happens\\n// It is also possible to modulate the parameters with lists",\n "304-fx-shift": "// === TUTORIAL 304: Pitch Shift ===\\n// With the pitch shifter effect you can change the pitch\\n// of a sound in semitones. Allowing you to make melodies with \\n// a single sample\\n\\nset scale harmonic_minor c\\nnew sample chimes time(1/8) fx(shift [0 3 2 -1 7 5]) shape(100)\\n\\n// The first argument is the pitch shift in semitones which is\\n// also mapped according to the scale that is set\\n// Try changing the values in the function to hear what happens\\n// It is also possible to modulate the parameters with lists",\n "305-fx-squash": "// === TUTORIAL 305: Squash ===\\n// The squash effect is also a type of distortion effect that\\n// compresses the sound a bit softer in the beginning but \\n// with higher values introduces some crunch also\\n// fx(squash amount)\\n\\nset tempo 115\\n\\nlist squashes [4 15 10 4 40]\\nnew sample kick_909 time(1/16) fx(squash squashes) shape(1 50)\\n\\n// Try changing the values in the function to hear what happens\\n// It is also possible to modulate the parameters with lists",\n "306-fx-set-all": "// === TUTORIAL 306: FX All ===\\n// It is possible to give multiple sounds the same effects\\n// by using the `set all` code\\n\\nnew sample kick_909 time(1/2)\\nnew sample hat_909 time(1/4 1/8)\\nnew synth saw time(3/16) note(0 1) shape(1 1/8) super(3 0.0423)\\n\\nset all fx(shift -12 0.5) fx(squash 70) fx(reverb 0.5 2)\\n\\n// Note that this actually creates individual effects for all the \\n// sounds. Meaning they can all have individual modulation speeds\\n// when using a list with arguments",\n "307-fx-filter-modulation": "// === TUTORIAL 307: FX Filter Modulation ===\\n// We can make even more interesting filter modulations by adding\\n// a few extra arguments to the filter fx function.\\n// When doing that we can choose a low and high frequency range\\n// between which a sinewave, sawtooth up or sawtooth down can modulate\\n// The modulation time is designed by the division argument\\n\\nlist nts spread(5 0 12)\\nnew synth saw time(1/2) note(nts) shape(off) fx(filter low 1/1 100 4000 0.8)\\n// this filter modulates up and down once per bar between 100 and 4000 Hz with resonance 0.8\\n\\nnew synth saw time(1/16) note(nts 1) shape(off) fx(filter low 1/16 200 6000 0.6 0 0.05)\\n// this filter modulates down every 1/16 note from 6000 to 200 Hz with resonance of 0.6\\n// the 0.2 determins the slope curve the filter goes up/down with (try 0.05 and 1 to hear the difference)\\n\\n// arguments:\\n// fx(filter <type> <division> <low> <high> <resonance> <direction> <slope-curve>)",\n "307-fx-filter": "// === TUTORIAL 307: FX Filter ===\\n// The filter is a simple filter where the first argument sets the type of the \\n// filter such as low(pass), band(pass) and hi(pass). The second argument sets \\n// the cutoff frequency with a number or list. The third argument changes the \\n// resonance (Q)\\n\\nnew synth saw shape(off) time(1/4) fx(filter low [8000 400 2000 200] [0.2 0.5 0.8])\\n// Try changing the values in the function to hear what happens\\n// It is also possible to modulate the parameters with lists\\n\\n// NOTE: cutoff ramptime in milliseconds is deprecated, now use modulation \\n// filter or triggerFilter !!!",\n "308-fx-trigger-filter": "// === TUTORIAL 307: FX Trigger Filter ===\\n// The trigger filter is a filter where the cutoff frequency is \\n// driven by an envelope (shape). The filter is triggered every time\\n// the note is played. \\n// Set the filter type: lowpass, highpass or bandpass.\\n// Set the attack and release times in milliseconds or relative to the tempo.\\n// Set the high and low frequency points between which the envelope moves.\\n\\nnew synth saw note(0 0) time(1/1) shape(off) fx(triggerFilter low 1/4 3/4 5000 100)\\n\\n// Try changing the values in the function to hear what happens\\n// It is also possible to modulate the parameters with lists",\n "309-fx-compress": "// === TUTORIAL 308: FX Compressor ===\\n// A compressor allows you to reduce the dynamic range of a synth or sample.\\n// The signals volume gets reduced by a specified ratio when it crosses \\n// the threshold\\n// Set the threshold in dBFS (-100 to 0, default = -30)\\n// Set the compression ratio (20 to 0, default = 6)\\n// Set the attack and release time in milliseconds or relative to tempo\\n\\nnew loop amen time(1) fx(compress -20 5 5 50)\\n\\n// Try changing the values in the fx function to hear what happens\\n// It is also possible to modulate the parameters with lists",\n "310-fx-degrade": "// === TUTORIAL 310: FX Degrade ===\\n// A Downsampling Chiptune effect. Downsamples the signal by a specified amount\\n// Resulting in a lower samplerate, making it sound more like 8bit/chiptune\\n// fx(degrade amount) - alias: chip\\n\\nlist degrades spreadF(16 0.5 0.9)\\nnew sample choir_o time(1/4) shape(off) fx(degrade degrades)\\n\\n// Try changing the values in the fx function to hear what happens\\n// It is also possible to modulate the parameters with lists",\n "311-fx-chorus": "// === TUTORIAL 311: FX Chorus / Double ===\\n// A Chorus and Doubling effect. The Chorus creates 2 copies of the sound.\\n// One on the left and one right. These copies slowly change in time creating\\n// modulating effects that make the sound more wider.\\n// Use the parameters modulation time (division), depth (ms) and wetdry (0-1)\\nnew synth saw note(spread(5 0 12) 1) time(1/4) shape(1 1/2) fx(chorus 8/1 40 0.5) \\n\\n// The double effect does the same but removes the original from the center (wet = 1)\\n// Giving the effect of hearing 2 instruments.\\nnew sample snare_909 time(1/2 1/4) speed(0.6) fx(double)\\n\\n// Try changing the values in the fx function to hear what happens\\n// It is also possible to modulate the parameters with lists",\n "312-fx-vowel": "// === TUTORIAL 312: FX Vowel ===\\n// With the vowel effect you can let an instrumt \\"speak\\". The effect is a\\n// filter that mimics the resonant frequencies of vowels in the human speech, \\n// like \\"o\\", \\"a\\", \\"u\\", \\"i\\", etc. You can sequence the vowels by putting them in \\n// a list. You can also let the instrument slide between the vowels, shift the \\n// vowel frequencies with a ratio parameter, and lastly you can adjust the \\n// wet-dry balance\\n\\nset tempo 110 \\n\\n// choose some random vowels\\nlist vowels choose(8 [o a i e u ])\\n// the effect works best on spectrally rich sounds, like synths and noise\\nnew synth saw name(talk)\\n set talk shape(1 1/8) time(1/8)\\n\\t// add the effect with the vowel list and slide time\\n set talk fx(vowel vowels 1/4)\\n\\n// But the effect can also sound interesting on samples like drums!\\nlist drms choose(16 [kick_808 metal snare_808 hat_808 tom_808])\\nnew sample drms time(1/16) fx(vowel vowels)\\n",\n "400-algorithms": "// === TUTORIAL 400: Algorithmic Composition ===\\n// This chapter discusses the algorithmic processes that can be used in \\n// Mercury. Mercury is heavily inspired by the composition technique Serialism. \\n// This technique approaches every musical parameter (rhythm, pitch, dynamics, \\n// etc) as an individual sequence of numbers. These sequences can then be \\n// transformed in many ways to extend and generate new musical material. \\n\\n// With algorithmic processes (functions) we can generate or transform lists. \\n// With the lists we can control the parameters in functions of instruments. By \\n// combining various list functions we can create more complex outputs.\\n\\n// This chapter will cover most of the algorithmic methods, but many unique \\n// combinations are up to you to discover!\\n\\n// A list is a collection of items (numbers, words) that has a unique name\\nlist myValues [1 2 3.14 6.18 kick_909 snare_808]\\n\\n// It is possible to print the content of a list. This is useful to view\\n// the result of list functions\\nprint myValues",\n "401-spread": "// === TUTORIAL 401: Spread ===\\n// Generate a list of n-length containing whole numbers\\n// Starting at x and ending at y (excluding y)\\n// spread(size low high)\\n\\n// Useful for melodies and ascending/descending number\\n// sequences for modulation of for example note-length\\n\\nlist melody spread(5 0 12)\\nlist length spread(7 500 20)\\nprint melody length\\n\\nnew synth saw note(melody 1) time(1/16) shape(1 length)",\n "402-spreadinclusive": "// === TUTORIAL 402: Spread Inclusive ===\\n// Generate a list of n-length containing whole numbers\\n// Starting at x and ending at y (including y)\\n// spreadInclusive(size low high)\\n\\n// Useful for melodies and ascending/descending number\\n// sequences for modulation of for example note-length\\n\\nlist melody spreadInclusive(5 0 12)\\nlist length spreadInclusive(7 500 20)\\nprint melody length\\n\\nnew synth saw note(melody 1) time(1/16) shape(1 length)",\n "403-spread-float": "// === TUTORIAL 403: Spread Float ===\\n// Generate a list of n-length containing floating-point numbers\\n// Starting at x and ending at y (excluding y)\\n// spreadFloat(size low high) (alias: spreadF)\\n// spreadInclusiveFloat(size low high) (alias: spreadInclusiveF)\\n\\n// Useful for parameters that are based on floating-point numbers\\n// such as sequences for modulation of for example gain and panning\\n\\nlist volume spreadF(16 0 1)\\nlist panning spreadInclusiveF(7 -1 1)\\nprint volume panning\\n\\nnew synth saw note(0 1) time(1/16) shape(1 80) pan(panning) gain(volume)",\n "404-fill": "// === TUTORIAL 404: Fill ===\\n// Fill a list with values and a number of repetitions. The values\\n// are provided in pairs of number, amount. \\n// fill(value1 amount1 value2 amount2 etc...)\\n\\n// Useful for creating longer lists with a lot of duplicate values\\n\\nlist melody fill(0 4 7 2 3 4 12 2 9 4 3 2 2 2)\\nprint melody\\n\\nnew synth sine note(melody 2) time(1/16)",\n "405-euclidean-rhythm": "// === TUTORIAL 405: Euclidean Rhythm ===\\n// Generate a euclidean rhythm. The algorithm evenly spaces n-beats over \\n// n-steps, return a list of 1\'s and 0\'s. Inspired by Godfried Toussaints\\n// famous paper \\"The Euclidean Algorithm Generates Traditional Musical Rhythms\\".\\n// euclidean(steps, beats, rotate) (alias: euclid)\\n\\n// Useful for generating intricate rhythmical patterns with the play() function\\n\\nset tempo 130\\nlist rhythm1 euclid(16 5)\\nlist rhythm2 euclid(8 5)\\nprint rhythm1 rhythm2\\n\\nnew sample bongo time(1/16) play(rhythm1)\\nnew sample bongo_lo time(1/16) play(rhythm2) ",\n "406-hexadecimal-rhythm": "// === TUTORIAL 406: Hexadecimal Rhythm ===\\n// Hexadecimal beats make use of hexadecimal values (0 - f) that are a base-16\\n// number system. Because one digit in a base-16 number system has 16 possible\\n// values (0 - 15) these can be converted to 4 bits that therefore can be seen \\n// as groups of 4 16th notes. These hexadecimal values will then represent any \\n// permutation of 1\'s and 0\'s in a 4 bit number, where 0 = 0 0 0 0, 7 = 0 1 1 \\n// 1, b = 1 0 1 1, f = 1 1 1 1 and all possible values in between.\\n\\n// Useful for generating intricate rhythmical patterns with the play() function\\n\\nset tempo 130\\nlist rhythm1 hex(\'f02c\')\\nlist rhythm2 hex(\'094a\')\\nprint rhythm1 rhythm2\\n\\nnew sample bongo time(1/16) play(rhythm1)\\nnew sample bongo_lo time(1/16) play(rhythm2)",\n "407-fibonacci": "// === TUTORIAL 407: Fibonacci Numbers ===\\n// Generate a list of Fibonacci numbers F[n] = F[n-1] + F[n-2]. The fibonacci \\n// sequence is famous because it\'s numbers pop up in nature in many places \\n// and when you divide any number in the sequence by its previous number it \\n// converges towards the golden ratio (phi, 1.618)\\n// fibonacci(amount)\\n// fibonacci(amount, starting number)\\n\\n// Useful as a starting point for melodic content or modulation of parameters\\n\\nlist melody fibonacci(9)\\nlist cutoff fibonacci(8 12)\\nprint melody cutoff\\n\\nnew synth saw note(melody 1) time(1/8) shape(off) fx(filter cutoff)",\n "408-pisano-periods": "// === TUTORIAL 408: Pisano Periods ===\\n// Generate Pisano periods from the Fibonacci sequence. The pisano period is a\\n// result of applying a modulo (%) operation on the Fibonacci sequence \\n// F[n] = (F[n-1] + F[n-2]) mod a. The length of the period differs per modulus\\n// value, but the sequence will always repeat.\\n\\n// Useful as a starting point for melodic content or modulation of parameters\\n\\nlist melody pisano(13)\\nprint melody\\n\\nnew synth sine note(melody 2) time(1/16)",\n "409-chord-lists": "// === TUTORIAL 442: Translate Time ===\\n// Generate 2-dimensional arrays of relative notevalues that can \\n// be used as chord information or flattened to generate melodic\\n// progressions based on chords\\n// chordsFromNumerals(list)\\n\\n// Convert a chord progression from roman numerals to semitones\\n// alias: makeChords()\\nprint chordsFromNumerals([I IIm IVsus2 V7 VIm9])\\n\\n// Convert a chord progression from chordnames to semitones\\nprint chordsFromNames([C Dm Fsus2 G7 Am9])\\n\\nset scale chromatic c\\nlist chords flatten(chordsFromNumerals(repeat([I7 IV7sus2 IIm7 V7] 2)))\\nprint chords \\n\\nnew synth saw note(chords 1) time(1/16)",\n "410-random": "// === TUTORIAL 410: Random ===\\n// Generate a list of n-length containing random values \\n// of whole numbers between low and high value (excluding high)\\n// Note that any time you evalute the code the random numbers are \\n// different. See \\"randomseed\\" for a solution to this issue.\\n// random(size low high)\\n\\n// Useful to generate random sequences for melodies and any parameter\\n\\nlist melody random(8 0 12)\\nlist cutoff random(5 300 4000)\\nlist length random(4 80 300)\\nprint melody cutoff length\\n\\nnew synth saw note(melody 1) time(1/8) shape(1 length) fx(filter cutoff)",\n "411-random-seed": "// === TUTORIAL 411: Random Seed ===\\n// Set the seed for the Random Number Generator (RNG). A value of 0 sets to \\n// unpredictable seeding. Seeding the RNG results in predictable psuedo\\n// random numbers that give the same result every time the code is\\n// evaluated.\\n// randomSeed anyValue\\n\\n// Us