diff --git a/404.html b/404.html index 22543b5a..edb591f9 100644 --- a/404.html +++ b/404.html @@ -4,7 +4,7 @@ Page Not Found | Mercury - + diff --git a/assets/js/bbca2b71.4f690aec.js b/assets/js/bbca2b71.c97cfd78.js similarity index 88% rename from assets/js/bbca2b71.4f690aec.js rename to assets/js/bbca2b71.c97cfd78.js index 70d0eccf..416d05db 100644 --- a/assets/js/bbca2b71.4f690aec.js +++ b/assets/js/bbca2b71.c97cfd78.js @@ -1 +1 @@ -"use strict";(self.webpackChunkmercury_docs=self.webpackChunkmercury_docs||[]).push([[283],{9030:(e,n,s)=>{s.r(n),s.d(n,{assets:()=>o,contentTitle:()=>l,default:()=>h,frontMatter:()=>r,metadata:()=>d,toc:()=>a});var i=s(4848),t=s(8453);const r={sidebar_position:3},l="Instrument Functions",d={id:"reference/instruments",title:"Instrument Functions",description:"An instrument is the main sound or sequencing source in Mercury. Instruments can produce sounds natively in Mercury by means of synthesis or sampling, but can also send out MIDI or OSC-messages to trigger external devices or plugins, and are able to take input from for example your microphone. The following functions apply to all the types of instruments such as synth, sample, loop, polySynth, polySample, midi, osc and input.",source:"@site/docs/reference/instruments.md",sourceDirName:"reference",slug:"/reference/instruments",permalink:"/mercury/docs/reference/instruments",draft:!1,unlisted:!1,tags:[],version:"current",sidebarPosition:3,frontMatter:{sidebar_position:3},sidebar:"tutorialSidebar",previous:{title:"Global Settings",permalink:"/mercury/docs/reference/global"},next:{title:"Instrument Effects",permalink:"/mercury/docs/reference/effects"}},o={},a=[{value:"All Instruments",id:"all-instruments",level:2},{value:"name",id:"name",level:3},{value:"group",id:"group",level:3},{value:"time",id:"time",level:3},{value:"once",id:"once",level:3},{value:"play",id:"play",level:3},{value:"shape",id:"shape",level:3},{value:"gain",id:"gain",level:3},{value:"pan",id:"pan",level:3},{value:"effect",id:"effect",level:3},{value:"ratchet",id:"ratchet",level:3},{value:"timediv",id:"timediv",level:3},{value:"warp",id:"warp",level:3},{value:"wait",id:"wait",level:3},{value:"synth",id:"synth",level:2},{value:"note",id:"note",level:3},{value:"slide",id:"slide",level:3},{value:"super",id:"super",level:3},{value:"wave2",id:"wave2",level:3},{value:"sub",id:"sub",level:3},{value:"noise",id:"noise",level:3},{value:"sample",id:"sample",level:2},{value:"speed",id:"speed",level:3},{value:"start",id:"start",level:3},{value:"note",id:"note-1",level:3},{value:"tune",id:"tune",level:3},{value:"stretch",id:"stretch",level:3},{value:"loop",id:"loop",level:2},{value:"polySynth",id:"polysynth",level:2},{value:"steal",id:"steal",level:3},{value:"spread",id:"spread",level:3},{value:"voices",id:"voices",level:3},{value:"polySample",id:"polysample",level:2},{value:"midi",id:"midi",level:2},{value:"note",id:"note-2",level:3},{value:"length",id:"length",level:3},{value:"channel",id:"channel",level:3},{value:"chord",id:"chord",level:3},{value:"program",id:"program",level:3},{value:"change",id:"change",level:3},{value:"sync",id:"sync",level:3},{value:"input",id:"input",level:2},{value:"osc",id:"osc",level:2},{value:"receiving",id:"receiving",level:3},{value:"modulator",id:"modulator",level:2},{value:"name",id:"name-1",level:3},{value:"time",id:"time-1",level:3},{value:"range",id:"range",level:3},{value:"out",id:"out",level:3},{value:"trigger",id:"trigger",level:3},{value:"hold",id:"hold",level:3},{value:"emitter",id:"emitter",level:2}];function c(e){const n={a:"a",admonition:"admonition",code:"code",em:"em",h1:"h1",h2:"h2",h3:"h3",li:"li",mdxAdmonitionTitle:"mdxAdmonitionTitle",p:"p",pre:"pre",strong:"strong",table:"table",tbody:"tbody",td:"td",th:"th",thead:"thead",tr:"tr",ul:"ul",...(0,t.R)(),...e.components};return(0,i.jsxs)(i.Fragment,{children:[(0,i.jsx)(n.h1,{id:"instrument-functions",children:"Instrument Functions"}),"\n",(0,i.jsxs)(n.p,{children:["An instrument is the main sound or sequencing source in Mercury. Instruments can produce sounds natively in Mercury by means of synthesis or sampling, but can also send out MIDI or OSC-messages to trigger external devices or plugins, and are able to take input from for example your microphone. The following functions apply to all the types of instruments such as ",(0,i.jsx)(n.code,{children:"synth"}),", ",(0,i.jsx)(n.code,{children:"sample"}),", ",(0,i.jsx)(n.code,{children:"loop"}),", ",(0,i.jsx)(n.code,{children:"polySynth"}),", ",(0,i.jsx)(n.code,{children:"polySample"}),", ",(0,i.jsx)(n.code,{children:"midi"}),", ",(0,i.jsx)(n.code,{children:"osc"})," and ",(0,i.jsx)(n.code,{children:"input"}),"."]}),"\n",(0,i.jsxs)(n.p,{children:["For detailed explanation of the syntax see: ",(0,i.jsx)(n.a,{href:"syntax",children:"Syntax"})," and ",(0,i.jsx)(n.a,{href:"actions#list",children:(0,i.jsx)(n.code,{children:"list"})})," under ",(0,i.jsx)(n.a,{href:"actions",children:"Actions"}),"."]}),"\n",(0,i.jsx)(n.p,{children:(0,i.jsx)(n.strong,{children:"Available instruments:"})}),"\n",(0,i.jsxs)(n.ul,{children:["\n",(0,i.jsx)(n.li,{children:(0,i.jsx)(n.a,{href:"#synth",children:(0,i.jsx)(n.code,{children:"synth"})})}),"\n",(0,i.jsx)(n.li,{children:(0,i.jsx)(n.a,{href:"#sample",children:(0,i.jsx)(n.code,{children:"sample"})})}),"\n",(0,i.jsx)(n.li,{children:(0,i.jsx)(n.a,{href:"#loop",children:(0,i.jsx)(n.code,{children:"loop"})})}),"\n",(0,i.jsx)(n.li,{children:(0,i.jsx)(n.a,{href:"#polysynth",children:(0,i.jsx)(n.code,{children:"polySynth"})})}),"\n",(0,i.jsxs)(n.li,{children:[(0,i.jsx)(n.a,{href:"#polysample",children:(0,i.jsx)(n.code,{children:"polySample"})})," ",(0,i.jsx)(n.em,{children:"MercuryPlayground only"})]}),"\n",(0,i.jsx)(n.li,{children:(0,i.jsx)(n.a,{href:"#input",children:(0,i.jsx)(n.code,{children:"input"})})}),"\n",(0,i.jsx)(n.li,{children:(0,i.jsx)(n.a,{href:"#midi",children:(0,i.jsx)(n.code,{children:"midi"})})}),"\n",(0,i.jsx)(n.li,{children:(0,i.jsx)(n.a,{href:"#osc",children:(0,i.jsx)(n.code,{children:"osc"})})}),"\n",(0,i.jsxs)(n.li,{children:[(0,i.jsx)(n.a,{href:"#modulator",children:(0,i.jsx)(n.code,{children:"modulator"})})," ",(0,i.jsx)(n.em,{children:"Mercury4Max only"})]}),"\n"]}),"\n",(0,i.jsx)(n.h2,{id:"all-instruments",children:"All Instruments"}),"\n",(0,i.jsx)(n.p,{children:"The following functions apply to all instruments."}),"\n",(0,i.jsx)(n.h3,{id:"name",children:"name"}),"\n",(0,i.jsxs)(n.p,{children:["Set the ",(0,i.jsx)(n.code,{children:"name"})," for this instrument. This can be any string of 3 or more characters. The ",(0,i.jsx)(n.code,{children:"name"})," is used as a reference to the instrument when the ",(0,i.jsx)(n.code,{children:"set"})," action is used to call functions for a specific instrument. The name is also used to generate an OSC-message that is send out from Mercury to trigger external things in sync with the instrument."]}),"\n",(0,i.jsx)(n.p,{children:(0,i.jsx)(n.strong,{children:"arguments"})}),"\n",(0,i.jsxs)(n.ul,{children:["\n",(0,i.jsxs)(n.li,{children:[(0,i.jsx)(n.code,{children:"Name"})," -> an instrument name (default=random character string)"]}),"\n"]}),"\n",(0,i.jsx)(n.pre,{children:(0,i.jsx)(n.code,{className:"language-js",children:"new synth saw name(bob)\n set bob gain(0.8) time(1/16)\n\nnew sample kick_909 name(alice)\n set alice gain(1.2) time(1/4)\n"})}),"\n",(0,i.jsx)(n.pre,{children:(0,i.jsx)(n.code,{className:"language-js",metastring:'title="expected osc messages:"',children:"/bob 1\n/alice 1\n"})}),"\n",(0,i.jsxs)(n.p,{children:["The ",(0,i.jsx)(n.code,{children:"name"})," can also be used to receive a stereo signal from the specific instrument sound in a Max patch (",(0,i.jsx)(n.em,{children:"this feature only works in Mercury4Max"}),"). This can be helpful for recording a multi-track of your code, or when wanting to work with multichannel outputs."]}),"\n",(0,i.jsx)(n.pre,{children:(0,i.jsx)(n.code,{children:"[receive~ alice] <- receive a mono signal from alice in a max-patch\n[mc.receive~ bob 2] <- receive a stereo signal from bob in a max-patch\n"})}),"\n",(0,i.jsx)(n.h3,{id:"group",children:"group"}),"\n",(0,i.jsx)(n.admonition,{title:"Currently (and hopefully temporarily) not working",type:"warning"}),"\n",(0,i.jsxs)(n.p,{children:["Set one or more ",(0,i.jsx)(n.code,{children:"group-name"}),"(s) for this instrument. This can be any string of 3 or more characters. With the ",(0,i.jsx)(n.code,{children:"group"})," you can apply a line of code to multiple instruments at the same time. The ",(0,i.jsx)(n.code,{children:"group"})," is ",(0,i.jsx)(n.strong,{children:"not"})," like a mixing bus, so using for example ",(0,i.jsx)(n.code,{children:"gain()"})," will overwrite the ",(0,i.jsx)(n.code,{children:"gain()"})," function on the line of the instrument. If you use the ",(0,i.jsx)(n.code,{children:"name()"})," function you have to make sure the name is set before the group is applied otherwise the reference won't work correctly."]}),"\n",(0,i.jsx)(n.p,{children:(0,i.jsx)(n.strong,{children:"arguments"})}),"\n",(0,i.jsxs)(n.ul,{children:["\n",(0,i.jsxs)(n.li,{children:[(0,i.jsx)(n.code,{children:"Name"})," -> a group name used for multiple instruments (default=none)"]}),"\n"]}),"\n",(0,i.jsx)(n.pre,{children:(0,i.jsx)(n.code,{className:"language-js",children:"// the hihat is not included in the group so will \n// not get the gain(0.8) and fx(reverb 0.9 11)\nnew sample hat_909 time(1/8)\n\nnew sample kick_909 group(drums) time(1/4)\nnew sample snare_909 group(drums) time(1/2 1/4)\n set drums gain(0.8) fx(reverb 0.9 11)\n"})}),"\n",(0,i.jsx)(n.h3,{id:"time",children:"time"}),"\n",(0,i.jsxs)(n.p,{children:["Set the time interval at which the internal clock for an instrument runs and the synth or sample is triggered. This can be an ",(0,i.jsx)(n.code,{children:"integer"}),", ",(0,i.jsx)(n.code,{children:"float"})," or ",(0,i.jsx)(n.code,{children:"fraction"}),". ",(0,i.jsx)(n.code,{children:"1"})," = 1measure, ",(0,i.jsx)(n.code,{children:"1/4"})," = quarter-note, ",(0,i.jsx)(n.code,{children:"1/12"})," = 8th triplet, ",(0,i.jsx)(n.code,{children:"3/16"})," = 3-16th notes, etc. Similarly you can set an offset in the timing. The ",(0,i.jsx)(n.code,{children:"time()"})," will start an internal counter for this instrument, incremented every time it is triggerd (based on the ",(0,i.jsx)(n.code,{children:"play()"})," function). The counter is used as an index to lookup values from other ",(0,i.jsx)(n.code,{children:"list"})," provided as argument in functions for this instrument."]}),"\n",(0,i.jsxs)(n.p,{children:["Setting the first argument to ",(0,i.jsx)(n.code,{children:"free"})," allows the use of external triggering via OSC-messages. The trigger reacts when a value greater than ",(0,i.jsx)(n.code,{children:"0"})," is received. When another instrument in the code has a ",(0,i.jsx)(n.code,{children:"name()"}),", that name can be used as OSC-message trigger for another instrument to synchronize them."]}),"\n",(0,i.jsx)(n.p,{children:(0,i.jsx)(n.strong,{children:"arguments"})}),"\n",(0,i.jsxs)(n.ul,{children:["\n",(0,i.jsxs)(n.li,{children:[(0,i.jsx)(n.code,{children:"Number/Fraction"})," -> the timing fraction or ",(0,i.jsx)(n.code,{children:"free"})," (default=1/4)"]}),"\n",(0,i.jsxs)(n.li,{children:[(0,i.jsx)(n.code,{children:"Number/Fraction"})," -> timing offset or osc-message when ",(0,i.jsx)(n.code,{children:"free"})," (optional, default=0)"]}),"\n"]}),"\n",(0,i.jsx)(n.pre,{children:(0,i.jsx)(n.code,{className:"language-js",children:"set tempo 130\n\nnew sample kick_909 time(1/4)\nnew synth saw time(1/2 3/16)\n"})}),"\n",(0,i.jsx)(n.pre,{children:(0,i.jsx)(n.code,{className:"language-js",metastring:'title="external trigger"',children:"new sample snare_dnb time(free '/snareOSC/amplitude')\n"})}),"\n",(0,i.jsx)(n.pre,{children:(0,i.jsx)(n.code,{className:"language-js",metastring:'title="triggering from other instrument"',children:"new sample kick_909 time(3/16) name(kick)\nnew synth saw time(free '/kick')\n"})}),"\n",(0,i.jsx)(n.admonition,{type:"warning",children:(0,i.jsxs)(n.mdxAdmonitionTitle,{children:["You can not (yet) use ",(0,i.jsx)(n.code,{children:"list"}),"s to modulate the ",(0,i.jsx)(n.code,{children:"time()"})," parameters"]})}),"\n",(0,i.jsx)(n.h3,{id:"once",children:"once"}),"\n",(0,i.jsxs)(n.p,{children:["With once you can disable the looping mode of an instrument being triggered for every ",(0,i.jsx)(n.code,{children:"time()"})," interval. When the code is evaluated the instrument will only trigger ",(0,i.jsx)(n.code,{children:"1"})," time and stop after that. It will always trigger once every time the code is evaluated, so if you like the instrument to not play anymore after that you can either set ",(0,i.jsx)(n.code,{children:"gain(0)"})," or comment ",(0,i.jsx)(n.code,{children:"//"})," it."]}),"\n",(0,i.jsx)(n.p,{children:(0,i.jsx)(n.strong,{children:"arguments"})}),"\n",(0,i.jsxs)(n.ul,{children:["\n",(0,i.jsxs)(n.li,{children:[(0,i.jsx)(n.code,{children:"Bool"})," -> enable triggering the instrument once (default=off)"]}),"\n"]}),"\n",(0,i.jsx)(n.pre,{children:(0,i.jsx)(n.code,{className:"language-js",children:"new sample gong_lo time(2/1) once(on)\n// a sample for reference in time\nnew sample tabla_hi time(1/4)\n"})}),"\n",(0,i.jsx)(n.pre,{children:(0,i.jsx)(n.code,{className:"language-js",metastring:'title="trigger once on a bar multiple of 2 with offset of 7/8"',children:"new sample harp_down once(on) time(2/1 7/8)\n// a sample for reference in time\nnew sample hat_808 time(1/4)\n"})}),"\n",(0,i.jsx)(n.h3,{id:"play",children:"play"}),"\n",(0,i.jsxs)(n.p,{children:["Provide the play function with a ",(0,i.jsx)(n.code,{children:"list"})," containing 1's and 0's. For every time interval defined by the ",(0,i.jsx)(n.code,{children:"time()"})," function, the next value in the list is checked. A one results in a trigger of the instrument and an increment of the internal counter. A zero results in no trigger. An optional second argument resets the internal instrument index after a certain amount of time in ",(0,i.jsx)(n.code,{children:"fraction"}),"."]}),"\n",(0,i.jsx)(n.p,{children:(0,i.jsx)(n.strong,{children:"arguments"})}),"\n",(0,i.jsxs)(n.ul,{children:["\n",(0,i.jsxs)(n.li,{children:[(0,i.jsx)(n.code,{children:"Float+(List)"})," -> a rhythmic pattern of ones and zeroes to play (default=1)"]}),"\n",(0,i.jsxs)(n.li,{children:[(0,i.jsx)(n.code,{children:"Number/Fraction"})," -> reset internal time() counter after specified time (optional, default=off)"]}),"\n"]}),"\n",(0,i.jsx)(n.pre,{children:(0,i.jsx)(n.code,{className:"language-js",children:"list hatBeat [1 0 0 1 0 1 1 0 0]\n\nnew sample hat_909 time(1/16) play(hatBeat)\n"})}),"\n",(0,i.jsxs)(n.p,{children:["Alternatively you can use floating-point values in a list which result in a probability that the instrument will play. Here 0 means 0% chance, 1=100% and 0.5 is 50%. Inspired by Nick Collins paper on ",(0,i.jsx)(n.a,{href:"https://www.dmu.ac.uk/documents/technology-documents/research/mtirc/nowalls/mww-collins.pdf",children:"Algorithmic Composition Methods for Breakbeat Science"}),"."]}),"\n",(0,i.jsx)(n.pre,{children:(0,i.jsx)(n.code,{className:"language-js",metastring:'title="using probabilities"',children:"list hatBeat [1 0.5 0.2 0.8 0.5]\n\nnew sample hat_909 time(1/16) play(hatBeat 2)\nnew sample kick_909 time(1/4)\n"})}),"\n",(0,i.jsxs)(n.p,{children:["Alias: ",(0,i.jsx)(n.code,{children:"beat()"})]}),"\n",(0,i.jsx)(n.h3,{id:"shape",children:"shape"}),"\n",(0,i.jsxs)(n.p,{children:["Set the shape generator of a sound (in synthesis also called envelope). The shape is the trajectory of volume over time on the sound (eg. fade-in, fade-out). Various modes are possible depending on the amount of arguments. The attack time is the fade-in for the sound, the release is the fade-out for the sound, both in milliseconds or ",(0,i.jsx)(n.code,{children:"fraction"}),". The sustain time holds the sound at a static volume for a while. If the sound is triggered before the end of the envelope, the envelope is canceled, faded to 0 in 1ms and retriggered (in the case of monophonic instruments). You can specify the times in absolute values using integer/floating points (in ms) or in relative values using beat fractions."]}),"\n",(0,i.jsx)(n.p,{children:(0,i.jsx)(n.strong,{children:"arguments"})}),"\n",(0,i.jsxs)(n.ul,{children:["\n",(0,i.jsxs)(n.li,{children:[(0,i.jsx)(n.code,{children:"Number+(List)/Fraction(List)"})," -> Attack time in ms or fraction (optional, default=2)"]}),"\n",(0,i.jsxs)(n.li,{children:[(0,i.jsx)(n.code,{children:"Number+(List)/Fraction(List)"})," -> Decay time in ms or fraction (optional, default=0)"]}),"\n",(0,i.jsxs)(n.li,{children:[(0,i.jsx)(n.code,{children:"Number+(List)/Fraction(List)"})," -> Release time in ms or fraction"]}),"\n"]}),"\n",(0,i.jsx)(n.pre,{children:(0,i.jsx)(n.code,{className:"language-js",children:"new synth saw shape(1500)\n// default attack of 2 ms, sustain of 0 ms and a release of 1500 ms\n\nnew synth saw shape(1000 250)\n// attack of 1000 ms, default sustain of 0 ms and a release of 250 ms\n\nnew synth saw shape(10 500 50)\n// attack of 10 ms, sustain of 500 ms and a release of 50 ms\n"})}),"\n",(0,i.jsx)(n.pre,{children:(0,i.jsx)(n.code,{className:"language-js",metastring:'title="shape with fractions"',children:"set tempo 100\n\nnew synth saw shape(1/2)\n// default release of 1/2 (about 250 ms at 120 bpm)\n\nnew synth saw shape(1/4 1/32)\n\nnew synth saw shape(1/64 1/8 1/16)\n"})}),"\n",(0,i.jsx)(n.pre,{children:(0,i.jsx)(n.code,{className:"language-js",metastring:'title="modulate duration with a list"',children:"list durs [50 200 500]\nnew synth saw shape(durs)\n"})}),"\n",(0,i.jsxs)(n.p,{children:["Alias: ",(0,i.jsx)(n.code,{children:"length()"}),", ",(0,i.jsx)(n.code,{children:"envelope()"})]}),"\n",(0,i.jsx)(n.h3,{id:"gain",children:"gain"}),"\n",(0,i.jsxs)(n.p,{children:["Set the volume for the instrument in floating-point amplitude. Where ",(0,i.jsx)(n.code,{children:"1"})," is the default amplitude of the sample or synth, ",(0,i.jsx)(n.code,{children:"0.5"})," is the half louder (-6 dB) and ",(0,i.jsx)(n.code,{children:"2"})," is twice as loud (+ 6dB). An optional second argument sets the sliding time to go to the next gain value in milliseconds or ",(0,i.jsx)(n.code,{children:"fraction"}),"."]}),"\n",(0,i.jsx)(n.p,{children:(0,i.jsx)(n.strong,{children:"arguments"})}),"\n",(0,i.jsxs)(n.ul,{children:["\n",(0,i.jsxs)(n.li,{children:[(0,i.jsx)(n.code,{children:"Float+(List)"})," -> the (start) volume of the instrument (default=1)"]}),"\n",(0,i.jsxs)(n.li,{children:[(0,i.jsx)(n.code,{children:"Number+(List)"})," -> the sliding time in fraction or ms (optional, default=0)"]}),"\n",(0,i.jsxs)(n.li,{children:[(0,i.jsx)(n.code,{children:"Bool"})," -> mute the instrument but still use named sends (default=0) ",(0,i.jsx)(n.em,{children:"Mercury4Max only"})]}),"\n"]}),"\n",(0,i.jsx)(n.pre,{children:(0,i.jsx)(n.code,{className:"language-js",children:"new sample snare_909 gain(0.8)\n"})}),"\n",(0,i.jsx)(n.pre,{children:(0,i.jsx)(n.code,{className:"language-js",metastring:'title="modulate gain with a list"',children:"list gains [0 0.5 0.2 0.9]\nnew synth saw gain(gains 500) time(1/1)\n// ramps between gain values over 500ms every trigger 1/1\n"})}),"\n",(0,i.jsx)(n.admonition,{title:"Important for midi",type:"info",children:(0,i.jsxs)(n.p,{children:["When using the ",(0,i.jsx)(n.code,{children:"midi"})," instrument the gain will be multiplied by ",(0,i.jsx)(n.code,{children:"127"})," to create a velocity message. ",(0,i.jsx)(n.code,{children:"gain(0.5)"})," therefore maps to ",(0,i.jsx)(n.code,{children:"63"})," and ",(0,i.jsx)(n.code,{children:"gain(1)"})," to ",(0,i.jsx)(n.code,{children:"127"})]})}),"\n",(0,i.jsxs)(n.p,{children:["Alias: ",(0,i.jsx)(n.code,{children:"amp()"}),", ",(0,i.jsx)(n.code,{children:"volume()"}),", ",(0,i.jsx)(n.code,{children:"velocity()"})]}),"\n",(0,i.jsx)(n.h3,{id:"pan",children:"pan"}),"\n",(0,i.jsxs)(n.p,{children:["Set the panning position in floating-point for the sound in the stereo-image. ",(0,i.jsx)(n.code,{children:"-1"})," is 100% left channel, ",(0,i.jsx)(n.code,{children:"0"})," is center (both speakers), ",(0,i.jsx)(n.code,{children:"1"})," is 100% right channel. Higher or lower values wrap between ",(0,i.jsx)(n.code,{children:"-1"})," and ",(0,i.jsx)(n.code,{children:"1"}),". Provide pan with the ",(0,i.jsx)(n.code,{children:"random"})," argument to get a new random panning value every trigger of the instrument."]}),"\n",(0,i.jsx)(n.p,{children:(0,i.jsx)(n.strong,{children:"arguments"})}),"\n",(0,i.jsxs)(n.ul,{children:["\n",(0,i.jsxs)(n.li,{children:[(0,i.jsx)(n.code,{children:"Float"})," -> the panning position between -1 and 1 (default=0)"]}),"\n"]}),"\n",(0,i.jsx)(n.pre,{children:(0,i.jsx)(n.code,{className:"language-js",children:"new synth saw pan(-1)\nnew synth square pan(1)\n// two synths hard-panned left and right\n\nnew sample clap_909 pan(random) time(1/8)\n// random panning every trigger\n"})}),"\n",(0,i.jsx)(n.pre,{children:(0,i.jsx)(n.code,{className:"language-js",metastring:'title="modulate panning with a list',children:"list positions [-1 0 1 0 1 -1 -1]\nnew sample hat_808 time(1/16) pan(positions)\n"})}),"\n",(0,i.jsxs)(n.p,{children:["Alias: ",(0,i.jsx)(n.code,{children:"panning()"})]}),"\n",(0,i.jsx)(n.admonition,{title:"Multi-speaker output is not (yet) supported",type:"note"}),"\n",(0,i.jsx)(n.h3,{id:"effect",children:"effect"}),"\n",(0,i.jsxs)(n.p,{children:["Add an effect to the sound of the instrument to manipulate the sounds timbre in different ways. The first argument is always the ",(0,i.jsx)(n.code,{children:"effect-name"}),". The arguments that follow depend on the selected effect. ",(0,i.jsx)(n.code,{children:"fx()"})," can be used as an alias to reduce some typing. See ",(0,i.jsx)(n.a,{href:"/mercury/docs/reference/effects",children:"Effects"})," for more details and an up-to-date list of all the available effects for both ",(0,i.jsx)(n.em,{children:"Mercury4Max"})," and the ",(0,i.jsx)(n.em,{children:"MercuryPlayground"}),"."]}),"\n",(0,i.jsx)(n.p,{children:(0,i.jsx)(n.strong,{children:"arguments"})}),"\n",(0,i.jsxs)(n.ul,{children:["\n",(0,i.jsxs)(n.li,{children:[(0,i.jsx)(n.code,{children:"Name"})," -> the effect name"]}),"\n",(0,i.jsxs)(n.li,{children:[(0,i.jsx)(n.code,{children:"Value+/List+"})," -> values or lists depending on effectname arguments order (optional)"]}),"\n"]}),"\n",(0,i.jsx)(n.pre,{children:(0,i.jsx)(n.code,{className:"language-js",children:"new synth square effect(distort) effect(reverb)\n"})}),"\n",(0,i.jsxs)(n.p,{children:["Alias: ",(0,i.jsx)(n.code,{children:"fx()"}),", "]}),"\n",(0,i.jsx)(n.p,{children:(0,i.jsx)(n.strong,{children:"static vs. dynamic effect-chains"})}),"\n",(0,i.jsxs)(n.p,{children:["The Mercury4Max version has a static effects-chain. This means the order in the effects under the hood is fixed. The order is documented under ",(0,i.jsx)(n.a,{href:"/mercury/docs/reference/effects",children:"Effects"}),". Because of this there is:"]}),"\n",(0,i.jsxs)(n.ul,{children:["\n",(0,i.jsx)(n.li,{children:"No option to change the order of effects with the code"}),"\n",(0,i.jsx)(n.li,{children:"No option to use effects multiple times in one instrument"}),"\n"]}),"\n",(0,i.jsx)(n.pre,{children:(0,i.jsx)(n.code,{className:"language-js",metastring:'title="static fx-chain"',children:"new synth saw fx(reverb) fx(filter low 2000) fx(distort) fx(filter low 300)\n// filter and distortion are fixed before reverb in the chain, the order of \n// the code doesn't matter. There is only one filter in the chain, the first \n// filter is therefore overwritten by the other\n"})}),"\n",(0,i.jsx)(n.p,{children:"The MercuryPlayground version has a dynamic effects-chain. This means the order in the effects is determined by how you type the code. Because of this there is:"}),"\n",(0,i.jsxs)(n.ul,{children:["\n",(0,i.jsx)(n.li,{children:"Decide the order of effects by the order of the code you type"}),"\n",(0,i.jsx)(n.li,{children:"Use effects multiple times on one instrument"}),"\n"]}),"\n",(0,i.jsx)(n.pre,{children:(0,i.jsx)(n.code,{className:"language-js",metastring:'title="dynamic fx-chain"',children:"new synth saw fx(reverb) fx(filter low 2000) fx(distort) fx(filter low 300)\n// the reverb will be filtered, then distorted and then filtered again\n// the resulting sound is filtered twice\n"})}),"\n",(0,i.jsx)(n.admonition,{type:"info",children:(0,i.jsxs)(n.p,{children:["There are differences in sound between the ",(0,i.jsx)(n.em,{children:"Mercury4Max"})," and ",(0,i.jsx)(n.em,{children:"MercuryPlayground"})," versions. Parameters may need some tweaking when you port from one environment to the other."]})}),"\n",(0,i.jsx)(n.admonition,{type:"warning",children:(0,i.jsxs)(n.p,{children:["Not all effects from ",(0,i.jsx)(n.em,{children:"Mercury4Max"})," are available in the ",(0,i.jsx)(n.em,{children:"MercuryPlayground"})," because some are in the process of being ported, and some are sadly not as easy to implement with Web Audio."]})}),"\n",(0,i.jsx)(n.h3,{id:"ratchet",children:"ratchet"}),"\n",(0,i.jsx)(n.admonition,{title:"Mercury4Max only",type:"warning"}),"\n",(0,i.jsx)(n.p,{children:"Add a ratcheting effect (doubling/tripling/quadrupling of hits) with a probability. A technique that introduces some variety in rhythm that originated with electronic music from groups such as Tangerine Dream. The first argument sets the probability a note will be repeated. The second argument sets the amount of repetitions within the time, effectively doubling, tripling or more."}),"\n",(0,i.jsx)(n.p,{children:(0,i.jsx)(n.strong,{children:"arguments"})}),"\n",(0,i.jsxs)(n.ul,{children:["\n",(0,i.jsxs)(n.li,{children:[(0,i.jsx)(n.code,{children:"Float+"})," -> probability of ratchet happening (default=0.1)"]}),"\n",(0,i.jsxs)(n.li,{children:[(0,i.jsx)(n.code,{children:"Int+/IntList+"})," -> amount of repetitions (default=2)"]}),"\n"]}),"\n",(0,i.jsx)(n.pre,{children:(0,i.jsx)(n.code,{className:"language-js",children:"new sample hat_909 time(1/8) ratchet(0.3 2)\n"})}),"\n",(0,i.jsx)(n.pre,{children:(0,i.jsx)(n.code,{className:"language-js",metastring:'title="using a ratchet list"',children:"list rtc [2 3 2 4 8]\nnew sample hat_909 time(1/4) ratchet(1 rtc)\n"})}),"\n",(0,i.jsx)(n.h3,{id:"timediv",children:"timediv"}),"\n",(0,i.jsx)(n.admonition,{title:"Mercuryplayground only",type:"warning"}),"\n",(0,i.jsxs)(n.p,{children:["Add subdivisions to ",(0,i.jsx)(n.code,{children:"time()"}),". Documentation to do..."]}),"\n",(0,i.jsx)(n.pre,{children:(0,i.jsx)(n.code,{className:"language-js",children:"list div [1 2 3 4]\nnew sample hat_808 time(1/4) timediv(div)\n"})}),"\n",(0,i.jsx)(n.h3,{id:"warp",children:"warp"}),"\n",(0,i.jsx)(n.admonition,{title:"Mercury4Max only",type:"warning"}),"\n",(0,i.jsxs)(n.p,{children:["Warp ",(0,i.jsx)(n.code,{children:"time()"})," in a more complex way. Documentation to do..."]}),"\n",(0,i.jsx)(n.pre,{children:(0,i.jsx)(n.code,{className:"language-js",children:"list warp [1 2 3 4]\nnew sample hat_808 time(1/1) warp(warp)\n"})}),"\n",(0,i.jsx)(n.h3,{id:"wait",children:"wait"}),"\n",(0,i.jsx)(n.admonition,{title:"MercuryPlayground only",type:"warning"}),"\n",(0,i.jsxs)(n.p,{children:["This function is similar to the offset parameter in the ",(0,i.jsx)(n.code,{children:"time()"})," function except that it allows you to set an additional waiting time (or delay) for an instrument in milliseconds. This function is useful to align/synchronize instruments with external peripherals such as sending MIDI notes or OSC messages."]}),"\n",(0,i.jsx)(n.p,{children:(0,i.jsx)(n.strong,{children:"arguments"})}),"\n",(0,i.jsxs)(n.ul,{children:["\n",(0,i.jsxs)(n.li,{children:[(0,i.jsx)(n.code,{children:"Int+/Fraction"})," -> specify the waiting time in milliseconds or fraction (default=null)"]}),"\n"]}),"\n",(0,i.jsx)(n.pre,{children:(0,i.jsx)(n.code,{className:"language-js",children:"new sample kick_909 time(1/4)\n// the hihat plays 100ms later than the kick\nnew sample hat_909 time(1/4) wait(100)\n"})}),"\n",(0,i.jsx)(n.h2,{id:"synth",children:"synth"}),"\n",(0,i.jsxs)(n.p,{children:["The ",(0,i.jsx)(n.code,{children:"synth"})," and ",(0,i.jsx)(n.code,{children:"polySynth"})," instruments allow you to play synthesized sounds using a single cycle waveform. These waveforms are loaded in memory and can be accessed by their filename (without the extension). The default waveforms are ",(0,i.jsx)(n.code,{children:"sine"}),", ",(0,i.jsx)(n.code,{children:"triangle"}),", ",(0,i.jsx)(n.code,{children:"square"})," and ",(0,i.jsx)(n.code,{children:"saw"}),"."]}),"\n",(0,i.jsx)(n.pre,{children:(0,i.jsx)(n.code,{className:"language-js",children:"new synth \n"})}),"\n",(0,i.jsx)(n.admonition,{type:"note",children:(0,i.jsxs)(n.p,{children:["The waveforms in MercuryPlayground are currently not created with single-cycle soundfiles but via WebAudio's ",(0,i.jsx)(n.code,{children:"PeriodicWave"}),", constructing a waveform from a Fourier Series."]})}),"\n",(0,i.jsx)(n.h3,{id:"note",children:"note"}),"\n",(0,i.jsx)(n.p,{children:"Set the pitch for the instrument to play a note in a melody or chord. The note is specified as a 2-dimensional coordinate system, where the first argument is the semitone offset (positive or negative) and the second argument is the octave offset (positive or negative)."}),"\n",(0,i.jsxs)(n.p,{children:["The origin of the system, ",(0,i.jsx)(n.code,{children:"note(0 0)"}),", corresponds by default with midi-pitch ",(0,i.jsx)(n.code,{children:"36"})," or ",(0,i.jsx)(n.code,{children:"C2"}),". Depending on the ",(0,i.jsx)(n.code,{children:"set scale"})," the coordinate system will shift and result in a different pitch for the origin. A ",(0,i.jsx)(n.code,{children:"note()"})," should therefore not be taken as an absolute value, but rather a relative direction where the melody is going to in relation to the scale and root."]}),"\n",(0,i.jsxs)(n.p,{children:["Detuning/pitchbending can be done by providing a ",(0,i.jsx)(n.code,{children:"float"})," note number. The value behind the decimal point is the amount of detuning from one semitone to the next. For example ",(0,i.jsx)(n.code,{children:"7.5"})," results in ",(0,i.jsx)(n.code,{children:"7"})," semitones (and mapped to ",(0,i.jsx)(n.code,{children:"scale"})," if used) and then a ",(0,i.jsx)(n.code,{children:"0.5"})," semitone is added (= 50 cents). Detuning is applied after mapping the integer semitone to a scale."]}),"\n",(0,i.jsxs)(n.p,{children:["The mapping of the notes is as follows with ",(0,i.jsx)(n.code,{children:"set scale chromatic c"})," (default)"]}),"\n",(0,i.jsxs)(n.table,{children:[(0,i.jsx)(n.thead,{children:(0,i.jsxs)(n.tr,{children:[(0,i.jsx)(n.th,{children:(0,i.jsx)(n.code,{children:"note(x y)"})}),(0,i.jsx)(n.th,{children:"..."}),(0,i.jsx)(n.th,{children:"-1"}),(0,i.jsx)(n.th,{children:"0"}),(0,i.jsx)(n.th,{children:"1"}),(0,i.jsx)(n.th,{children:"2"}),(0,i.jsx)(n.th,{children:"3"}),(0,i.jsx)(n.th,{children:"4"}),(0,i.jsx)(n.th,{children:"..."}),(0,i.jsx)(n.th,{children:"9"}),(0,i.jsx)(n.th,{children:"10"}),(0,i.jsx)(n.th,{children:"11"}),(0,i.jsx)(n.th,{children:"12"}),(0,i.jsx)(n.th,{children:"13"}),(0,i.jsx)(n.th,{children:"..."})]})}),(0,i.jsxs)(n.tbody,{children:[(0,i.jsxs)(n.tr,{children:[(0,i.jsx)(n.td,{children:"3"}),(0,i.jsx)(n.td,{children:"..."}),(0,i.jsx)(n.td,{children:"B#"}),(0,i.jsxs)(n.td,{children:["C ",(0,i.jsx)(n.code,{children:"72"})]}),(0,i.jsx)(n.td,{children:"C#"}),(0,i.jsx)(n.td,{children:"D"}),(0,i.jsx)(n.td,{children:"D#"}),(0,i.jsx)(n.td,{children:"E"}),(0,i.jsx)(n.td,{children:"..."}),(0,i.jsx)(n.td,{children:"A"}),(0,i.jsx)(n.td,{children:"A#"}),(0,i.jsx)(n.td,{children:"B"}),(0,i.jsxs)(n.td,{children:["C ",(0,i.jsx)(n.code,{children:"84"})]}),(0,i.jsx)(n.td,{children:"C#"}),(0,i.jsx)(n.td,{children:"..."})]}),(0,i.jsxs)(n.tr,{children:[(0,i.jsx)(n.td,{children:"2"}),(0,i.jsx)(n.td,{children:"..."}),(0,i.jsx)(n.td,{children:"B#"}),(0,i.jsxs)(n.td,{children:["C ",(0,i.jsx)(n.code,{children:"60"})]}),(0,i.jsx)(n.td,{children:"C#"}),(0,i.jsx)(n.td,{children:"D"}),(0,i.jsx)(n.td,{children:"D#"}),(0,i.jsx)(n.td,{children:"E"}),(0,i.jsx)(n.td,{children:"..."}),(0,i.jsx)(n.td,{children:"A"}),(0,i.jsx)(n.td,{children:"A#"}),(0,i.jsx)(n.td,{children:"B"}),(0,i.jsxs)(n.td,{children:["C ",(0,i.jsx)(n.code,{children:"72"})]}),(0,i.jsx)(n.td,{children:"C#"}),(0,i.jsx)(n.td,{children:"..."})]}),(0,i.jsxs)(n.tr,{children:[(0,i.jsx)(n.td,{children:"1"}),(0,i.jsx)(n.td,{children:"..."}),(0,i.jsx)(n.td,{children:"B#"}),(0,i.jsxs)(n.td,{children:["C ",(0,i.jsx)(n.code,{children:"48"})]}),(0,i.jsx)(n.td,{children:"C#"}),(0,i.jsx)(n.td,{children:"D"}),(0,i.jsx)(n.td,{children:"D#"}),(0,i.jsx)(n.td,{children:"E"}),(0,i.jsx)(n.td,{children:"..."}),(0,i.jsx)(n.td,{children:"A"}),(0,i.jsx)(n.td,{children:"A#"}),(0,i.jsx)(n.td,{children:"B"}),(0,i.jsxs)(n.td,{children:["C ",(0,i.jsx)(n.code,{children:"60"})]}),(0,i.jsx)(n.td,{children:"C#"}),(0,i.jsx)(n.td,{children:"..."})]}),(0,i.jsxs)(n.tr,{children:[(0,i.jsx)(n.td,{children:"0"}),(0,i.jsx)(n.td,{children:"..."}),(0,i.jsx)(n.td,{children:"B#"}),(0,i.jsxs)(n.td,{children:["C ",(0,i.jsx)(n.code,{children:"36"})]}),(0,i.jsx)(n.td,{children:"C#"}),(0,i.jsx)(n.td,{children:"D"}),(0,i.jsx)(n.td,{children:"D#"}),(0,i.jsx)(n.td,{children:"E"}),(0,i.jsx)(n.td,{children:"..."}),(0,i.jsx)(n.td,{children:"A"}),(0,i.jsx)(n.td,{children:"A#"}),(0,i.jsx)(n.td,{children:"B"}),(0,i.jsxs)(n.td,{children:["C ",(0,i.jsx)(n.code,{children:"48"})]}),(0,i.jsx)(n.td,{children:"C#"}),(0,i.jsx)(n.td,{children:"..."})]}),(0,i.jsxs)(n.tr,{children:[(0,i.jsx)(n.td,{children:"-1"}),(0,i.jsx)(n.td,{children:"..."}),(0,i.jsx)(n.td,{children:"B#"}),(0,i.jsxs)(n.td,{children:["C ",(0,i.jsx)(n.code,{children:"24"})]}),(0,i.jsx)(n.td,{children:"C#"}),(0,i.jsx)(n.td,{children:"D"}),(0,i.jsx)(n.td,{children:"D#"}),(0,i.jsx)(n.td,{children:"E"}),(0,i.jsx)(n.td,{children:"..."}),(0,i.jsx)(n.td,{children:"A"}),(0,i.jsx)(n.td,{children:"A#"}),(0,i.jsx)(n.td,{children:"B"}),(0,i.jsxs)(n.td,{children:["C ",(0,i.jsx)(n.code,{children:"36"})]}),(0,i.jsx)(n.td,{children:"C#"}),(0,i.jsx)(n.td,{children:"..."})]})]})]}),"\n",(0,i.jsx)(n.p,{children:(0,i.jsx)(n.strong,{children:"arguments"})}),"\n",(0,i.jsxs)(n.ul,{children:["\n",(0,i.jsxs)(n.li,{children:[(0,i.jsx)(n.code,{children:"Number(List)"})," -> positive or negative semitone note value or list, x-coordinate (default=0)"]}),"\n",(0,i.jsxs)(n.li,{children:[(0,i.jsx)(n.code,{children:"Number(List)"})," -> positive or negative octave value or list, y-coordinate (default=0)"]}),"\n"]}),"\n",(0,i.jsx)(n.pre,{children:(0,i.jsx)(n.code,{className:"language-js",children:"set scale major d\nnew synth sine note(2 2)\n//=> results in midi-note 64 > F4\n"})}),"\n",(0,i.jsx)(n.pre,{children:(0,i.jsx)(n.code,{className:"language-js",metastring:'title="play a melody with lists"',children:"set scale minor A\n\nlist mel [0 5 7 3 2 -2 0]\nlist oct [0 1 2]\nnew synth sine note(mel oct) time(1/16)\n"})}),"\n",(0,i.jsx)(n.h3,{id:"slide",children:"slide"}),"\n",(0,i.jsxs)(n.p,{children:["A portamento/sliding/gliding effect. This will make the synthesizers' oscillator slowly slide from the current frequency to the new played one over a defined period of ",(0,i.jsx)(n.code,{children:"number"})," in milliseconds or ",(0,i.jsx)(n.code,{children:"fraction"}),". The sliding is logarithmically (meaning it will slide from midi-note to midi-note linearly, but after conversion to frequency slides logarithmically. This sounds slightly different from sliding linearly between frequencies)."]}),"\n",(0,i.jsx)(n.p,{children:(0,i.jsx)(n.strong,{children:"arguments"})}),"\n",(0,i.jsxs)(n.ul,{children:["\n",(0,i.jsxs)(n.li,{children:[(0,i.jsx)(n.code,{children:"Number+/Fraction(List)"})," -> sliding time in milliseconds or fraction (default=50)"]}),"\n"]}),"\n",(0,i.jsx)(n.pre,{children:(0,i.jsx)(n.code,{className:"language-js",children:"list notes [0 7 3]\nnew synth saw note(notes 1) time(1/2) slide(1/8)\n"})}),"\n",(0,i.jsxs)(n.p,{children:["Alias: ",(0,i.jsx)(n.code,{children:"glide()"}),", ",(0,i.jsx)(n.code,{children:"portamento()"})]}),"\n",(0,i.jsx)(n.h3,{id:"super",children:"super"}),"\n",(0,i.jsxs)(n.p,{children:["Add multiple oscillators in unison with a detuning factor to create a ",(0,i.jsx)(n.em,{children:"SuperSaw"})," effect. One oscillator will always be the base frequency of the ",(0,i.jsx)(n.code,{children:"note()"}),", the others are tuned above and below in incremental steps based on the detuning factor. The first argument sets the amount of oscillators (minum of 1, default=1), the second argument sets the detuning factor in semi-tones, the third optional argument sets the oscillator type for the odd numbered oscillators."]}),"\n",(0,i.jsx)(n.p,{children:(0,i.jsx)(n.strong,{children:"arguments"})}),"\n",(0,i.jsxs)(n.ul,{children:["\n",(0,i.jsxs)(n.li,{children:[(0,i.jsx)(n.code,{children:"Int+(List)"})," -> number of oscillators (default=1, maximum=64)"]}),"\n",(0,i.jsxs)(n.li,{children:[(0,i.jsx)(n.code,{children:"Float+(List)"})," -> detuning factor in semi-tone, 12=octave"]}),"\n",(0,i.jsxs)(n.li,{children:[(0,i.jsx)(n.code,{children:"Name"})," -> the name of the odd numbered oscillators (optional, default=main oscillator) ",(0,i.jsx)(n.em,{children:"Mercury4Max only"})]}),"\n"]}),"\n",(0,i.jsx)(n.pre,{children:(0,i.jsx)(n.code,{className:"language-js",children:"new synth saw super(5 0.031415)\n"})}),"\n",(0,i.jsx)(n.pre,{children:(0,i.jsx)(n.code,{className:"language-js",children:"new synth saw super(11 0.0618 square) \n"})}),"\n",(0,i.jsx)(n.pre,{children:(0,i.jsx)(n.code,{className:"language-js",metastring:'title="modulate detuning with a list"',children:"list voices [3 5 9 21]\nlist detune [0.1 0.5 0.9 12.01 0.3]\n\nnew synth saw time(1/4) shape(-1) super(voices detune)\n"})}),"\n",(0,i.jsxs)(n.p,{children:["Alias: ",(0,i.jsx)(n.code,{children:"unison()"})]}),"\n",(0,i.jsx)(n.h3,{id:"wave2",children:"wave2"}),"\n",(0,i.jsx)(n.admonition,{title:"REMOVED",type:"warning",children:(0,i.jsxs)(n.p,{children:["use ",(0,i.jsx)(n.a,{href:"#super",children:"super()"})," instead"]})}),"\n",(0,i.jsx)(n.h3,{id:"sub",children:"sub"}),"\n",(0,i.jsx)(n.admonition,{title:"Mercury4Max only",type:"warning"}),"\n",(0,i.jsxs)(n.p,{children:["Add a second sinewave oscillator to the synth. The oscillator is tuned one octave lower than the ",(0,i.jsx)(n.code,{children:"note()"})," played to create a sub frequency."]}),"\n",(0,i.jsx)(n.p,{children:(0,i.jsx)(n.strong,{children:"arguments"})}),"\n",(0,i.jsxs)(n.ul,{children:["\n",(0,i.jsxs)(n.li,{children:[(0,i.jsx)(n.code,{children:"Float+(List)"})," -> amplitude for the sub oscillator (default=off)"]}),"\n"]}),"\n",(0,i.jsx)(n.pre,{children:(0,i.jsx)(n.code,{className:"language-js",children:"new synth sine note(5 1) sub(0.8)\n"})}),"\n",(0,i.jsx)(n.h3,{id:"noise",children:"noise"}),"\n",(0,i.jsx)(n.admonition,{title:"Mercury4Max only",type:"warning"}),"\n",(0,i.jsxs)(n.p,{children:["Add a noise oscillator to the synth sound. The first argument is the ",(0,i.jsx)(n.em,{children:"amplitude"})," (gain), the second argument is the ",(0,i.jsx)(n.em,{children:'"color"'})," of the noise between 0 and 1 (1 = white noise, lower values give a more darker/downsampled noise sound). When the modulation mode is turned on (with 1) the noise is modulated by the source of the oscillator (or oscillators if ",(0,i.jsx)(n.code,{children:"super()"})," and ",(0,i.jsx)(n.code,{children:"sub()"})," are used)."]}),"\n",(0,i.jsx)(n.p,{children:(0,i.jsx)(n.strong,{children:"arguments"})}),"\n",(0,i.jsxs)(n.ul,{children:["\n",(0,i.jsxs)(n.li,{children:[(0,i.jsx)(n.code,{children:"Float+(List)"})," -> amplitude of the noise (default=0)"]}),"\n",(0,i.jsxs)(n.li,{children:[(0,i.jsx)(n.code,{children:"Float+(List)"})," -> color of the noise 0-1 (default=0.8)"]}),"\n",(0,i.jsxs)(n.li,{children:[(0,i.jsx)(n.code,{children:"Bool(List)"})," -> modulation mode (default=0)"]}),"\n"]}),"\n",(0,i.jsx)(n.pre,{children:(0,i.jsx)(n.code,{className:"language-js",children:"new synth saw note(0 1) noise(0.3 0.8 1)\n"})}),"\n",(0,i.jsx)(n.h2,{id:"sample",children:"sample"}),"\n",(0,i.jsx)(n.p,{children:'The sample instrument allows you to play sound-recordings and loops. These so called "samples" are loaded in memory and can be accessed by their filename (without the extension).'}),"\n",(0,i.jsx)(n.pre,{children:(0,i.jsx)(n.code,{className:"language-js",children:"new sample \n"})}),"\n",(0,i.jsxs)(n.ul,{children:["\n",(0,i.jsx)(n.li,{children:(0,i.jsx)(n.a,{href:"/mercury/docs/usage/mercury4max-overview#sounds",children:"Load sounds in Mercury4Max"})}),"\n",(0,i.jsx)(n.li,{children:(0,i.jsx)(n.a,{href:"/mercury/docs/usage/playground-overview#add-sounds",children:"Load sounds in MercuryPlayground"})}),"\n",(0,i.jsx)(n.li,{children:(0,i.jsx)(n.a,{href:"/mercury/docs/usage/sounds",children:"Full list of all the included sounds"})}),"\n"]}),"\n",(0,i.jsx)(n.h3,{id:"speed",children:"speed"}),"\n",(0,i.jsxs)(n.p,{children:["Set the playback speed for the sample, where 1 = original speed, 0.5 = half the speed and 2 = twice as fast. Adjusting the playback speed will change the pitch of the sample. A negative value will play the sample backwards starting at the end (or at the ",(0,i.jsx)(n.code,{children:"start()"})," position)"]}),"\n",(0,i.jsx)(n.p,{children:(0,i.jsx)(n.strong,{children:"arguments"})}),"\n",(0,i.jsxs)(n.ul,{children:["\n",(0,i.jsxs)(n.li,{children:[(0,i.jsx)(n.code,{children:"Float(List)"})," -> playback speed (default=1)"]}),"\n"]}),"\n",(0,i.jsx)(n.pre,{children:(0,i.jsx)(n.code,{className:"language-js",children:"new sample choir time(5) speed(0.5)\nnew sample choir time(5) speed(-0.3)\n\nset all fx(reverb 2 17)\n"})}),"\n",(0,i.jsxs)(n.p,{children:["Alias: ",(0,i.jsx)(n.code,{children:"rate()"})]}),"\n",(0,i.jsx)(n.admonition,{title:"Reversed speed is not supported (yet) in the MercuryPlayground",type:"warning"}),"\n",(0,i.jsx)(n.h3,{id:"start",children:"start"}),"\n",(0,i.jsxs)(n.p,{children:["Set the start position (the offset position of the playback) of the sample. 0 = start at the beginning, 0.5 = start midway in the sample. With long decaying samples the offset is very useful if playing the sounds backwards when using for example ",(0,i.jsx)(n.code,{children:"speed(-1)"}),"."]}),"\n",(0,i.jsx)(n.p,{children:(0,i.jsx)(n.strong,{children:"arguments"})}),"\n",(0,i.jsxs)(n.ul,{children:["\n",(0,i.jsxs)(n.li,{children:[(0,i.jsx)(n.code,{children:"Float+(List)"})," -> the playback position between 0 and 1 (default=0)"]}),"\n"]}),"\n",(0,i.jsx)(n.pre,{children:(0,i.jsx)(n.code,{className:"language-js",children:"list positions randomFloat(8 0 0.5)\n\nnew sample choir time(1/16) start(positions)\n"})}),"\n",(0,i.jsxs)(n.p,{children:["Alias: ",(0,i.jsx)(n.code,{children:"offset()"})]}),"\n",(0,i.jsx)(n.h3,{id:"note-1",children:"note"}),"\n",(0,i.jsxs)(n.p,{children:["The ",(0,i.jsx)(n.code,{children:"note"})," function allows you to tune the sample to a specific pitch. This is easier than trying to set the playback speed with the ",(0,i.jsx)(n.code,{children:"speed()"})," function if you need to pitch the sample for melodic content. The function works the same as the ",(0,i.jsx)(n.code,{children:"note"})," function explained under the ",(0,i.jsx)(n.code,{children:"synth"}),". Please see ",(0,i.jsx)(n.a,{href:"#note",children:(0,i.jsx)(n.code,{children:"note()"})})," for further information."]}),"\n",(0,i.jsx)(n.pre,{children:(0,i.jsx)(n.code,{className:"language-js",children:"list notes [0 7 5 3]\nnew sample xylo_c4 time(1/8) note(notes 1)\n"})}),"\n",(0,i.jsx)(n.h3,{id:"tune",children:"tune"}),"\n",(0,i.jsxs)(n.p,{children:["Set the base note midi value for the sample to determine how the ",(0,i.jsx)(n.code,{children:"note()"})," function changes the playback speed in relation to this note. For example if your sample was recorded as an ",(0,i.jsx)(n.code,{children:"a4"})," then you will set tune to ",(0,i.jsx)(n.code,{children:"69"})," (midi value of ",(0,i.jsx)(n.code,{children:"a4"}),"). ",(0,i.jsx)(n.code,{children:"note(0 2)"})," is the same as the ",(0,i.jsx)(n.code,{children:"tune()"})," value in the case of a scale set to have ",(0,i.jsx)(n.code,{children:"c"})," as the root."]}),"\n",(0,i.jsx)(n.p,{children:(0,i.jsx)(n.strong,{children:"arguments"})}),"\n",(0,i.jsxs)(n.ul,{children:["\n",(0,i.jsxs)(n.li,{children:[(0,i.jsx)(n.code,{children:"Number+"})," -> midi pitch as base for tuning (optional, default=60)"]}),"\n"]}),"\n",(0,i.jsx)(n.pre,{children:(0,i.jsx)(n.code,{className:"language-js",children:"set scale minor c\n\nlist notes [0 7 5 3]\n// tune the kalimba to a3\nnew sample kalimba_a time(1/4) note(notes 2) tune(57)\n"})}),"\n",(0,i.jsx)(n.h3,{id:"stretch",children:"stretch"}),"\n",(0,i.jsxs)(n.p,{children:["Stretch the entire sample to the length of a full bar. Useful for when working with beats that have to be looped. Stretching is the default when working with the ",(0,i.jsx)(n.code,{children:"loop"})," instrument. This is the same as a ",(0,i.jsx)(n.code,{children:"new sample stretch(1)"}),". Optionally you can turn timestretching on with a second argument to preserve the original pitch of the sample. A third optional argument changes the mode of the stretching, choose from: basic, monophonic, rhythmic, general, extremestretch, efficient. The default is set to ",(0,i.jsx)(n.code,{children:"efficient"}),"."]}),"\n",(0,i.jsx)(n.p,{children:(0,i.jsx)(n.strong,{children:"arguments"})}),"\n",(0,i.jsxs)(n.ul,{children:["\n",(0,i.jsxs)(n.li,{children:[(0,i.jsx)(n.code,{children:"Bool"})," -> turn stretch to full bar on/off (default=0 for sample default=1 for loop)"]}),"\n",(0,i.jsxs)(n.li,{children:[(0,i.jsx)(n.code,{children:"Bool"})," -> turn timestretching on when stretching to full bar, preservering the original pitch (default = 0)"]}),"\n",(0,i.jsxs)(n.li,{children:[(0,i.jsx)(n.code,{children:"Name"})," -> adjust the stretching mode (default=efficient)"]}),"\n"]}),"\n",(0,i.jsx)(n.pre,{children:(0,i.jsx)(n.code,{className:"language-js",children:"new sample chimes stretch(1 1 general) speed(-1)\n"})}),"\n",(0,i.jsxs)(n.admonition,{type:"tip",children:[(0,i.jsxs)(n.p,{children:["If your ",(0,i.jsx)(n.code,{children:"loop"})," is longer than ",(0,i.jsx)(n.code,{children:"1"})," bar use ",(0,i.jsx)(n.code,{children:"speed()"})," to decrease the playback speed by ",(0,i.jsx)(n.code,{children:"1 / n-bars"}),". Set ",(0,i.jsx)(n.code,{children:"time()"})," to the bar amounts."]}),(0,i.jsx)(n.pre,{children:(0,i.jsx)(n.code,{className:"language-js",children:"new loop loopOfFourBars time(4/1) speed(0.25)\n"})})]}),"\n",(0,i.jsx)(n.admonition,{title:"Timestretching is only supported in Mercury4Max",type:"warning"}),"\n",(0,i.jsx)(n.p,{children:(0,i.jsx)(n.strong,{children:"Stretching modes explained"})}),"\n",(0,i.jsxs)(n.ul,{children:["\n",(0,i.jsxs)(n.li,{children:[(0,i.jsx)(n.code,{children:"basic"})," : best option for real-time performance"]}),"\n",(0,i.jsxs)(n.li,{children:[(0,i.jsx)(n.code,{children:"monophonic"})," : best option for any monophonic source without ambience"]}),"\n",(0,i.jsxs)(n.li,{children:[(0,i.jsx)(n.code,{children:"rhythmic"})," : best option for drums and percussion when transient preservation is critical"]}),"\n",(0,i.jsxs)(n.li,{children:[(0,i.jsx)(n.code,{children:"general"})," : balances spectral integrity with transient preservaton"]}),"\n",(0,i.jsxs)(n.li,{children:[(0,i.jsx)(n.code,{children:"extremestretch"})," : optimized for stretching (slowing down) material, limited to a stretch factor between 0.5 and 4"]}),"\n",(0,i.jsxs)(n.li,{children:[(0,i.jsx)(n.code,{children:"effcient"})," : best option when CPU efficiency is critical"]}),"\n"]}),"\n",(0,i.jsx)(n.h2,{id:"loop",children:"loop"}),"\n",(0,i.jsxs)(n.p,{children:["The ",(0,i.jsx)(n.code,{children:"loop"})," instrument is basically the ",(0,i.jsx)(n.code,{children:"sample"})," instrument but with ",(0,i.jsx)(n.code,{children:"stretch(1)"})," enabled by default, making all the loaded samples stretch to 1 full bar. For all available ",(0,i.jsx)(n.code,{children:"instrument-functions"})," of ",(0,i.jsx)(n.code,{children:"loop"})," see ",(0,i.jsx)(n.a,{href:"#sample",children:(0,i.jsx)(n.code,{children:"sample"})})," above."]}),"\n",(0,i.jsx)(n.pre,{children:(0,i.jsx)(n.code,{className:"language-js",children:"new loop \n"})}),"\n",(0,i.jsx)(n.h2,{id:"polysynth",children:"polySynth"}),"\n",(0,i.jsxs)(n.p,{children:["The polySynth functions the same as the ",(0,i.jsx)(n.code,{children:"synth"})," instrument in the sense that you choose a waveform, apply a ",(0,i.jsx)(n.code,{children:"note()"}),", add a ",(0,i.jsx)(n.code,{children:"shape()"}),", etc. For explanation of those functions see ",(0,i.jsx)(n.a,{href:"#synth",children:(0,i.jsx)(n.code,{children:"synth"})}),"."]}),"\n",(0,i.jsxs)(n.p,{children:["The extra feature of the polySynth is that it allows for overlapping notes to generate chords. Notes provided to the ",(0,i.jsx)(n.code,{children:"note()"})," function as a 2-dimensional list will be played on the same time as a chord. By default there are 8 voices available at the same time. Voice stealing is ",(0,i.jsx)(n.code,{children:"on"}),' by default meaning that if a new note is played while all voices are busy the "oldest" triggered note will be removed.']}),"\n",(0,i.jsx)(n.pre,{children:(0,i.jsx)(n.code,{className:"language-js",children:"new polySynth note([ [chord1] [chord2] ... [chord-n] ])\n"})}),"\n",(0,i.jsx)(n.p,{children:"You can think of a 2D list like so:"}),"\n",(0,i.jsx)(n.pre,{children:(0,i.jsx)(n.code,{className:"language-js",children:"list chords [ [ 0 3 7 ] [ 2 5 9 ] [ 3 6 10 13 ] ]\n\nlist chords [ 0 2 3 ]\n 3 5 6 \n 7 9 10\n 13 \n"})}),"\n",(0,i.jsxs)(n.p,{children:["So the list ",(0,i.jsx)(n.code,{children:"chords"})," has ",(0,i.jsx)(n.code,{children:"3"}),' "items", and those ',(0,i.jsx)(n.code,{children:"3"})," items again contain a ",(0,i.jsx)(n.code,{children:"list"})]}),"\n",(0,i.jsx)(n.pre,{children:(0,i.jsx)(n.code,{className:"language-js",children:"list chords [ [ 0 3 7 ] [ 2 5 9 ] [ 3 6 10 13 ] ]\n\nnew polySynth sine note(chord 2) time(1/2) shape(1 1/4) \n"})}),"\n",(0,i.jsx)(n.h3,{id:"steal",children:"steal"}),"\n",(0,i.jsxs)(n.p,{children:["With steal you can choose the behaviour of what happens when new notes are triggered while all voices are in use. When steal is ",(0,i.jsx)(n.code,{children:"on"})," (the default) every new note will be triggered and old notes will be overwritten by the new ones. If steal is ",(0,i.jsx)(n.code,{children:"off"})," new notes are not triggered while all voices are busy. You'll have to wait till some voice is done playing, based on the ",(0,i.jsx)(n.code,{children:"shape()"})," before a note can be triggered again."]}),"\n",(0,i.jsx)(n.p,{children:(0,i.jsx)(n.strong,{children:"arguments"})}),"\n",(0,i.jsxs)(n.ul,{children:["\n",(0,i.jsxs)(n.li,{children:[(0,i.jsx)(n.code,{children:"Bool/Name"})," -> turn voice stealing ",(0,i.jsx)(n.code,{children:"on"})," or ",(0,i.jsx)(n.code,{children:"off"})," (optional, default=on)"]}),"\n"]}),"\n",(0,i.jsx)(n.pre,{children:(0,i.jsx)(n.code,{className:"language-js",children:"list notes spread(16 0 36)\n\nnew polySynth sine note(notes 2) time(1/16) shape(1 1/1) steal(off)\n"})}),"\n",(0,i.jsx)(n.admonition,{type:"warning",children:(0,i.jsxs)(n.p,{children:["If you use ",(0,i.jsx)(n.code,{children:"steal(off)"})," but also set ",(0,i.jsx)(n.code,{children:"shape(off)"})," you won't be able to trigger any new notes after all voices are filled because there is no shape to stop any voice from sounding."]})}),"\n",(0,i.jsx)(n.h3,{id:"spread",children:"spread"}),"\n",(0,i.jsx)(n.admonition,{title:"Mercury4Max only",type:"warning"}),"\n",(0,i.jsx)(n.p,{children:"Use the spread function to add little delays with optional randomness between every note in a chord, resulting in the chord to sound broken up in time (spread out)."}),"\n",(0,i.jsx)(n.p,{children:(0,i.jsx)(n.strong,{children:"arguments"})}),"\n",(0,i.jsxs)(n.ul,{children:["\n",(0,i.jsxs)(n.li,{children:[(0,i.jsx)(n.code,{children:"Number+/Fraction(List)"})," -> the delaytime between note triggers in ms or fraction (default=0)"]}),"\n",(0,i.jsxs)(n.li,{children:[(0,i.jsx)(n.code,{children:"Number+/Fraction(List)"})," -> random delaytime offset added to the delaytime in ms or fraction (default=0)"]}),"\n"]}),"\n",(0,i.jsx)(n.pre,{children:(0,i.jsx)(n.code,{className:"language-js",children:"list notes [ [0 3 7 11 12] ]\n\nnew polySynth sine note(notes 2) shape(1 1/1) time(1/1) spread(150 50)\n"})}),"\n",(0,i.jsx)(n.h3,{id:"voices",children:"voices"}),"\n",(0,i.jsx)(n.admonition,{title:"not (yet) supported",type:"warning"}),"\n",(0,i.jsx)(n.h2,{id:"polysample",children:"polySample"}),"\n",(0,i.jsx)(n.admonition,{title:"Mercury Playground only",type:"warning"}),"\n",(0,i.jsxs)(n.p,{children:["The polySample functions the same as the ",(0,i.jsx)(n.code,{children:"sample"})," in the sense that you choose a sample file, set a ",(0,i.jsx)(n.code,{children:"speed()"}),", add a ",(0,i.jsx)(n.code,{children:"shape()"}),", etc. For explanation of those functions see ",(0,i.jsx)(n.a,{href:"#sample",children:(0,i.jsx)(n.code,{children:"sample"})}),"."]}),"\n",(0,i.jsxs)(n.p,{children:["The extra feature of the polySample is that it allows for overlapping sounds. For example useful when generating chords. Notes provided to the ",(0,i.jsx)(n.code,{children:"note()"})," function as a 2-dimensional list will be played at the same time as a chord. By default there are 8 voices available at the same time."]}),"\n",(0,i.jsxs)(n.p,{children:["For explanation of using ",(0,i.jsx)(n.code,{children:"2D-list"}),"'s in ",(0,i.jsx)(n.code,{children:"note()"})," for polyphony see ",(0,i.jsx)(n.a,{href:"#polysynth",children:(0,i.jsx)(n.code,{children:"polySynth"})})," voice-stealing see ",(0,i.jsx)(n.a,{href:"#steal",children:(0,i.jsx)(n.code,{children:"steal"})})," under ",(0,i.jsx)(n.code,{children:"polySynth"}),". For setting voice-amount see ",(0,i.jsx)(n.a,{href:"#voices",children:(0,i.jsx)(n.code,{children:"voices"})}),"."]}),"\n",(0,i.jsx)(n.pre,{children:(0,i.jsx)(n.code,{className:"language-js",children:"set tempo 100\nset scale dorian eb\n\nlist notes shuffle(spread(24))\nnew polySample piano_e time(1/16) note(notes 1) shape(1 1/2) steal(off) tune(64)\n"})}),"\n",(0,i.jsx)(n.h2,{id:"midi",children:"midi"}),"\n",(0,i.jsxs)(n.p,{children:["The ",(0,i.jsx)(n.code,{children:"midi"})," instrument allows you to send MIDI messages (notes, pitchbend, controlchange, programchange) to other external devices or virtual devices in your computer. The ",(0,i.jsx)(n.code,{children:""})," is the literal name as a ",(0,i.jsx)(n.code,{children:"string"})," of the device as it shows up when connected to the computer. For example this can be something like ",(0,i.jsx)(n.code,{children:'"My MIDI Device"'}),". You can also choose ",(0,i.jsx)(n.code,{children:"default"})," to set the instrument to the first midi device in the list. The name is written as a ",(0,i.jsx)(n.code,{children:"string"})," between ",(0,i.jsx)(n.code,{children:'" "'})," and is sensitive to upper and lower cases. To setup a basic midi instrument use:"]}),"\n",(0,i.jsx)(n.pre,{children:(0,i.jsx)(n.code,{className:"language-js",children:"new midi \n"})}),"\n",(0,i.jsx)(n.p,{children:(0,i.jsx)(n.strong,{children:"arguments"})}),"\n",(0,i.jsxs)(n.ul,{children:["\n",(0,i.jsxs)(n.li,{children:[(0,i.jsx)(n.code,{children:"Name"})," -> ",(0,i.jsx)(n.code,{children:"default"})," or MIDI Device name as a ",(0,i.jsx)(n.code,{children:"string"})]}),"\n"]}),"\n",(0,i.jsxs)(n.p,{children:["Functions ",(0,i.jsx)(n.code,{children:"note()"}),", ",(0,i.jsx)(n.code,{children:"time()"}),", ",(0,i.jsx)(n.code,{children:"name()"}),", ",(0,i.jsx)(n.code,{children:"group()"}),", ",(0,i.jsx)(n.code,{children:"once()"}),", ",(0,i.jsx)(n.code,{children:"play()"}),", ",(0,i.jsx)(n.code,{children:"ratchet()"}),", ",(0,i.jsx)(n.code,{children:"timediv()"}),", ",(0,i.jsx)(n.code,{children:"warp()"}),", ",(0,i.jsx)(n.code,{children:"wait()"})," all work the same for the ",(0,i.jsx)(n.code,{children:"midi"})," instrument. There are some differences when using the ",(0,i.jsx)(n.code,{children:"shape()"})," and ",(0,i.jsx)(n.code,{children:"gain()"})," functions."]}),"\n",(0,i.jsx)(n.h3,{id:"note-2",children:"note"}),"\n",(0,i.jsxs)(n.p,{children:["The ",(0,i.jsx)(n.code,{children:"note"})," function allows you to play a midinote. The function works the same as the ",(0,i.jsx)(n.code,{children:"note"})," function explained under the ",(0,i.jsx)(n.code,{children:"synth"}),". Please see ",(0,i.jsx)(n.a,{href:"#note",children:(0,i.jsx)(n.code,{children:"note()"})})," for further information."]}),"\n",(0,i.jsx)(n.pre,{children:(0,i.jsx)(n.code,{className:"language-js",children:"set scale major D\n\nlist notes [0 7 5 3]\n\nnew midi default note(notes 2)\n// plays the midi notes 62 69 67 64\n"})}),"\n",(0,i.jsx)(n.h3,{id:"length",children:"length"}),"\n",(0,i.jsxs)(n.p,{children:["Replaces the ",(0,i.jsx)(n.code,{children:"shape()"})," function of ",(0,i.jsx)(n.code,{children:"synth"})," and ",(0,i.jsx)(n.code,{children:"sample"}),". Set the duration of the midi-note. This means it will send a ",(0,i.jsx)(n.code,{children:"note-off"})," message after a ",(0,i.jsx)(n.code,{children:"number"})," of milliseconds or ",(0,i.jsx)(n.code,{children:"fraction"}),". If the instrument is triggered before the end of the duration, the note-off is canceled and a new note-off is scheduled."]}),"\n",(0,i.jsx)(n.p,{children:(0,i.jsx)(n.strong,{children:"arguments"})}),"\n",(0,i.jsxs)(n.ul,{children:["\n",(0,i.jsxs)(n.li,{children:[(0,i.jsx)(n.code,{children:"Number/Fraction(List)"})," -> Duration time in ms or fraction"]}),"\n"]}),"\n",(0,i.jsx)(n.pre,{children:(0,i.jsx)(n.code,{className:"language-js",children:"new midi default length(1500) time(1)\n"})}),"\n",(0,i.jsx)(n.p,{children:"with fraction:"}),"\n",(0,i.jsx)(n.pre,{children:(0,i.jsx)(n.code,{className:"language-js",children:"new midi default length(1/2) time(1)\n//=> duration of 1/2 (1200 ms at 100 bpm)\n"})}),"\n",(0,i.jsxs)(n.p,{children:["Alias: ",(0,i.jsx)(n.code,{children:"duration()"}),", ",(0,i.jsx)(n.code,{children:"shape()"})]}),"\n",(0,i.jsx)(n.h3,{id:"channel",children:"channel"}),"\n",(0,i.jsxs)(n.p,{children:["Set the midi-channel output for the midi-note to be send to. ",(0,i.jsx)(n.code,{children:"out()"})," can be used as an alias to reduce some typing."]}),"\n",(0,i.jsx)(n.p,{children:(0,i.jsx)(n.strong,{children:"arguments"})}),"\n",(0,i.jsxs)(n.ul,{children:["\n",(0,i.jsxs)(n.li,{children:[(0,i.jsx)(n.code,{children:"Number+(List)"})," -> Channel to send the midi-note to"]}),"\n"]}),"\n",(0,i.jsx)(n.pre,{children:(0,i.jsx)(n.code,{className:"language-js",children:"new midi default note(7 2) channel(1)\nnew midi default note(0 0) channel(2)\n"})}),"\n",(0,i.jsxs)(n.p,{children:["Alias: ",(0,i.jsx)(n.code,{children:"out()"})]}),"\n",(0,i.jsx)(n.h3,{id:"chord",children:"chord"}),"\n",(0,i.jsxs)(n.p,{children:["By default the ",(0,i.jsx)(n.code,{children:"midi"})," instrument's output is monophonic. You can turn the chord output (polyphony) on for a midi instrument with this function. This allows you to use ",(0,i.jsx)(n.code,{children:"2D-list"}),"s where the 2nd dimension is used to generate chords. Read more about chords under ",(0,i.jsx)(n.a,{href:"#polysynth",children:(0,i.jsx)(n.code,{children:"polySynth"})}),"."]}),"\n",(0,i.jsx)(n.p,{children:(0,i.jsx)(n.strong,{children:"arguments"})}),"\n",(0,i.jsxs)(n.ul,{children:["\n",(0,i.jsxs)(n.li,{children:[(0,i.jsx)(n.code,{children:"Bool"})," -> Turn chord output on/off"]}),"\n"]}),"\n",(0,i.jsx)(n.pre,{children:(0,i.jsx)(n.code,{className:"language-js",children:"list chords [[0 4 7] [2 5 9] [5 9 0]]\n\nnew midi default note(chords 1) chord(on)\n"})}),"\n",(0,i.jsx)(n.h3,{id:"program",children:"program"}),"\n",(0,i.jsxs)(n.p,{children:["Send program change messages to the specified midi-channel of the instrument. The channel number is based on the ",(0,i.jsx)(n.code,{children:"out()"})," function (see ",(0,i.jsx)(n.a,{href:"#channel",children:(0,i.jsx)(n.code,{children:"channel"})}),"). The default channel ",(0,i.jsx)(n.code,{children:"1"})," is used if no channel is selected. The program change value is zero-based, an integer from ",(0,i.jsx)(n.code,{children:"0"})," - ",(0,i.jsx)(n.code,{children:"127"})," and can be sequenced as a list. If no value is provided there is no program change send. The value is ",(0,i.jsx)(n.strong,{children:"only"})," send when it changes based on the previous value. This is done because some midi devices react every time a program change is received (for example cutting of notes), even if the value stays the same."]}),"\n",(0,i.jsx)(n.p,{children:(0,i.jsx)(n.strong,{children:"arguments"})}),"\n",(0,i.jsxs)(n.ul,{children:["\n",(0,i.jsxs)(n.li,{children:[(0,i.jsx)(n.code,{children:"Int+(List)"})," -> Program change value 0-127 (default=off)"]}),"\n"]}),"\n",(0,i.jsx)(n.pre,{children:(0,i.jsx)(n.code,{className:"language-js",children:"list notes spread(5 0 12)\nlist changes [0 10 20]\n\nnew midi default note(notes 1) out(1) program(changes)\n"})}),"\n",(0,i.jsxs)(n.p,{children:["Alias: ",(0,i.jsx)(n.code,{children:"pgm()"})]}),"\n",(0,i.jsx)(n.h3,{id:"change",children:"change"}),"\n",(0,i.jsxs)(n.p,{children:["Send control change (CC) messages to the midi device. This function replaces the ",(0,i.jsx)(n.code,{children:"effect()"})," function of an instrument and can have multiple calls in the same instrument, every call can be a different control number. The first argument is the ",(0,i.jsx)(n.code,{children:"number"})," for the control, the second argument is the ",(0,i.jsx)(n.code,{children:"number"})," for the controller value or a list of controller values. You can use ",(0,i.jsx)(n.code,{children:"cc()"})," as an alias to reduce typing."]}),"\n",(0,i.jsx)(n.p,{children:(0,i.jsx)(n.strong,{children:"arguments"})}),"\n",(0,i.jsxs)(n.ul,{children:["\n",(0,i.jsxs)(n.li,{children:[(0,i.jsx)(n.code,{children:"Int+"})," -> controller number between 0-127"]}),"\n",(0,i.jsxs)(n.li,{children:[(0,i.jsx)(n.code,{children:"Int+(List)"})," -> controller value between 0-127"]}),"\n"]}),"\n",(0,i.jsx)(n.pre,{children:(0,i.jsx)(n.code,{className:"language-js",children:"list ccValues [10 20 30 40 50]\n\nnew midi default time(1/8) change(13 100) change(21 ccValues)\n"})}),"\n",(0,i.jsxs)(n.p,{children:["Alias: ",(0,i.jsx)(n.code,{children:"cc()"})]}),"\n",(0,i.jsx)(n.h3,{id:"sync",children:"sync"}),"\n",(0,i.jsx)(n.admonition,{title:"Mercury4Max only",type:"warning"}),"\n",(0,i.jsx)(n.p,{children:"Turn the midiclock syncing on/off for an individual instrument and send it to the selected port/device from that instrument."}),"\n",(0,i.jsx)(n.p,{children:(0,i.jsx)(n.strong,{children:"arguments"})}),"\n",(0,i.jsxs)(n.ul,{children:["\n",(0,i.jsxs)(n.li,{children:[(0,i.jsx)(n.code,{children:"Bool"})," -> Turn syncing on/off"]}),"\n"]}),"\n",(0,i.jsx)(n.pre,{children:(0,i.jsx)(n.code,{className:"language-js",children:'new midi "My Midi Device" sync(on)\nnew midi "Another Device" sync(off)\n'})}),"\n",(0,i.jsxs)(n.p,{children:["Alias: ",(0,i.jsx)(n.code,{children:"clock()"})]}),"\n",(0,i.jsx)(n.h2,{id:"input",children:"input"}),"\n",(0,i.jsxs)(n.p,{children:["Use the input from the soundcard (ADC, Analog Digital Converter) as the source for an instrument. The sound can be modified by all the various ",(0,i.jsx)(n.code,{children:"fx()"}),"'s. The volume can be adjusted with ",(0,i.jsx)(n.code,{children:"gain()"}),". An envelope can be applied on the sound with ",(0,i.jsx)(n.code,{children:"shape()"})," and this envelope can be triggered with ",(0,i.jsx)(n.code,{children:"time()"})," just as with the regular instruments ",(0,i.jsx)(n.code,{children:"sample"}),", ",(0,i.jsx)(n.code,{children:"synth"}),", etc. Use the words ",(0,i.jsx)(n.code,{children:"in1"}),", ",(0,i.jsx)(n.code,{children:"in2"}),", ..., ",(0,i.jsx)(n.code,{children:"inx"})," to choose the input source. Use ",(0,i.jsx)(n.code,{children:"default"})," to pick the first input in the list."]}),"\n",(0,i.jsx)(n.pre,{children:(0,i.jsx)(n.code,{className:"language-js",children:"new input \n"})}),"\n",(0,i.jsx)(n.p,{children:(0,i.jsx)(n.strong,{children:"arguments"})}),"\n",(0,i.jsxs)(n.ul,{children:["\n",(0,i.jsxs)(n.li,{children:[(0,i.jsx)(n.code,{children:"Name"})," -> ",(0,i.jsx)(n.code,{children:"default"})," or the input channel number as a string ",(0,i.jsx)(n.code,{children:"inX"})]}),"\n"]}),"\n",(0,i.jsx)(n.pre,{children:(0,i.jsx)(n.code,{className:"language-js",children:"// use the default input, in most cases channel 1\nnew input default gain(1)\n\n// use a specific channel\nnew input in3 gain(0.9) \n\n// add functions like shape, time and fx\nnew input in4 gain(0.9) time(1/16) shape(1 100) fx(reverb) fx(distort)\n"})}),"\n",(0,i.jsx)(n.admonition,{type:"info",children:(0,i.jsx)(n.p,{children:"In the browser you will need to give permission to use the microphone. Afterwards you might need to refresh the page."})}),"\n",(0,i.jsx)(n.h2,{id:"osc",children:"osc"}),"\n",(0,i.jsxs)(n.p,{children:["Create an instrument that sends OSC-messages. The ",(0,i.jsx)(n.code,{children:""})," is used to set the opening address of the message to ",(0,i.jsx)(n.code,{children:"/"}),". Any arbitrary function name is used to set as second address in the osc-string. If no name is provided it will default to a unique number for every instrument instance. By adding other functions with any arbitrary name you can send a message with the address in the form of ",(0,i.jsx)(n.code,{children:"// "})]}),"\n",(0,i.jsx)(n.pre,{children:(0,i.jsx)(n.code,{className:"language-js",children:"new osc \n"})}),"\n",(0,i.jsx)(n.pre,{children:(0,i.jsx)(n.code,{className:"language-js",children:'list params [0.25 0.5 0.75]\nlist values [3 1]\n\nnew osc "myOSC" time(1/4) someParam(params) anotherParam(values)\n\n// sends => /myOSC/someParams 0.25\n// /myOSC/anotherParam 3\n// /myOSC/someParams 0.5\n// /myOSC/anotherParam 1\n// etc...\n'})}),"\n",(0,i.jsxs)(n.p,{children:["The messages also support multiple arguments up to a length of 256. Multiple arguments can be provided as ",(0,i.jsx)(n.code,{children:"list"}),"s, ",(0,i.jsx)(n.code,{children:"string"}),"s, ",(0,i.jsx)(n.code,{children:"float"}),"s or ",(0,i.jsx)(n.code,{children:"int"}),"s."]}),"\n",(0,i.jsx)(n.pre,{children:(0,i.jsx)(n.code,{className:"language-js",children:"list val1 [0.25 0.5 0.75]\nlist val2 [3 1]\n\nnew osc myOSC time(1/4) aMessage(0.1 val1 val2 100)\n\n// emits => /myOSC/aMessage 0.1 0.25 3 100\n// /myOSC/aMessage 0.1 0.5 1 100\n// /myOSC/aMessage 0.1 0.75 3 100\n// etc...\n"})}),"\n",(0,i.jsxs)(n.admonition,{type:"tip",children:[(0,i.jsxs)(n.p,{children:["If you want multiple ",(0,i.jsx)(n.code,{children:"osc"})," to send to the same address, you can use the same ",(0,i.jsx)(n.code,{children:""})," but use different ",(0,i.jsx)(n.code,{children:"name()"}),"s for reference in the code. Useful if you want to send messages to the same address, but with different timing-intervals."]}),(0,i.jsx)(n.pre,{children:(0,i.jsx)(n.code,{className:"language-js",children:"list params [0.25 0.5 0.75]\nlist values [3 1 4]\n\nnew osc myOSC name(osc1) time(1/4) \n set osc1 someParam(params)\n\nnew osc myOSC name(osc2) time(1/2)\n set osc2 anotherParam(values)\n"})})]}),"\n",(0,i.jsx)(n.h3,{id:"receiving",children:"receiving"}),"\n",(0,i.jsxs)(n.p,{children:["You can use osc adresses as arguments for other functions by putting the address as argument in the form: ",(0,i.jsx)(n.code,{children:"/
//"}),". For example to control the ",(0,i.jsx)(n.code,{children:"gain()"})," of a ",(0,i.jsx)(n.code,{children:"sample"})," and the ",(0,i.jsx)(n.code,{children:"note()"})," value of a ",(0,i.jsx)(n.code,{children:"synth"})," enter the following:"]}),"\n",(0,i.jsx)(n.pre,{children:(0,i.jsx)(n.code,{className:"language-js",children:"new sample kick_909 time(1/4) gain(/myOSC/sliderValue1)\nnew synth saw note(/myOSC/sliderValue2) shape(1 100) time(1/8)\n"})}),"\n",(0,i.jsxs)(n.p,{children:["It is possible to scale the incoming osc value to a different range by using ",(0,i.jsx)(n.code,{children:"{}"})," after the address inputting a low and high output range separated by a colon ",(0,i.jsx)(n.code,{children:":"}),". The scaling function considers an incoming range of ",(0,i.jsx)(n.code,{children:"0 - 1"})," floatingpoint values. For example to control the ",(0,i.jsx)(n.code,{children:"note()"})," and ",(0,i.jsx)(n.code,{children:"shape()"})," ranges in a ",(0,i.jsx)(n.code,{children:"synth"})," enter the following:"]}),"\n",(0,i.jsx)(n.pre,{children:(0,i.jsx)(n.code,{className:"language-js",children:"new synth saw note(/myOsc/sliderValue3{2:19} 0) shape(1 /myOsc/sliderValue4{50:500}) \n// => converts incoming slider values from 0-1 to 2-19 for note and 0-1 to 50-500 for note length\n"})}),"\n",(0,i.jsx)(n.h2,{id:"modulator",children:"modulator"}),"\n",(0,i.jsx)(n.admonition,{title:"Mercury4Max only",type:"warning"}),"\n",(0,i.jsxs)(n.p,{children:["The modulator allows you to send a modulation signal as an argument to parameters in ",(0,i.jsx)(n.code,{children:"instrument-function"}),"s of other instruments. These parameters are continuously modulated at a specific rate with a specific waveform. The modulation rate is independent from the instruments ",(0,i.jsx)(n.code,{children:"time()"})," (in comparison when using a list as an argument). It is also possible to send the modulation signal directly out to the connected soundcard on a specific DAC channel (Digital Analog Converter). This can for example be used for CV-modulations."]}),"\n",(0,i.jsx)(n.p,{children:(0,i.jsx)(n.strong,{children:"arguments"})}),"\n",(0,i.jsxs)(n.ul,{children:["\n",(0,i.jsxs)(n.li,{children:[(0,i.jsx)(n.code,{children:"Name"})," -> modulator waveform type: ",(0,i.jsx)(n.code,{children:"sine"}),"/",(0,i.jsx)(n.code,{children:"sin"}),", ",(0,i.jsx)(n.code,{children:"sawUp"}),"/",(0,i.jsx)(n.code,{children:"phasor"}),", ",(0,i.jsx)(n.code,{children:"sawDown"}),"/",(0,i.jsx)(n.code,{children:"saw"}),", ",(0,i.jsx)(n.code,{children:"square"}),"/",(0,i.jsx)(n.code,{children:"rect"}),", ",(0,i.jsx)(n.code,{children:"triangle"}),"/",(0,i.jsx)(n.code,{children:"tri"}),", ",(0,i.jsx)(n.code,{children:"random"}),"/",(0,i.jsx)(n.code,{children:"rand"}),", ",(0,i.jsx)(n.code,{children:"randomLine"}),"/",(0,i.jsx)(n.code,{children:"randL"}),", ",(0,i.jsx)(n.code,{children:"trigger"}),"/",(0,i.jsx)(n.code,{children:"gate"})]}),"\n"]}),"\n",(0,i.jsx)(n.pre,{children:(0,i.jsx)(n.code,{className:"language-js",children:"new modulator name() range( ) time() out()\n"})}),"\n",(0,i.jsx)(n.h3,{id:"name-1",children:"name"}),"\n",(0,i.jsxs)(n.p,{children:["Replaces the ",(0,i.jsx)(n.code,{children:"name()"})," function. Set the name for the modulator, this name can be used as argument in the functions of an instrument like ",(0,i.jsx)(n.code,{children:"synth"})," and ",(0,i.jsx)(n.code,{children:"sample"})]}),"\n",(0,i.jsx)(n.p,{children:(0,i.jsx)(n.strong,{children:"arguments"})}),"\n",(0,i.jsxs)(n.ul,{children:["\n",(0,i.jsxs)(n.li,{children:[(0,i.jsx)(n.code,{children:"Name"})," -> the modulator ",(0,i.jsx)(n.code,{children:"name"})," for reference in other functions"]}),"\n"]}),"\n",(0,i.jsx)(n.pre,{children:(0,i.jsx)(n.code,{className:"language-js",children:"// set the name to myModulator\nnew modulator sine name(myModulator)\n\n// the synth uses the modulator in the gain function\nnew synth saw gain(myModulator)\n"})}),"\n",(0,i.jsx)(n.h3,{id:"time-1",children:"time"}),"\n",(0,i.jsxs)(n.p,{children:["Replaces the ",(0,i.jsx)(n.code,{children:"time()"})," function. Set the modulation speed as a ",(0,i.jsx)(n.code,{children:"fraction"})," or ",(0,i.jsx)(n.code,{children:"float+"}),". The default is ",(0,i.jsx)(n.code,{children:"1/1"})," (one period per bar)."]}),"\n",(0,i.jsx)(n.p,{children:(0,i.jsx)(n.strong,{children:"arguments"})}),"\n",(0,i.jsxs)(n.ul,{children:["\n",(0,i.jsxs)(n.li,{children:[(0,i.jsx)(n.code,{children:"Fraction/Float+"})," -> The time interval for one period of the modulation waveform (optional, default=1/1)"]}),"\n",(0,i.jsxs)(n.li,{children:[(0,i.jsx)(n.code,{children:"Fraction/Float+"})," -> The time offset for the modulation (optional, default=0)"]}),"\n"]}),"\n",(0,i.jsx)(n.pre,{children:(0,i.jsx)(n.code,{className:"language-js",children:"// modulate a sinewave at a period of one per 4 bars\nnew modulator sine time(4/1)\n"})}),"\n",(0,i.jsx)(n.h3,{id:"range",children:"range"}),"\n",(0,i.jsxs)(n.p,{children:["Set the modulation range between a lower and upper value with an optional exponential value. The default range is ",(0,i.jsx)(n.code,{children:"0"})," to ",(0,i.jsx)(n.code,{children:"1"}),"."]}),"\n",(0,i.jsx)(n.p,{children:(0,i.jsx)(n.strong,{children:"arguments"})}),"\n",(0,i.jsxs)(n.ul,{children:["\n",(0,i.jsxs)(n.li,{children:[(0,i.jsx)(n.code,{children:"Number"})," -> The low output range (optional, default=0)"]}),"\n",(0,i.jsxs)(n.li,{children:[(0,i.jsx)(n.code,{children:"Number"})," -> The high output range (optional, default=1)"]}),"\n",(0,i.jsxs)(n.li,{children:[(0,i.jsx)(n.code,{children:"Number"})," -> The scaling exponent (optional, default=1)"]}),"\n"]}),"\n",(0,i.jsx)(n.pre,{children:(0,i.jsx)(n.code,{className:"language-js",children:"// set the range from 200 to 5000, for example to modulate a filter cutoff in Hz\nnew modulator sine range(200 5000)\n\n// include the third argument to set the exponential in the scaling\nnew modulator sine range(200 5000 3)\n"})}),"\n",(0,i.jsx)(n.h3,{id:"out",children:"out"}),"\n",(0,i.jsxs)(n.p,{children:["Set the output channel from your connected soundcard to send the modulation signal directly to. The default is 0 (no output to DAC). Currently the maximum number of channels that can be used is 16. If the modulation signal is only used for direct output it is not necessary to also ",(0,i.jsx)(n.code,{children:"name()"})," the modulator."]}),"\n",(0,i.jsx)(n.p,{children:(0,i.jsx)(n.strong,{children:"arguments"})}),"\n",(0,i.jsxs)(n.ul,{children:["\n",(0,i.jsxs)(n.li,{children:[(0,i.jsx)(n.code,{children:"Number+"})," -> The channel number from 1 till number of outputs available, maximum of 16 (default=0)"]}),"\n"]}),"\n",(0,i.jsx)(n.pre,{children:(0,i.jsx)(n.code,{className:"language-js",children:"// send a sinewave modulator signal to DAC channel 3\nnew modulator sine range(-1 1) out(3)\n"})}),"\n",(0,i.jsx)(n.admonition,{type:"warning",children:(0,i.jsx)(n.p,{children:"Be careful when sending DC signals with large ranges to your DAC, this could damage your speakers if you choose the wrong output!"})}),"\n",(0,i.jsx)(n.h3,{id:"trigger",children:"trigger"}),"\n",(0,i.jsxs)(n.p,{children:["When using the mode ",(0,i.jsx)(n.code,{children:"trigger"}),"/",(0,i.jsx)(n.code,{children:"gate"})," the modulator functions like the sequencer in the other instruments. Meaning that you can include the ",(0,i.jsx)(n.code,{children:"play()"})," function to add a rhythm list, use ",(0,i.jsx)(n.code,{children:"ratchet()"})," to add a list of timing subdivisions with probability and use ",(0,i.jsx)(n.code,{children:"warp()"})," to add a list of time warpings."]}),"\n",(0,i.jsx)(n.p,{children:(0,i.jsx)(n.strong,{children:"arguments"})}),"\n",(0,i.jsxs)(n.ul,{children:["\n",(0,i.jsxs)(n.li,{children:[(0,i.jsx)(n.code,{children:"Name"})," -> ",(0,i.jsx)(n.code,{children:"trigger"}),"/",(0,i.jsx)(n.code,{children:"gate"})," sets the intrument to use the stepsequencer (default=off)"]}),"\n"]}),"\n",(0,i.jsx)(n.pre,{children:(0,i.jsx)(n.code,{className:"language-js",children:"// generate a euclidean rhythm and use it in the trigger\nlist rtm euclid(16 11)\nnew modulator trigger time(1/8) play(rtm) ratchet(0.1 2)\n"})}),"\n",(0,i.jsx)(n.h3,{id:"hold",children:"hold"}),"\n",(0,i.jsxs)(n.p,{children:["The hold function transforms the ",(0,i.jsx)(n.code,{children:"trigger"})," into a gate that goes open and closes after a certain amount of time. The time value can be either ",(0,i.jsx)(n.code,{children:"ms"})," or a ",(0,i.jsx)(n.code,{children:"fraction"}),". If the hold time is longer than the time interval between triggers the gate stays open. A hold of ",(0,i.jsx)(n.code,{children:"0"})," results in the click from the default trigger."]}),"\n",(0,i.jsx)(n.p,{children:(0,i.jsx)(n.strong,{children:"arguments"})}),"\n",(0,i.jsxs)(n.ul,{children:["\n",(0,i.jsxs)(n.li,{children:[(0,i.jsx)(n.code,{children:"Number+"})," -> hold time in ms or fraction (default=0)"]}),"\n"]}),"\n",(0,i.jsx)(n.pre,{children:(0,i.jsx)(n.code,{className:"language-js",children:"// trigger every 8th note, and leave the gate open for the length of 50ms\nnew modulator trigger time(1/8) hold(50)\n\n// trigger every 8th note, and leave the gate open for the length of a 16th\nnew modulator trigger time(1/8) hold(1/16)\n"})}),"\n",(0,i.jsx)(n.h2,{id:"emitter",children:"emitter"}),"\n",(0,i.jsx)(n.admonition,{title:"Deprecated in Mercury4Max",type:"warning",children:(0,i.jsxs)(n.p,{children:["Use ",(0,i.jsx)(n.a,{href:"#osc",children:(0,i.jsx)(n.code,{children:"osc"})})," instead (similar as in MercuryPlayground now)"]})}),"\n",(0,i.jsxs)(n.p,{children:["Create an emitter object. Use this object to send messages to other platforms. The emitter object works similarly to the Instruments in the sense that it also has the ",(0,i.jsx)(n.code,{children:"time"}),", ",(0,i.jsx)(n.code,{children:"beat"})," and ",(0,i.jsx)(n.code,{children:"name"})," functions by default. The ",(0,i.jsx)(n.code,{children:"time"})," determines the time-interval at which messages are send. The ",(0,i.jsx)(n.code,{children:"beat"})," can turn send moments on or off."]})]})}function h(e={}){const{wrapper:n}={...(0,t.R)(),...e.components};return n?(0,i.jsx)(n,{...e,children:(0,i.jsx)(c,{...e})}):c(e)}},8453:(e,n,s)=>{s.d(n,{R:()=>l,x:()=>d});var i=s(6540);const t={},r=i.createContext(t);function l(e){const n=i.useContext(r);return i.useMemo((function(){return"function"==typeof e?e(n):{...n,...e}}),[n,e])}function d(e){let n;return n=e.disableParentContext?"function"==typeof e.components?e.components(t):e.components||t:l(e.components),i.createElement(r.Provider,{value:n},e.children)}}}]); \ No newline at end of file +"use strict";(self.webpackChunkmercury_docs=self.webpackChunkmercury_docs||[]).push([[283],{9030:(e,n,s)=>{s.r(n),s.d(n,{assets:()=>o,contentTitle:()=>l,default:()=>h,frontMatter:()=>r,metadata:()=>d,toc:()=>a});var i=s(4848),t=s(8453);const r={sidebar_position:3},l="Instrument Functions",d={id:"reference/instruments",title:"Instrument Functions",description:"An instrument is the main sound or sequencing source in Mercury. Instruments can produce sounds natively in Mercury by means of synthesis or sampling, but can also send out MIDI or OSC-messages to trigger external devices or plugins, and are able to take input from for example your microphone. The following functions apply to all the types of instruments such as synth, sample, loop, polySynth, polySample, midi, osc and input.",source:"@site/docs/reference/instruments.md",sourceDirName:"reference",slug:"/reference/instruments",permalink:"/mercury/docs/reference/instruments",draft:!1,unlisted:!1,tags:[],version:"current",sidebarPosition:3,frontMatter:{sidebar_position:3},sidebar:"tutorialSidebar",previous:{title:"Global Settings",permalink:"/mercury/docs/reference/global"},next:{title:"Instrument Effects",permalink:"/mercury/docs/reference/effects"}},o={},a=[{value:"All Instruments",id:"all-instruments",level:2},{value:"name",id:"name",level:3},{value:"group",id:"group",level:3},{value:"time",id:"time",level:3},{value:"once",id:"once",level:3},{value:"play",id:"play",level:3},{value:"shape",id:"shape",level:3},{value:"gain",id:"gain",level:3},{value:"pan",id:"pan",level:3},{value:"effect",id:"effect",level:3},{value:"ratchet",id:"ratchet",level:3},{value:"timediv",id:"timediv",level:3},{value:"warp",id:"warp",level:3},{value:"wait",id:"wait",level:3},{value:"synth",id:"synth",level:2},{value:"note",id:"note",level:3},{value:"slide",id:"slide",level:3},{value:"super",id:"super",level:3},{value:"wave2",id:"wave2",level:3},{value:"sub",id:"sub",level:3},{value:"noise",id:"noise",level:3},{value:"sample",id:"sample",level:2},{value:"speed",id:"speed",level:3},{value:"start",id:"start",level:3},{value:"note",id:"note-1",level:3},{value:"tune",id:"tune",level:3},{value:"stretch",id:"stretch",level:3},{value:"loop",id:"loop",level:2},{value:"polySynth",id:"polysynth",level:2},{value:"steal",id:"steal",level:3},{value:"spread",id:"spread",level:3},{value:"voices",id:"voices",level:3},{value:"polySample",id:"polysample",level:2},{value:"midi",id:"midi",level:2},{value:"note",id:"note-2",level:3},{value:"length",id:"length",level:3},{value:"channel",id:"channel",level:3},{value:"chord",id:"chord",level:3},{value:"program",id:"program",level:3},{value:"change",id:"change",level:3},{value:"sync",id:"sync",level:3},{value:"input",id:"input",level:2},{value:"osc",id:"osc",level:2},{value:"receiving",id:"receiving",level:3},{value:"modulator",id:"modulator",level:2},{value:"name",id:"name-1",level:3},{value:"time",id:"time-1",level:3},{value:"range",id:"range",level:3},{value:"out",id:"out",level:3},{value:"trigger",id:"trigger",level:3},{value:"hold",id:"hold",level:3},{value:"emitter",id:"emitter",level:2}];function c(e){const n={a:"a",admonition:"admonition",code:"code",em:"em",h1:"h1",h2:"h2",h3:"h3",li:"li",mdxAdmonitionTitle:"mdxAdmonitionTitle",p:"p",pre:"pre",strong:"strong",table:"table",tbody:"tbody",td:"td",th:"th",thead:"thead",tr:"tr",ul:"ul",...(0,t.R)(),...e.components};return(0,i.jsxs)(i.Fragment,{children:[(0,i.jsx)(n.h1,{id:"instrument-functions",children:"Instrument Functions"}),"\n",(0,i.jsxs)(n.p,{children:["An instrument is the main sound or sequencing source in Mercury. Instruments can produce sounds natively in Mercury by means of synthesis or sampling, but can also send out MIDI or OSC-messages to trigger external devices or plugins, and are able to take input from for example your microphone. The following functions apply to all the types of instruments such as ",(0,i.jsx)(n.code,{children:"synth"}),", ",(0,i.jsx)(n.code,{children:"sample"}),", ",(0,i.jsx)(n.code,{children:"loop"}),", ",(0,i.jsx)(n.code,{children:"polySynth"}),", ",(0,i.jsx)(n.code,{children:"polySample"}),", ",(0,i.jsx)(n.code,{children:"midi"}),", ",(0,i.jsx)(n.code,{children:"osc"})," and ",(0,i.jsx)(n.code,{children:"input"}),"."]}),"\n",(0,i.jsxs)(n.p,{children:["For detailed explanation of the syntax see: ",(0,i.jsx)(n.a,{href:"syntax",children:"Syntax"})," and ",(0,i.jsx)(n.a,{href:"actions#list",children:(0,i.jsx)(n.code,{children:"list"})})," under ",(0,i.jsx)(n.a,{href:"actions",children:"Actions"}),"."]}),"\n",(0,i.jsx)(n.p,{children:(0,i.jsx)(n.strong,{children:"Available instruments:"})}),"\n",(0,i.jsxs)(n.ul,{children:["\n",(0,i.jsx)(n.li,{children:(0,i.jsx)(n.a,{href:"#synth",children:(0,i.jsx)(n.code,{children:"synth"})})}),"\n",(0,i.jsx)(n.li,{children:(0,i.jsx)(n.a,{href:"#sample",children:(0,i.jsx)(n.code,{children:"sample"})})}),"\n",(0,i.jsx)(n.li,{children:(0,i.jsx)(n.a,{href:"#loop",children:(0,i.jsx)(n.code,{children:"loop"})})}),"\n",(0,i.jsx)(n.li,{children:(0,i.jsx)(n.a,{href:"#polysynth",children:(0,i.jsx)(n.code,{children:"polySynth"})})}),"\n",(0,i.jsxs)(n.li,{children:[(0,i.jsx)(n.a,{href:"#polysample",children:(0,i.jsx)(n.code,{children:"polySample"})})," ",(0,i.jsx)(n.em,{children:"MercuryPlayground only"})]}),"\n",(0,i.jsx)(n.li,{children:(0,i.jsx)(n.a,{href:"#input",children:(0,i.jsx)(n.code,{children:"input"})})}),"\n",(0,i.jsx)(n.li,{children:(0,i.jsx)(n.a,{href:"#midi",children:(0,i.jsx)(n.code,{children:"midi"})})}),"\n",(0,i.jsx)(n.li,{children:(0,i.jsx)(n.a,{href:"#osc",children:(0,i.jsx)(n.code,{children:"osc"})})}),"\n",(0,i.jsxs)(n.li,{children:[(0,i.jsx)(n.a,{href:"#modulator",children:(0,i.jsx)(n.code,{children:"modulator"})})," ",(0,i.jsx)(n.em,{children:"Mercury4Max only"})]}),"\n"]}),"\n",(0,i.jsx)(n.h2,{id:"all-instruments",children:"All Instruments"}),"\n",(0,i.jsx)(n.p,{children:"The following functions apply to all instruments."}),"\n",(0,i.jsx)(n.h3,{id:"name",children:"name"}),"\n",(0,i.jsxs)(n.p,{children:["Set the ",(0,i.jsx)(n.code,{children:"name"})," for this instrument. This can be any string of 3 or more characters. The ",(0,i.jsx)(n.code,{children:"name"})," is used as a reference to the instrument when the ",(0,i.jsx)(n.code,{children:"set"})," action is used to call functions for a specific instrument. The name is also used to generate an OSC-message that is send out from Mercury to trigger external things in sync with the instrument."]}),"\n",(0,i.jsx)(n.p,{children:(0,i.jsx)(n.strong,{children:"arguments"})}),"\n",(0,i.jsxs)(n.ul,{children:["\n",(0,i.jsxs)(n.li,{children:[(0,i.jsx)(n.code,{children:"Name"})," -> an instrument name (default=random character string)"]}),"\n"]}),"\n",(0,i.jsx)(n.pre,{children:(0,i.jsx)(n.code,{className:"language-js",children:"new synth saw name(bob)\n set bob gain(0.8) time(1/16)\n\nnew sample kick_909 name(alice)\n set alice gain(1.2) time(1/4)\n"})}),"\n",(0,i.jsx)(n.pre,{children:(0,i.jsx)(n.code,{className:"language-js",metastring:'title="expected osc messages:"',children:"/bob 1\n/alice 1\n"})}),"\n",(0,i.jsxs)(n.p,{children:["The ",(0,i.jsx)(n.code,{children:"name"})," can also be used to receive a stereo signal from the specific instrument sound in a Max patch (",(0,i.jsx)(n.em,{children:"this feature only works in Mercury4Max"}),"). This can be helpful for recording a multi-track of your code, or when wanting to work with multichannel outputs."]}),"\n",(0,i.jsx)(n.pre,{children:(0,i.jsx)(n.code,{children:"[receive~ alice] <- receive a mono signal from alice in a max-patch\n[mc.receive~ bob 2] <- receive a stereo signal from bob in a max-patch\n"})}),"\n",(0,i.jsx)(n.h3,{id:"group",children:"group"}),"\n",(0,i.jsx)(n.admonition,{title:"Currently (and hopefully temporarily) not working",type:"warning"}),"\n",(0,i.jsxs)(n.p,{children:["Set one or more ",(0,i.jsx)(n.code,{children:"group-name"}),"(s) for this instrument. This can be any string of 3 or more characters. With the ",(0,i.jsx)(n.code,{children:"group"})," you can apply a line of code to multiple instruments at the same time. The ",(0,i.jsx)(n.code,{children:"group"})," is ",(0,i.jsx)(n.strong,{children:"not"})," like a mixing bus, so using for example ",(0,i.jsx)(n.code,{children:"gain()"})," will overwrite the ",(0,i.jsx)(n.code,{children:"gain()"})," function on the line of the instrument. If you use the ",(0,i.jsx)(n.code,{children:"name()"})," function you have to make sure the name is set before the group is applied otherwise the reference won't work correctly."]}),"\n",(0,i.jsx)(n.p,{children:(0,i.jsx)(n.strong,{children:"arguments"})}),"\n",(0,i.jsxs)(n.ul,{children:["\n",(0,i.jsxs)(n.li,{children:[(0,i.jsx)(n.code,{children:"Name"})," -> a group name used for multiple instruments (default=none)"]}),"\n"]}),"\n",(0,i.jsx)(n.pre,{children:(0,i.jsx)(n.code,{className:"language-js",children:"// the hihat is not included in the group so will \n// not get the gain(0.8) and fx(reverb 0.9 11)\nnew sample hat_909 time(1/8)\n\nnew sample kick_909 group(drums) time(1/4)\nnew sample snare_909 group(drums) time(1/2 1/4)\n set drums gain(0.8) fx(reverb 0.9 11)\n"})}),"\n",(0,i.jsx)(n.h3,{id:"time",children:"time"}),"\n",(0,i.jsxs)(n.p,{children:["Set the time interval at which the internal clock for an instrument runs and the synth or sample is triggered. This can be an ",(0,i.jsx)(n.code,{children:"integer"}),", ",(0,i.jsx)(n.code,{children:"float"})," or ",(0,i.jsx)(n.code,{children:"fraction"}),". ",(0,i.jsx)(n.code,{children:"1"})," = 1measure, ",(0,i.jsx)(n.code,{children:"1/4"})," = quarter-note, ",(0,i.jsx)(n.code,{children:"1/12"})," = 8th triplet, ",(0,i.jsx)(n.code,{children:"3/16"})," = 3-16th notes, etc. Similarly you can set an offset in the timing. The ",(0,i.jsx)(n.code,{children:"time()"})," will start an internal counter for this instrument, incremented every time it is triggerd (based on the ",(0,i.jsx)(n.code,{children:"play()"})," function). The counter is used as an index to lookup values from other ",(0,i.jsx)(n.code,{children:"list"})," provided as argument in functions for this instrument."]}),"\n",(0,i.jsxs)(n.p,{children:["Setting the first argument to ",(0,i.jsx)(n.code,{children:"free"})," allows the use of external triggering via OSC-messages. The trigger reacts when a value greater than ",(0,i.jsx)(n.code,{children:"0"})," is received. When another instrument in the code has a ",(0,i.jsx)(n.code,{children:"name()"}),", that name can be used as OSC-message trigger for another instrument to synchronize them."]}),"\n",(0,i.jsx)(n.p,{children:(0,i.jsx)(n.strong,{children:"arguments"})}),"\n",(0,i.jsxs)(n.ul,{children:["\n",(0,i.jsxs)(n.li,{children:[(0,i.jsx)(n.code,{children:"Number/Fraction"})," -> the timing fraction or ",(0,i.jsx)(n.code,{children:"free"})," (default=1/4)"]}),"\n",(0,i.jsxs)(n.li,{children:[(0,i.jsx)(n.code,{children:"Number/Fraction"})," -> timing offset or osc-message when ",(0,i.jsx)(n.code,{children:"free"})," (optional, default=0)"]}),"\n"]}),"\n",(0,i.jsx)(n.pre,{children:(0,i.jsx)(n.code,{className:"language-js",children:"set tempo 130\n\nnew sample kick_909 time(1/4)\nnew synth saw time(1/2 3/16)\n"})}),"\n",(0,i.jsx)(n.pre,{children:(0,i.jsx)(n.code,{className:"language-js",metastring:'title="external trigger"',children:"new sample snare_dnb time(free '/snareOSC/amplitude')\n"})}),"\n",(0,i.jsx)(n.pre,{children:(0,i.jsx)(n.code,{className:"language-js",metastring:'title="triggering from other instrument"',children:"new sample kick_909 time(3/16) name(kick)\nnew synth saw time(free '/kick')\n"})}),"\n",(0,i.jsx)(n.admonition,{type:"warning",children:(0,i.jsxs)(n.mdxAdmonitionTitle,{children:["You can not (yet) use ",(0,i.jsx)(n.code,{children:"list"}),"s to modulate the ",(0,i.jsx)(n.code,{children:"time()"})," parameters"]})}),"\n",(0,i.jsx)(n.h3,{id:"once",children:"once"}),"\n",(0,i.jsxs)(n.p,{children:["With once you can disable the looping mode of an instrument being triggered for every ",(0,i.jsx)(n.code,{children:"time()"})," interval. When the code is evaluated the instrument will only trigger ",(0,i.jsx)(n.code,{children:"1"})," time and stop after that. It will always trigger once every time the code is evaluated, so if you like the instrument to not play anymore after that you can either set ",(0,i.jsx)(n.code,{children:"gain(0)"})," or comment ",(0,i.jsx)(n.code,{children:"//"})," it."]}),"\n",(0,i.jsx)(n.p,{children:(0,i.jsx)(n.strong,{children:"arguments"})}),"\n",(0,i.jsxs)(n.ul,{children:["\n",(0,i.jsxs)(n.li,{children:[(0,i.jsx)(n.code,{children:"Bool"})," -> enable triggering the instrument once (default=off)"]}),"\n"]}),"\n",(0,i.jsx)(n.pre,{children:(0,i.jsx)(n.code,{className:"language-js",children:"new sample gong_lo time(2/1) once(on)\n// a sample for reference in time\nnew sample tabla_hi time(1/4)\n"})}),"\n",(0,i.jsx)(n.pre,{children:(0,i.jsx)(n.code,{className:"language-js",metastring:'title="trigger once on a bar multiple of 2 with offset of 7/8"',children:"new sample harp_down once(on) time(2/1 7/8)\n// a sample for reference in time\nnew sample hat_808 time(1/4)\n"})}),"\n",(0,i.jsx)(n.h3,{id:"play",children:"play"}),"\n",(0,i.jsxs)(n.p,{children:["Provide the play function with a ",(0,i.jsx)(n.code,{children:"list"})," containing 1's and 0's. For every time interval defined by the ",(0,i.jsx)(n.code,{children:"time()"})," function, the next value in the list is checked. A one results in a trigger of the instrument and an increment of the internal counter. A zero results in no trigger. An optional second argument resets the internal instrument index after a certain amount of time in ",(0,i.jsx)(n.code,{children:"fraction"}),"."]}),"\n",(0,i.jsx)(n.p,{children:(0,i.jsx)(n.strong,{children:"arguments"})}),"\n",(0,i.jsxs)(n.ul,{children:["\n",(0,i.jsxs)(n.li,{children:[(0,i.jsx)(n.code,{children:"Float+(List)"})," -> a rhythmic pattern of ones and zeroes to play (default=1)"]}),"\n",(0,i.jsxs)(n.li,{children:[(0,i.jsx)(n.code,{children:"Number/Fraction"})," -> reset internal time() counter after specified time (optional, default=off)"]}),"\n"]}),"\n",(0,i.jsx)(n.pre,{children:(0,i.jsx)(n.code,{className:"language-js",children:"list hatBeat [1 0 0 1 0 1 1 0 0]\n\nnew sample hat_909 time(1/16) play(hatBeat)\n"})}),"\n",(0,i.jsxs)(n.p,{children:["Alternatively you can use floating-point values in a list which result in a probability that the instrument will play. Here 0 means 0% chance, 1=100% and 0.5 is 50%. Inspired by Nick Collins paper on ",(0,i.jsx)(n.a,{href:"https://www.dmu.ac.uk/documents/technology-documents/research/mtirc/nowalls/mww-collins.pdf",children:"Algorithmic Composition Methods for Breakbeat Science"}),"."]}),"\n",(0,i.jsx)(n.pre,{children:(0,i.jsx)(n.code,{className:"language-js",metastring:'title="using probabilities"',children:"list hatBeat [1 0.5 0.2 0.8 0.5]\n\nnew sample hat_909 time(1/16) play(hatBeat 2)\nnew sample kick_909 time(1/4)\n"})}),"\n",(0,i.jsxs)(n.p,{children:["Alias: ",(0,i.jsx)(n.code,{children:"beat()"})]}),"\n",(0,i.jsx)(n.h3,{id:"shape",children:"shape"}),"\n",(0,i.jsxs)(n.p,{children:["Set the shape generator of a sound (in synthesis also called envelope). The shape is the trajectory of volume over time on the sound (eg. fade-in, fade-out). Various modes are possible depending on the amount of arguments. The attack time is the fade-in for the sound, the release is the fade-out for the sound, both in milliseconds or ",(0,i.jsx)(n.code,{children:"fraction"}),". The sustain time holds the sound at a static volume for a while. If the sound is triggered before the end of the envelope, the envelope is canceled, faded to 0 in 1ms and retriggered (in the case of monophonic instruments). You can specify the times in absolute values using integer/floating points (in ms) or in relative values using beat fractions."]}),"\n",(0,i.jsx)(n.p,{children:(0,i.jsx)(n.strong,{children:"arguments"})}),"\n",(0,i.jsxs)(n.ul,{children:["\n",(0,i.jsxs)(n.li,{children:[(0,i.jsx)(n.code,{children:"Number+(List)/Fraction(List)"})," -> Attack time in ms or fraction (optional, default=2)"]}),"\n",(0,i.jsxs)(n.li,{children:[(0,i.jsx)(n.code,{children:"Number+(List)/Fraction(List)"})," -> Decay time in ms or fraction (optional, default=0)"]}),"\n",(0,i.jsxs)(n.li,{children:[(0,i.jsx)(n.code,{children:"Number+(List)/Fraction(List)"})," -> Release time in ms or fraction"]}),"\n"]}),"\n",(0,i.jsx)(n.pre,{children:(0,i.jsx)(n.code,{className:"language-js",children:"new synth saw shape(1500)\n// default attack of 2 ms, sustain of 0 ms and a release of 1500 ms\n\nnew synth saw shape(1000 250)\n// attack of 1000 ms, default sustain of 0 ms and a release of 250 ms\n\nnew synth saw shape(10 500 50)\n// attack of 10 ms, sustain of 500 ms and a release of 50 ms\n"})}),"\n",(0,i.jsx)(n.pre,{children:(0,i.jsx)(n.code,{className:"language-js",metastring:'title="shape with fractions"',children:"set tempo 100\n\nnew synth saw shape(1/2)\n// default release of 1/2 (about 250 ms at 120 bpm)\n\nnew synth saw shape(1/4 1/32)\n\nnew synth saw shape(1/64 1/8 1/16)\n"})}),"\n",(0,i.jsx)(n.pre,{children:(0,i.jsx)(n.code,{className:"language-js",metastring:'title="modulate duration with a list"',children:"list durs [50 200 500]\nnew synth saw shape(durs)\n"})}),"\n",(0,i.jsxs)(n.p,{children:["Alias: ",(0,i.jsx)(n.code,{children:"length()"}),", ",(0,i.jsx)(n.code,{children:"envelope()"})]}),"\n",(0,i.jsx)(n.h3,{id:"gain",children:"gain"}),"\n",(0,i.jsxs)(n.p,{children:["Set the volume for the instrument in floating-point amplitude. Where ",(0,i.jsx)(n.code,{children:"1"})," is the default amplitude of the sample or synth, ",(0,i.jsx)(n.code,{children:"0.5"})," is the half louder (-6 dB) and ",(0,i.jsx)(n.code,{children:"2"})," is twice as loud (+ 6dB). An optional second argument sets the sliding time to go to the next gain value in milliseconds or ",(0,i.jsx)(n.code,{children:"fraction"}),"."]}),"\n",(0,i.jsx)(n.p,{children:(0,i.jsx)(n.strong,{children:"arguments"})}),"\n",(0,i.jsxs)(n.ul,{children:["\n",(0,i.jsxs)(n.li,{children:[(0,i.jsx)(n.code,{children:"Float+(List)"})," -> the (start) volume of the instrument (default=1)"]}),"\n",(0,i.jsxs)(n.li,{children:[(0,i.jsx)(n.code,{children:"Number+(List)"})," -> the sliding time in fraction or ms (optional, default=0)"]}),"\n",(0,i.jsxs)(n.li,{children:[(0,i.jsx)(n.code,{children:"Bool"})," -> mute the instrument but still use named sends (default=0) ",(0,i.jsx)(n.em,{children:"Mercury4Max only"})]}),"\n"]}),"\n",(0,i.jsx)(n.pre,{children:(0,i.jsx)(n.code,{className:"language-js",children:"new sample snare_909 gain(0.8)\n"})}),"\n",(0,i.jsx)(n.pre,{children:(0,i.jsx)(n.code,{className:"language-js",metastring:'title="modulate gain with a list"',children:"list gains [0 0.5 0.2 0.9]\nnew synth saw gain(gains 500) time(1/1)\n// ramps between gain values over 500ms every trigger 1/1\n"})}),"\n",(0,i.jsx)(n.admonition,{title:"Important for midi",type:"info",children:(0,i.jsxs)(n.p,{children:["When using the ",(0,i.jsx)(n.code,{children:"midi"})," instrument the gain will be multiplied by ",(0,i.jsx)(n.code,{children:"127"})," to create a velocity message. ",(0,i.jsx)(n.code,{children:"gain(0.5)"})," therefore maps to ",(0,i.jsx)(n.code,{children:"63"})," and ",(0,i.jsx)(n.code,{children:"gain(1)"})," to ",(0,i.jsx)(n.code,{children:"127"})]})}),"\n",(0,i.jsxs)(n.p,{children:["Alias: ",(0,i.jsx)(n.code,{children:"amp()"}),", ",(0,i.jsx)(n.code,{children:"volume()"}),", ",(0,i.jsx)(n.code,{children:"velocity()"})]}),"\n",(0,i.jsx)(n.h3,{id:"pan",children:"pan"}),"\n",(0,i.jsxs)(n.p,{children:["Set the panning position in floating-point for the sound in the stereo-image. ",(0,i.jsx)(n.code,{children:"-1"})," is 100% left channel, ",(0,i.jsx)(n.code,{children:"0"})," is center (both speakers), ",(0,i.jsx)(n.code,{children:"1"})," is 100% right channel. Higher or lower values wrap between ",(0,i.jsx)(n.code,{children:"-1"})," and ",(0,i.jsx)(n.code,{children:"1"}),". Provide pan with the ",(0,i.jsx)(n.code,{children:"random"})," argument to get a new random panning value every trigger of the instrument."]}),"\n",(0,i.jsx)(n.p,{children:(0,i.jsx)(n.strong,{children:"arguments"})}),"\n",(0,i.jsxs)(n.ul,{children:["\n",(0,i.jsxs)(n.li,{children:[(0,i.jsx)(n.code,{children:"Float"})," -> the panning position between -1 and 1 (default=0)"]}),"\n"]}),"\n",(0,i.jsx)(n.pre,{children:(0,i.jsx)(n.code,{className:"language-js",children:"new synth saw pan(-1)\nnew synth square pan(1)\n// two synths hard-panned left and right\n\nnew sample clap_909 pan(random) time(1/8)\n// random panning every trigger\n"})}),"\n",(0,i.jsx)(n.pre,{children:(0,i.jsx)(n.code,{className:"language-js",metastring:'title="modulate panning with a list',children:"list positions [-1 0 1 0 1 -1 -1]\nnew sample hat_808 time(1/16) pan(positions)\n"})}),"\n",(0,i.jsxs)(n.p,{children:["Alias: ",(0,i.jsx)(n.code,{children:"panning()"})]}),"\n",(0,i.jsx)(n.admonition,{title:"Multi-speaker output is not (yet) supported",type:"note"}),"\n",(0,i.jsx)(n.h3,{id:"effect",children:"effect"}),"\n",(0,i.jsxs)(n.p,{children:["Add an effect to the sound of the instrument to manipulate the sounds timbre in different ways. The first argument is always the ",(0,i.jsx)(n.code,{children:"effect-name"}),". The arguments that follow depend on the selected effect. ",(0,i.jsx)(n.code,{children:"fx()"})," can be used as an alias to reduce some typing. See ",(0,i.jsx)(n.a,{href:"/mercury/docs/reference/effects",children:"Effects"})," for more details and an up-to-date list of all the available effects for both ",(0,i.jsx)(n.em,{children:"Mercury4Max"})," and the ",(0,i.jsx)(n.em,{children:"MercuryPlayground"}),"."]}),"\n",(0,i.jsx)(n.p,{children:(0,i.jsx)(n.strong,{children:"arguments"})}),"\n",(0,i.jsxs)(n.ul,{children:["\n",(0,i.jsxs)(n.li,{children:[(0,i.jsx)(n.code,{children:"Name"})," -> the effect name"]}),"\n",(0,i.jsxs)(n.li,{children:[(0,i.jsx)(n.code,{children:"Value+/List+"})," -> values or lists depending on effectname arguments order (optional)"]}),"\n"]}),"\n",(0,i.jsx)(n.pre,{children:(0,i.jsx)(n.code,{className:"language-js",children:"new synth square effect(distort) effect(reverb)\n"})}),"\n",(0,i.jsxs)(n.p,{children:["Alias: ",(0,i.jsx)(n.code,{children:"fx()"}),", "]}),"\n",(0,i.jsx)(n.p,{children:(0,i.jsx)(n.strong,{children:"static vs. dynamic effect-chains"})}),"\n",(0,i.jsxs)(n.p,{children:["The Mercury4Max version has a static effects-chain. This means the order in the effects under the hood is fixed. The order is documented under ",(0,i.jsx)(n.a,{href:"/mercury/docs/reference/effects",children:"Effects"}),". Because of this there is:"]}),"\n",(0,i.jsxs)(n.ul,{children:["\n",(0,i.jsx)(n.li,{children:"No option to change the order of effects with the code"}),"\n",(0,i.jsx)(n.li,{children:"No option to use effects multiple times in one instrument"}),"\n"]}),"\n",(0,i.jsx)(n.pre,{children:(0,i.jsx)(n.code,{className:"language-js",metastring:'title="static fx-chain"',children:"new synth saw fx(reverb) fx(filter low 2000) fx(distort) fx(filter low 300)\n// filter and distortion are fixed before reverb in the chain, the order of \n// the code doesn't matter. There is only one filter in the chain, the first \n// filter is therefore overwritten by the other\n"})}),"\n",(0,i.jsx)(n.p,{children:"The MercuryPlayground version has a dynamic effects-chain. This means the order in the effects is determined by how you type the code. Because of this there is:"}),"\n",(0,i.jsxs)(n.ul,{children:["\n",(0,i.jsx)(n.li,{children:"Decide the order of effects by the order of the code you type"}),"\n",(0,i.jsx)(n.li,{children:"Use effects multiple times on one instrument"}),"\n"]}),"\n",(0,i.jsx)(n.pre,{children:(0,i.jsx)(n.code,{className:"language-js",metastring:'title="dynamic fx-chain"',children:"new synth saw fx(reverb) fx(filter low 2000) fx(distort) fx(filter low 300)\n// the reverb will be filtered, then distorted and then filtered again\n// the resulting sound is filtered twice\n"})}),"\n",(0,i.jsx)(n.admonition,{type:"info",children:(0,i.jsxs)(n.p,{children:["There are differences in sound between the ",(0,i.jsx)(n.em,{children:"Mercury4Max"})," and ",(0,i.jsx)(n.em,{children:"MercuryPlayground"})," versions. Parameters may need some tweaking when you port from one environment to the other."]})}),"\n",(0,i.jsx)(n.admonition,{type:"warning",children:(0,i.jsxs)(n.p,{children:["Not all effects from ",(0,i.jsx)(n.em,{children:"Mercury4Max"})," are available in the ",(0,i.jsx)(n.em,{children:"MercuryPlayground"})," because some are in the process of being ported, and some are sadly not as easy to implement with Web Audio."]})}),"\n",(0,i.jsx)(n.h3,{id:"ratchet",children:"ratchet"}),"\n",(0,i.jsx)(n.admonition,{title:"Mercury4Max only",type:"warning"}),"\n",(0,i.jsx)(n.p,{children:"Add a ratcheting effect (doubling/tripling/quadrupling of hits) with a probability. A technique that introduces some variety in rhythm that originated with electronic music from groups such as Tangerine Dream. The first argument sets the probability a note will be repeated. The second argument sets the amount of repetitions within the time, effectively doubling, tripling or more."}),"\n",(0,i.jsx)(n.p,{children:(0,i.jsx)(n.strong,{children:"arguments"})}),"\n",(0,i.jsxs)(n.ul,{children:["\n",(0,i.jsxs)(n.li,{children:[(0,i.jsx)(n.code,{children:"Float+"})," -> probability of ratchet happening (default=0.1)"]}),"\n",(0,i.jsxs)(n.li,{children:[(0,i.jsx)(n.code,{children:"Int+/IntList+"})," -> amount of repetitions (default=2)"]}),"\n"]}),"\n",(0,i.jsx)(n.pre,{children:(0,i.jsx)(n.code,{className:"language-js",children:"new sample hat_909 time(1/8) ratchet(0.3 2)\n"})}),"\n",(0,i.jsx)(n.pre,{children:(0,i.jsx)(n.code,{className:"language-js",metastring:'title="using a ratchet list"',children:"list rtc [2 3 2 4 8]\nnew sample hat_909 time(1/4) ratchet(1 rtc)\n"})}),"\n",(0,i.jsx)(n.h3,{id:"timediv",children:"timediv"}),"\n",(0,i.jsx)(n.admonition,{title:"Mercuryplayground only",type:"warning"}),"\n",(0,i.jsxs)(n.p,{children:["Add subdivisions to ",(0,i.jsx)(n.code,{children:"time()"}),". Documentation to do..."]}),"\n",(0,i.jsx)(n.pre,{children:(0,i.jsx)(n.code,{className:"language-js",children:"list div [1 2 3 4]\nnew sample hat_808 time(1/4) timediv(div)\n"})}),"\n",(0,i.jsx)(n.h3,{id:"warp",children:"warp"}),"\n",(0,i.jsx)(n.admonition,{title:"Mercury4Max only",type:"warning"}),"\n",(0,i.jsxs)(n.p,{children:["Warp ",(0,i.jsx)(n.code,{children:"time()"})," in a more complex way. Documentation to do..."]}),"\n",(0,i.jsx)(n.pre,{children:(0,i.jsx)(n.code,{className:"language-js",children:"list warp [1 2 3 4]\nnew sample hat_808 time(1/1) warp(warp)\n"})}),"\n",(0,i.jsx)(n.h3,{id:"wait",children:"wait"}),"\n",(0,i.jsx)(n.admonition,{title:"MercuryPlayground only",type:"warning"}),"\n",(0,i.jsxs)(n.p,{children:["This function is similar to the offset parameter in the ",(0,i.jsx)(n.code,{children:"time()"})," function except that it allows you to set an additional waiting time (or delay) for an instrument in milliseconds. This function is useful to align/synchronize instruments with external peripherals such as sending MIDI notes or OSC messages."]}),"\n",(0,i.jsx)(n.p,{children:(0,i.jsx)(n.strong,{children:"arguments"})}),"\n",(0,i.jsxs)(n.ul,{children:["\n",(0,i.jsxs)(n.li,{children:[(0,i.jsx)(n.code,{children:"Int+/Fraction"})," -> specify the waiting time in milliseconds or fraction (default=null)"]}),"\n"]}),"\n",(0,i.jsx)(n.pre,{children:(0,i.jsx)(n.code,{className:"language-js",children:"new sample kick_909 time(1/4)\n// the hihat plays 100ms later than the kick\nnew sample hat_909 time(1/4) wait(100)\n"})}),"\n",(0,i.jsx)(n.h2,{id:"synth",children:"synth"}),"\n",(0,i.jsxs)(n.p,{children:["The ",(0,i.jsx)(n.code,{children:"synth"})," and ",(0,i.jsx)(n.code,{children:"polySynth"})," instruments allow you to play synthesized sounds using a single cycle waveform. These waveforms are loaded in memory and can be accessed by their filename (without the extension). The default waveforms are ",(0,i.jsx)(n.code,{children:"sine"}),", ",(0,i.jsx)(n.code,{children:"triangle"}),", ",(0,i.jsx)(n.code,{children:"square"})," and ",(0,i.jsx)(n.code,{children:"saw"}),"."]}),"\n",(0,i.jsx)(n.pre,{children:(0,i.jsx)(n.code,{className:"language-js",children:"new synth \n"})}),"\n",(0,i.jsx)(n.admonition,{type:"note",children:(0,i.jsxs)(n.p,{children:["The waveforms in MercuryPlayground are currently not created with single-cycle soundfiles but via WebAudio's ",(0,i.jsx)(n.code,{children:"PeriodicWave"}),", constructing a waveform from a Fourier Series."]})}),"\n",(0,i.jsx)(n.h3,{id:"note",children:"note"}),"\n",(0,i.jsx)(n.p,{children:"Set the pitch for the instrument to play a note in a melody or chord. The note is specified as a 2-dimensional coordinate system, where the first argument is the semitone offset (positive or negative) and the second argument is the octave offset (positive or negative)."}),"\n",(0,i.jsxs)(n.p,{children:["The origin of the system, ",(0,i.jsx)(n.code,{children:"note(0 0)"}),", corresponds by default with midi-pitch ",(0,i.jsx)(n.code,{children:"36"})," or ",(0,i.jsx)(n.code,{children:"C2"}),". Depending on the ",(0,i.jsx)(n.code,{children:"set scale"})," the coordinate system will shift and result in a different pitch for the origin. A ",(0,i.jsx)(n.code,{children:"note()"})," should therefore not be taken as an absolute value, but rather a relative direction where the melody is going to in relation to the scale and root."]}),"\n",(0,i.jsxs)(n.p,{children:["Detuning/pitchbending can be done by providing a ",(0,i.jsx)(n.code,{children:"float"})," note number. The value behind the decimal point is the amount of detuning from one semitone to the next. For example ",(0,i.jsx)(n.code,{children:"7.5"})," results in ",(0,i.jsx)(n.code,{children:"7"})," semitones (and mapped to ",(0,i.jsx)(n.code,{children:"scale"})," if used) and then a ",(0,i.jsx)(n.code,{children:"0.5"})," semitone is added (= 50 cents). Detuning is applied after mapping the integer semitone to a scale."]}),"\n",(0,i.jsxs)(n.p,{children:["The mapping of the notes is as follows with ",(0,i.jsx)(n.code,{children:"set scale chromatic c"})," (default)"]}),"\n",(0,i.jsxs)(n.table,{children:[(0,i.jsx)(n.thead,{children:(0,i.jsxs)(n.tr,{children:[(0,i.jsx)(n.th,{children:(0,i.jsx)(n.code,{children:"note(x y)"})}),(0,i.jsx)(n.th,{children:"..."}),(0,i.jsx)(n.th,{children:"-1"}),(0,i.jsx)(n.th,{children:"0"}),(0,i.jsx)(n.th,{children:"1"}),(0,i.jsx)(n.th,{children:"2"}),(0,i.jsx)(n.th,{children:"3"}),(0,i.jsx)(n.th,{children:"4"}),(0,i.jsx)(n.th,{children:"..."}),(0,i.jsx)(n.th,{children:"9"}),(0,i.jsx)(n.th,{children:"10"}),(0,i.jsx)(n.th,{children:"11"}),(0,i.jsx)(n.th,{children:"12"}),(0,i.jsx)(n.th,{children:"13"}),(0,i.jsx)(n.th,{children:"..."})]})}),(0,i.jsxs)(n.tbody,{children:[(0,i.jsxs)(n.tr,{children:[(0,i.jsx)(n.td,{children:"3"}),(0,i.jsx)(n.td,{children:"..."}),(0,i.jsx)(n.td,{children:"B#"}),(0,i.jsxs)(n.td,{children:["C ",(0,i.jsx)(n.code,{children:"72"})]}),(0,i.jsx)(n.td,{children:"C#"}),(0,i.jsx)(n.td,{children:"D"}),(0,i.jsx)(n.td,{children:"D#"}),(0,i.jsx)(n.td,{children:"E"}),(0,i.jsx)(n.td,{children:"..."}),(0,i.jsx)(n.td,{children:"A"}),(0,i.jsx)(n.td,{children:"A#"}),(0,i.jsx)(n.td,{children:"B"}),(0,i.jsxs)(n.td,{children:["C ",(0,i.jsx)(n.code,{children:"84"})]}),(0,i.jsx)(n.td,{children:"C#"}),(0,i.jsx)(n.td,{children:"..."})]}),(0,i.jsxs)(n.tr,{children:[(0,i.jsx)(n.td,{children:"2"}),(0,i.jsx)(n.td,{children:"..."}),(0,i.jsx)(n.td,{children:"B#"}),(0,i.jsxs)(n.td,{children:["C ",(0,i.jsx)(n.code,{children:"60"})]}),(0,i.jsx)(n.td,{children:"C#"}),(0,i.jsx)(n.td,{children:"D"}),(0,i.jsx)(n.td,{children:"D#"}),(0,i.jsx)(n.td,{children:"E"}),(0,i.jsx)(n.td,{children:"..."}),(0,i.jsx)(n.td,{children:"A"}),(0,i.jsx)(n.td,{children:"A#"}),(0,i.jsx)(n.td,{children:"B"}),(0,i.jsxs)(n.td,{children:["C ",(0,i.jsx)(n.code,{children:"72"})]}),(0,i.jsx)(n.td,{children:"C#"}),(0,i.jsx)(n.td,{children:"..."})]}),(0,i.jsxs)(n.tr,{children:[(0,i.jsx)(n.td,{children:"1"}),(0,i.jsx)(n.td,{children:"..."}),(0,i.jsx)(n.td,{children:"B#"}),(0,i.jsxs)(n.td,{children:["C ",(0,i.jsx)(n.code,{children:"48"})]}),(0,i.jsx)(n.td,{children:"C#"}),(0,i.jsx)(n.td,{children:"D"}),(0,i.jsx)(n.td,{children:"D#"}),(0,i.jsx)(n.td,{children:"E"}),(0,i.jsx)(n.td,{children:"..."}),(0,i.jsx)(n.td,{children:"A"}),(0,i.jsx)(n.td,{children:"A#"}),(0,i.jsx)(n.td,{children:"B"}),(0,i.jsxs)(n.td,{children:["C ",(0,i.jsx)(n.code,{children:"60"})]}),(0,i.jsx)(n.td,{children:"C#"}),(0,i.jsx)(n.td,{children:"..."})]}),(0,i.jsxs)(n.tr,{children:[(0,i.jsx)(n.td,{children:"0"}),(0,i.jsx)(n.td,{children:"..."}),(0,i.jsx)(n.td,{children:"B#"}),(0,i.jsxs)(n.td,{children:["C ",(0,i.jsx)(n.code,{children:"36"})]}),(0,i.jsx)(n.td,{children:"C#"}),(0,i.jsx)(n.td,{children:"D"}),(0,i.jsx)(n.td,{children:"D#"}),(0,i.jsx)(n.td,{children:"E"}),(0,i.jsx)(n.td,{children:"..."}),(0,i.jsx)(n.td,{children:"A"}),(0,i.jsx)(n.td,{children:"A#"}),(0,i.jsx)(n.td,{children:"B"}),(0,i.jsxs)(n.td,{children:["C ",(0,i.jsx)(n.code,{children:"48"})]}),(0,i.jsx)(n.td,{children:"C#"}),(0,i.jsx)(n.td,{children:"..."})]}),(0,i.jsxs)(n.tr,{children:[(0,i.jsx)(n.td,{children:"-1"}),(0,i.jsx)(n.td,{children:"..."}),(0,i.jsx)(n.td,{children:"B#"}),(0,i.jsxs)(n.td,{children:["C ",(0,i.jsx)(n.code,{children:"24"})]}),(0,i.jsx)(n.td,{children:"C#"}),(0,i.jsx)(n.td,{children:"D"}),(0,i.jsx)(n.td,{children:"D#"}),(0,i.jsx)(n.td,{children:"E"}),(0,i.jsx)(n.td,{children:"..."}),(0,i.jsx)(n.td,{children:"A"}),(0,i.jsx)(n.td,{children:"A#"}),(0,i.jsx)(n.td,{children:"B"}),(0,i.jsxs)(n.td,{children:["C ",(0,i.jsx)(n.code,{children:"36"})]}),(0,i.jsx)(n.td,{children:"C#"}),(0,i.jsx)(n.td,{children:"..."})]})]})]}),"\n",(0,i.jsx)(n.p,{children:(0,i.jsx)(n.strong,{children:"arguments"})}),"\n",(0,i.jsxs)(n.ul,{children:["\n",(0,i.jsxs)(n.li,{children:[(0,i.jsx)(n.code,{children:"Number(List)"})," -> positive or negative semitone note value or list, x-coordinate (default=0)"]}),"\n",(0,i.jsxs)(n.li,{children:[(0,i.jsx)(n.code,{children:"Number(List)"})," -> positive or negative octave value or list, y-coordinate (default=0)"]}),"\n"]}),"\n",(0,i.jsx)(n.pre,{children:(0,i.jsx)(n.code,{className:"language-js",children:"set scale major d\nnew synth sine note(2 2)\n//=> results in midi-note 64 > F4\n"})}),"\n",(0,i.jsx)(n.pre,{children:(0,i.jsx)(n.code,{className:"language-js",metastring:'title="play a melody with lists"',children:"set scale minor A\n\nlist mel [0 5 7 3 2 -2 0]\nlist oct [0 1 2]\nnew synth sine note(mel oct) time(1/16)\n"})}),"\n",(0,i.jsx)(n.h3,{id:"slide",children:"slide"}),"\n",(0,i.jsxs)(n.p,{children:["A portamento/sliding/gliding effect. This will make the synthesizers' oscillator slowly slide from the current frequency to the new played one over a defined period of ",(0,i.jsx)(n.code,{children:"number"})," in milliseconds or ",(0,i.jsx)(n.code,{children:"fraction"}),". The sliding is logarithmically (meaning it will slide from midi-note to midi-note linearly, but after conversion to frequency slides logarithmically. This sounds slightly different from sliding linearly between frequencies)."]}),"\n",(0,i.jsx)(n.p,{children:(0,i.jsx)(n.strong,{children:"arguments"})}),"\n",(0,i.jsxs)(n.ul,{children:["\n",(0,i.jsxs)(n.li,{children:[(0,i.jsx)(n.code,{children:"Number+/Fraction(List)"})," -> sliding time in milliseconds or fraction (default=50)"]}),"\n"]}),"\n",(0,i.jsx)(n.pre,{children:(0,i.jsx)(n.code,{className:"language-js",children:"list notes [0 7 3]\nnew synth saw note(notes 1) time(1/2) slide(1/8)\n"})}),"\n",(0,i.jsxs)(n.p,{children:["Alias: ",(0,i.jsx)(n.code,{children:"glide()"}),", ",(0,i.jsx)(n.code,{children:"portamento()"})]}),"\n",(0,i.jsx)(n.h3,{id:"super",children:"super"}),"\n",(0,i.jsxs)(n.p,{children:["Add multiple oscillators in unison with a detuning factor to create a ",(0,i.jsx)(n.em,{children:"SuperSaw"})," effect. One oscillator will always be the base frequency of the ",(0,i.jsx)(n.code,{children:"note()"}),", the others are tuned above and below in incremental steps based on the detuning factor. The first argument sets the amount of oscillators (minum of 1, default=1), the second argument sets the detuning factor in semi-tones, the third optional argument sets the oscillator type for the odd numbered oscillators."]}),"\n",(0,i.jsx)(n.p,{children:(0,i.jsx)(n.strong,{children:"arguments"})}),"\n",(0,i.jsxs)(n.ul,{children:["\n",(0,i.jsxs)(n.li,{children:[(0,i.jsx)(n.code,{children:"Int+(List)"})," -> number of oscillators (default=1, maximum=64)"]}),"\n",(0,i.jsxs)(n.li,{children:[(0,i.jsx)(n.code,{children:"Float+(List)"})," -> detuning factor in semi-tone, 12=octave"]}),"\n",(0,i.jsxs)(n.li,{children:[(0,i.jsx)(n.code,{children:"Name"})," -> the name of the odd numbered oscillators (optional, default=main oscillator) ",(0,i.jsx)(n.em,{children:"Mercury4Max only"})]}),"\n"]}),"\n",(0,i.jsx)(n.pre,{children:(0,i.jsx)(n.code,{className:"language-js",children:"new synth saw super(5 0.031415)\n"})}),"\n",(0,i.jsx)(n.pre,{children:(0,i.jsx)(n.code,{className:"language-js",children:"new synth saw super(11 0.0618 square) \n"})}),"\n",(0,i.jsx)(n.pre,{children:(0,i.jsx)(n.code,{className:"language-js",metastring:'title="modulate detuning with a list"',children:"list voices [3 5 9 21]\nlist detune [0.1 0.5 0.9 12.01 0.3]\n\nnew synth saw time(1/4) shape(-1) super(voices detune)\n"})}),"\n",(0,i.jsxs)(n.p,{children:["Alias: ",(0,i.jsx)(n.code,{children:"unison()"})]}),"\n",(0,i.jsx)(n.h3,{id:"wave2",children:"wave2"}),"\n",(0,i.jsx)(n.admonition,{title:"REMOVED",type:"warning",children:(0,i.jsxs)(n.p,{children:["use ",(0,i.jsx)(n.a,{href:"#super",children:"super()"})," instead"]})}),"\n",(0,i.jsx)(n.h3,{id:"sub",children:"sub"}),"\n",(0,i.jsx)(n.admonition,{title:"Mercury4Max only",type:"warning"}),"\n",(0,i.jsxs)(n.p,{children:["Add a second sinewave oscillator to the synth. The oscillator is tuned one octave lower than the ",(0,i.jsx)(n.code,{children:"note()"})," played to create a sub frequency."]}),"\n",(0,i.jsx)(n.p,{children:(0,i.jsx)(n.strong,{children:"arguments"})}),"\n",(0,i.jsxs)(n.ul,{children:["\n",(0,i.jsxs)(n.li,{children:[(0,i.jsx)(n.code,{children:"Float+(List)"})," -> amplitude for the sub oscillator (default=off)"]}),"\n"]}),"\n",(0,i.jsx)(n.pre,{children:(0,i.jsx)(n.code,{className:"language-js",children:"new synth sine note(5 1) sub(0.8)\n"})}),"\n",(0,i.jsx)(n.h3,{id:"noise",children:"noise"}),"\n",(0,i.jsx)(n.admonition,{title:"Mercury4Max only",type:"warning"}),"\n",(0,i.jsxs)(n.p,{children:["Add a noise oscillator to the synth sound. The first argument is the ",(0,i.jsx)(n.em,{children:"amplitude"})," (gain), the second argument is the ",(0,i.jsx)(n.em,{children:'"color"'})," of the noise between 0 and 1 (1 = white noise, lower values give a more darker/downsampled noise sound). When the modulation mode is turned on (with 1) the noise is modulated by the source of the oscillator (or oscillators if ",(0,i.jsx)(n.code,{children:"super()"})," and ",(0,i.jsx)(n.code,{children:"sub()"})," are used)."]}),"\n",(0,i.jsx)(n.p,{children:(0,i.jsx)(n.strong,{children:"arguments"})}),"\n",(0,i.jsxs)(n.ul,{children:["\n",(0,i.jsxs)(n.li,{children:[(0,i.jsx)(n.code,{children:"Float+(List)"})," -> amplitude of the noise (default=0)"]}),"\n",(0,i.jsxs)(n.li,{children:[(0,i.jsx)(n.code,{children:"Float+(List)"})," -> color of the noise 0-1 (default=0.8)"]}),"\n",(0,i.jsxs)(n.li,{children:[(0,i.jsx)(n.code,{children:"Bool(List)"})," -> modulation mode (default=0)"]}),"\n"]}),"\n",(0,i.jsx)(n.pre,{children:(0,i.jsx)(n.code,{className:"language-js",children:"new synth saw note(0 1) noise(0.3 0.8 1)\n"})}),"\n",(0,i.jsx)(n.h2,{id:"sample",children:"sample"}),"\n",(0,i.jsx)(n.p,{children:'The sample instrument allows you to play sound-recordings and loops. These so called "samples" are loaded in memory and can be accessed by their filename (without the extension).'}),"\n",(0,i.jsx)(n.pre,{children:(0,i.jsx)(n.code,{className:"language-js",children:"new sample \n"})}),"\n",(0,i.jsxs)(n.ul,{children:["\n",(0,i.jsx)(n.li,{children:(0,i.jsx)(n.a,{href:"/mercury/docs/usage/mercury4max-overview#sounds",children:"Load sounds in Mercury4Max"})}),"\n",(0,i.jsx)(n.li,{children:(0,i.jsx)(n.a,{href:"/mercury/docs/usage/playground-overview#add-sounds",children:"Load sounds in MercuryPlayground"})}),"\n",(0,i.jsx)(n.li,{children:(0,i.jsx)(n.a,{href:"/mercury/docs/usage/sounds",children:"Full list of all the included sounds"})}),"\n"]}),"\n",(0,i.jsx)(n.h3,{id:"speed",children:"speed"}),"\n",(0,i.jsxs)(n.p,{children:["Set the playback speed for the sample, where 1 = original speed, 0.5 = half the speed and 2 = twice as fast. Adjusting the playback speed will change the pitch of the sample. A negative value will play the sample backwards starting at the end (or at the ",(0,i.jsx)(n.code,{children:"start()"})," position)"]}),"\n",(0,i.jsx)(n.p,{children:(0,i.jsx)(n.strong,{children:"arguments"})}),"\n",(0,i.jsxs)(n.ul,{children:["\n",(0,i.jsxs)(n.li,{children:[(0,i.jsx)(n.code,{children:"Float(List)"})," -> playback speed (default=1)"]}),"\n"]}),"\n",(0,i.jsx)(n.pre,{children:(0,i.jsx)(n.code,{className:"language-js",children:"new sample choir time(5) speed(0.5)\nnew sample choir time(5) speed(-0.3)\n\nset all fx(reverb 2 17)\n"})}),"\n",(0,i.jsxs)(n.p,{children:["Alias: ",(0,i.jsx)(n.code,{children:"rate()"})]}),"\n",(0,i.jsx)(n.admonition,{title:"Reversed speed is not supported (yet) in the MercuryPlayground",type:"warning"}),"\n",(0,i.jsx)(n.h3,{id:"start",children:"start"}),"\n",(0,i.jsxs)(n.p,{children:["Set the start position (the offset position of the playback) of the sample. 0 = start at the beginning, 0.5 = start midway in the sample. With long decaying samples the offset is very useful if playing the sounds backwards when using for example ",(0,i.jsx)(n.code,{children:"speed(-1)"}),"."]}),"\n",(0,i.jsx)(n.p,{children:(0,i.jsx)(n.strong,{children:"arguments"})}),"\n",(0,i.jsxs)(n.ul,{children:["\n",(0,i.jsxs)(n.li,{children:[(0,i.jsx)(n.code,{children:"Float+(List)"})," -> the playback position between 0 and 1 (default=0)"]}),"\n"]}),"\n",(0,i.jsx)(n.pre,{children:(0,i.jsx)(n.code,{className:"language-js",children:"list positions randomFloat(8 0 0.5)\n\nnew sample choir time(1/16) start(positions)\n"})}),"\n",(0,i.jsxs)(n.p,{children:["Alias: ",(0,i.jsx)(n.code,{children:"offset()"})]}),"\n",(0,i.jsx)(n.h3,{id:"note-1",children:"note"}),"\n",(0,i.jsxs)(n.p,{children:["The ",(0,i.jsx)(n.code,{children:"note"})," function allows you to tune the sample to a specific pitch. This is easier than trying to set the playback speed with the ",(0,i.jsx)(n.code,{children:"speed()"})," function if you need to pitch the sample for melodic content. The function works the same as the ",(0,i.jsx)(n.code,{children:"note"})," function explained under the ",(0,i.jsx)(n.code,{children:"synth"}),". Please see ",(0,i.jsx)(n.a,{href:"#note",children:(0,i.jsx)(n.code,{children:"note()"})})," for further information."]}),"\n",(0,i.jsx)(n.pre,{children:(0,i.jsx)(n.code,{className:"language-js",children:"list notes [0 7 5 3]\nnew sample xylo_c4 time(1/8) note(notes 1)\n"})}),"\n",(0,i.jsx)(n.h3,{id:"tune",children:"tune"}),"\n",(0,i.jsxs)(n.p,{children:["Set the base note midi value for the sample to determine how the ",(0,i.jsx)(n.code,{children:"note()"})," function changes the playback speed in relation to this note. For example if your sample was recorded as an ",(0,i.jsx)(n.code,{children:"a4"})," then you will set tune to ",(0,i.jsx)(n.code,{children:"69"})," (midi value of ",(0,i.jsx)(n.code,{children:"a4"}),"). ",(0,i.jsx)(n.code,{children:"note(0 2)"})," is the same as the ",(0,i.jsx)(n.code,{children:"tune()"})," value in the case of a scale set to have ",(0,i.jsx)(n.code,{children:"c"})," as the root."]}),"\n",(0,i.jsx)(n.p,{children:(0,i.jsx)(n.strong,{children:"arguments"})}),"\n",(0,i.jsxs)(n.ul,{children:["\n",(0,i.jsxs)(n.li,{children:[(0,i.jsx)(n.code,{children:"Number+"})," -> midi pitch as base for tuning (optional, default=60)"]}),"\n"]}),"\n",(0,i.jsx)(n.pre,{children:(0,i.jsx)(n.code,{className:"language-js",children:"set scale minor c\n\nlist notes [0 7 5 3]\n// tune the kalimba to a3\nnew sample kalimba_a time(1/4) note(notes 2) tune(57)\n"})}),"\n",(0,i.jsx)(n.h3,{id:"stretch",children:"stretch"}),"\n",(0,i.jsxs)(n.p,{children:["Stretch the entire sample to the length of a full bar. Useful for when working with beats that have to be looped. Stretching is the default when working with the ",(0,i.jsx)(n.code,{children:"loop"})," instrument. This is the same as a ",(0,i.jsx)(n.code,{children:"new sample stretch(1)"}),". Optionally you can turn timestretching on with a second argument to preserve the original pitch of the sample. A third optional argument changes the mode of the stretching, choose from: basic, monophonic, rhythmic, general, extremestretch, efficient. The default is set to ",(0,i.jsx)(n.code,{children:"efficient"}),"."]}),"\n",(0,i.jsx)(n.p,{children:(0,i.jsx)(n.strong,{children:"arguments"})}),"\n",(0,i.jsxs)(n.ul,{children:["\n",(0,i.jsxs)(n.li,{children:[(0,i.jsx)(n.code,{children:"Bool"})," -> turn stretch to full bar on/off (default=0 for sample default=1 for loop)"]}),"\n",(0,i.jsxs)(n.li,{children:[(0,i.jsx)(n.code,{children:"Bool"})," -> turn timestretching on when stretching to full bar, preservering the original pitch (default = 0)"]}),"\n",(0,i.jsxs)(n.li,{children:[(0,i.jsx)(n.code,{children:"Name"})," -> adjust the stretching mode (default=efficient)"]}),"\n"]}),"\n",(0,i.jsx)(n.pre,{children:(0,i.jsx)(n.code,{className:"language-js",children:"new sample chimes stretch(1 1 general) speed(-1)\n"})}),"\n",(0,i.jsxs)(n.admonition,{type:"tip",children:[(0,i.jsxs)(n.p,{children:["If your ",(0,i.jsx)(n.code,{children:"loop"})," is longer than ",(0,i.jsx)(n.code,{children:"1"})," bar use ",(0,i.jsx)(n.code,{children:"speed()"})," to decrease the playback speed by ",(0,i.jsx)(n.code,{children:"1 / n-bars"}),". Set ",(0,i.jsx)(n.code,{children:"time()"})," to the bar amounts."]}),(0,i.jsx)(n.pre,{children:(0,i.jsx)(n.code,{className:"language-js",children:"new loop loopOfFourBars time(4/1) speed(0.25)\n"})})]}),"\n",(0,i.jsx)(n.admonition,{title:"Timestretching is only supported in Mercury4Max",type:"warning"}),"\n",(0,i.jsx)(n.p,{children:(0,i.jsx)(n.strong,{children:"Stretching modes explained"})}),"\n",(0,i.jsxs)(n.ul,{children:["\n",(0,i.jsxs)(n.li,{children:[(0,i.jsx)(n.code,{children:"basic"})," : best option for real-time performance"]}),"\n",(0,i.jsxs)(n.li,{children:[(0,i.jsx)(n.code,{children:"monophonic"})," : best option for any monophonic source without ambience"]}),"\n",(0,i.jsxs)(n.li,{children:[(0,i.jsx)(n.code,{children:"rhythmic"})," : best option for drums and percussion when transient preservation is critical"]}),"\n",(0,i.jsxs)(n.li,{children:[(0,i.jsx)(n.code,{children:"general"})," : balances spectral integrity with transient preservaton"]}),"\n",(0,i.jsxs)(n.li,{children:[(0,i.jsx)(n.code,{children:"extremestretch"})," : optimized for stretching (slowing down) material, limited to a stretch factor between 0.5 and 4"]}),"\n",(0,i.jsxs)(n.li,{children:[(0,i.jsx)(n.code,{children:"effcient"})," : best option when CPU efficiency is critical"]}),"\n"]}),"\n",(0,i.jsx)(n.h2,{id:"loop",children:"loop"}),"\n",(0,i.jsxs)(n.p,{children:["The ",(0,i.jsx)(n.code,{children:"loop"})," instrument is basically the ",(0,i.jsx)(n.code,{children:"sample"})," instrument but with ",(0,i.jsx)(n.code,{children:"stretch(1)"})," enabled by default, making all the loaded samples stretch to 1 full bar. For all available ",(0,i.jsx)(n.code,{children:"instrument-functions"})," of ",(0,i.jsx)(n.code,{children:"loop"})," see ",(0,i.jsx)(n.a,{href:"#sample",children:(0,i.jsx)(n.code,{children:"sample"})})," above."]}),"\n",(0,i.jsx)(n.pre,{children:(0,i.jsx)(n.code,{className:"language-js",children:"new loop \n"})}),"\n",(0,i.jsx)(n.h2,{id:"polysynth",children:"polySynth"}),"\n",(0,i.jsxs)(n.p,{children:["The polySynth functions the same as the ",(0,i.jsx)(n.code,{children:"synth"})," instrument in the sense that you choose a waveform, apply a ",(0,i.jsx)(n.code,{children:"note()"}),", add a ",(0,i.jsx)(n.code,{children:"shape()"}),", etc. For explanation of those functions see ",(0,i.jsx)(n.a,{href:"#synth",children:(0,i.jsx)(n.code,{children:"synth"})}),"."]}),"\n",(0,i.jsxs)(n.p,{children:["The extra feature of the polySynth is that it allows for overlapping notes to generate chords. Notes provided to the ",(0,i.jsx)(n.code,{children:"note()"})," function as a 2-dimensional list will be played on the same time as a chord. By default there are 8 voices available at the same time. Voice stealing is ",(0,i.jsx)(n.code,{children:"on"}),' by default meaning that if a new note is played while all voices are busy the "oldest" triggered note will be removed.']}),"\n",(0,i.jsx)(n.pre,{children:(0,i.jsx)(n.code,{className:"language-js",children:"new polySynth note([ [chord1] [chord2] ... [chord-n] ])\n"})}),"\n",(0,i.jsx)(n.p,{children:"You can think of a 2D list like so:"}),"\n",(0,i.jsx)(n.pre,{children:(0,i.jsx)(n.code,{className:"language-js",children:"list chords [ [ 0 3 7 ] [ 2 5 9 ] [ 3 6 10 13 ] ]\n\nlist chords [ 0 2 3 ]\n 3 5 6 \n 7 9 10\n 13 \n"})}),"\n",(0,i.jsxs)(n.p,{children:["So the list ",(0,i.jsx)(n.code,{children:"chords"})," has ",(0,i.jsx)(n.code,{children:"3"}),' "items", and those ',(0,i.jsx)(n.code,{children:"3"})," items again contain a ",(0,i.jsx)(n.code,{children:"list"})]}),"\n",(0,i.jsx)(n.pre,{children:(0,i.jsx)(n.code,{className:"language-js",children:"list chords [ [ 0 3 7 ] [ 2 5 9 ] [ 3 6 10 13 ] ]\n\nnew polySynth sine note(chord 2) time(1/2) shape(1 1/4) \n"})}),"\n",(0,i.jsx)(n.h3,{id:"steal",children:"steal"}),"\n",(0,i.jsxs)(n.p,{children:["With steal you can choose the behaviour of what happens when new notes are triggered while all voices are in use. When steal is ",(0,i.jsx)(n.code,{children:"on"})," (the default) every new note will be triggered and old notes will be overwritten by the new ones. If steal is ",(0,i.jsx)(n.code,{children:"off"})," new notes are not triggered while all voices are busy. You'll have to wait till some voice is done playing, based on the ",(0,i.jsx)(n.code,{children:"shape()"})," before a note can be triggered again."]}),"\n",(0,i.jsx)(n.p,{children:(0,i.jsx)(n.strong,{children:"arguments"})}),"\n",(0,i.jsxs)(n.ul,{children:["\n",(0,i.jsxs)(n.li,{children:[(0,i.jsx)(n.code,{children:"Bool/Name"})," -> turn voice stealing ",(0,i.jsx)(n.code,{children:"on"})," or ",(0,i.jsx)(n.code,{children:"off"})," (optional, default=on)"]}),"\n"]}),"\n",(0,i.jsx)(n.pre,{children:(0,i.jsx)(n.code,{className:"language-js",children:"list notes spread(16 0 36)\n\nnew polySynth sine note(notes 2) time(1/16) shape(1 1/1) steal(off)\n"})}),"\n",(0,i.jsx)(n.admonition,{type:"warning",children:(0,i.jsxs)(n.p,{children:["If you use ",(0,i.jsx)(n.code,{children:"steal(off)"})," but also set ",(0,i.jsx)(n.code,{children:"shape(off)"})," you won't be able to trigger any new notes after all voices are filled because there is no shape to stop any voice from sounding."]})}),"\n",(0,i.jsx)(n.h3,{id:"spread",children:"spread"}),"\n",(0,i.jsx)(n.admonition,{title:"Mercury4Max only",type:"warning"}),"\n",(0,i.jsx)(n.p,{children:"Use the spread function to add little delays with optional randomness between every note in a chord, resulting in the chord to sound broken up in time (spread out)."}),"\n",(0,i.jsx)(n.p,{children:(0,i.jsx)(n.strong,{children:"arguments"})}),"\n",(0,i.jsxs)(n.ul,{children:["\n",(0,i.jsxs)(n.li,{children:[(0,i.jsx)(n.code,{children:"Number+/Fraction(List)"})," -> the delaytime between note triggers in ms or fraction (default=0)"]}),"\n",(0,i.jsxs)(n.li,{children:[(0,i.jsx)(n.code,{children:"Number+/Fraction(List)"})," -> random delaytime offset added to the delaytime in ms or fraction (default=0)"]}),"\n"]}),"\n",(0,i.jsx)(n.pre,{children:(0,i.jsx)(n.code,{className:"language-js",children:"list notes [ [0 3 7 11 12] ]\n\nnew polySynth sine note(notes 2) shape(1 1/1) time(1/1) spread(150 50)\n"})}),"\n",(0,i.jsx)(n.h3,{id:"voices",children:"voices"}),"\n",(0,i.jsx)(n.admonition,{title:"not (yet) supported",type:"warning"}),"\n",(0,i.jsx)(n.h2,{id:"polysample",children:"polySample"}),"\n",(0,i.jsx)(n.admonition,{title:"Mercury Playground only",type:"warning"}),"\n",(0,i.jsxs)(n.p,{children:["The polySample functions the same as the ",(0,i.jsx)(n.code,{children:"sample"})," in the sense that you choose a sample file, set a ",(0,i.jsx)(n.code,{children:"speed()"}),", add a ",(0,i.jsx)(n.code,{children:"shape()"}),", etc. For explanation of those functions see ",(0,i.jsx)(n.a,{href:"#sample",children:(0,i.jsx)(n.code,{children:"sample"})}),"."]}),"\n",(0,i.jsxs)(n.p,{children:["The extra feature of the polySample is that it allows for overlapping sounds. For example useful when generating chords. Notes provided to the ",(0,i.jsx)(n.code,{children:"note()"})," function as a 2-dimensional list will be played at the same time as a chord. By default there are 8 voices available at the same time."]}),"\n",(0,i.jsxs)(n.p,{children:["For explanation of using ",(0,i.jsx)(n.code,{children:"2D-list"}),"'s in ",(0,i.jsx)(n.code,{children:"note()"})," for polyphony see ",(0,i.jsx)(n.a,{href:"#polysynth",children:(0,i.jsx)(n.code,{children:"polySynth"})})," voice-stealing see ",(0,i.jsx)(n.a,{href:"#steal",children:(0,i.jsx)(n.code,{children:"steal"})})," under ",(0,i.jsx)(n.code,{children:"polySynth"}),". For setting voice-amount see ",(0,i.jsx)(n.a,{href:"#voices",children:(0,i.jsx)(n.code,{children:"voices"})}),"."]}),"\n",(0,i.jsx)(n.pre,{children:(0,i.jsx)(n.code,{className:"language-js",children:"set tempo 100\nset scale dorian eb\n\nlist notes shuffle(spread(24))\nnew polySample piano_e time(1/16) note(notes 1) shape(1 1/2) steal(off) tune(64)\n"})}),"\n",(0,i.jsx)(n.h2,{id:"midi",children:"midi"}),"\n",(0,i.jsxs)(n.p,{children:["The ",(0,i.jsx)(n.code,{children:"midi"})," instrument allows you to send MIDI messages (notes, pitchbend, controlchange, programchange) to other external devices or virtual devices in your computer. The ",(0,i.jsx)(n.code,{children:""})," is the literal name as a ",(0,i.jsx)(n.code,{children:"string"})," of the device as it shows up when connected to the computer. For example this can be something like ",(0,i.jsx)(n.code,{children:'"My MIDI Device"'}),". You can also choose ",(0,i.jsx)(n.code,{children:"default"})," to set the instrument to the first midi device in the list. The name is written as a ",(0,i.jsx)(n.code,{children:"string"})," between ",(0,i.jsx)(n.code,{children:'" "'})," and is sensitive to upper and lower cases. To setup a basic midi instrument use:"]}),"\n",(0,i.jsx)(n.pre,{children:(0,i.jsx)(n.code,{className:"language-js",children:"new midi \n"})}),"\n",(0,i.jsx)(n.p,{children:(0,i.jsx)(n.strong,{children:"arguments"})}),"\n",(0,i.jsxs)(n.ul,{children:["\n",(0,i.jsxs)(n.li,{children:[(0,i.jsx)(n.code,{children:"Name"})," -> ",(0,i.jsx)(n.code,{children:"default"})," or MIDI Device name as a ",(0,i.jsx)(n.code,{children:"string"})]}),"\n"]}),"\n",(0,i.jsxs)(n.p,{children:["Functions ",(0,i.jsx)(n.code,{children:"note()"}),", ",(0,i.jsx)(n.code,{children:"time()"}),", ",(0,i.jsx)(n.code,{children:"name()"}),", ",(0,i.jsx)(n.code,{children:"group()"}),", ",(0,i.jsx)(n.code,{children:"once()"}),", ",(0,i.jsx)(n.code,{children:"play()"}),", ",(0,i.jsx)(n.code,{children:"ratchet()"}),", ",(0,i.jsx)(n.code,{children:"timediv()"}),", ",(0,i.jsx)(n.code,{children:"warp()"}),", ",(0,i.jsx)(n.code,{children:"wait()"})," all work the same for the ",(0,i.jsx)(n.code,{children:"midi"})," instrument. There are some differences when using the ",(0,i.jsx)(n.code,{children:"shape()"})," and ",(0,i.jsx)(n.code,{children:"gain()"})," functions."]}),"\n",(0,i.jsx)(n.h3,{id:"note-2",children:"note"}),"\n",(0,i.jsxs)(n.p,{children:["The ",(0,i.jsx)(n.code,{children:"note"})," function allows you to play a midinote. The function works the same as the ",(0,i.jsx)(n.code,{children:"note"})," function explained under the ",(0,i.jsx)(n.code,{children:"synth"}),". Please see ",(0,i.jsx)(n.a,{href:"#note",children:(0,i.jsx)(n.code,{children:"note()"})})," for further information."]}),"\n",(0,i.jsx)(n.pre,{children:(0,i.jsx)(n.code,{className:"language-js",children:"set scale major D\n\nlist notes [0 7 5 3]\n\nnew midi default note(notes 2)\n// plays the midi notes 62 69 67 64\n"})}),"\n",(0,i.jsx)(n.h3,{id:"length",children:"length"}),"\n",(0,i.jsxs)(n.p,{children:["Replaces the ",(0,i.jsx)(n.code,{children:"shape()"})," function of ",(0,i.jsx)(n.code,{children:"synth"})," and ",(0,i.jsx)(n.code,{children:"sample"}),". Set the duration of the midi-note. This means it will send a ",(0,i.jsx)(n.code,{children:"note-off"})," message after a ",(0,i.jsx)(n.code,{children:"number"})," of milliseconds or ",(0,i.jsx)(n.code,{children:"fraction"}),". If the instrument is triggered before the end of the duration, the note-off is canceled and a new note-off is scheduled."]}),"\n",(0,i.jsx)(n.p,{children:(0,i.jsx)(n.strong,{children:"arguments"})}),"\n",(0,i.jsxs)(n.ul,{children:["\n",(0,i.jsxs)(n.li,{children:[(0,i.jsx)(n.code,{children:"Number/Fraction(List)"})," -> Duration time in ms or fraction"]}),"\n"]}),"\n",(0,i.jsx)(n.pre,{children:(0,i.jsx)(n.code,{className:"language-js",children:"new midi default length(1500) time(1)\n"})}),"\n",(0,i.jsx)(n.p,{children:"with fraction:"}),"\n",(0,i.jsx)(n.pre,{children:(0,i.jsx)(n.code,{className:"language-js",children:"new midi default length(1/2) time(1)\n//=> duration of 1/2 (1200 ms at 100 bpm)\n"})}),"\n",(0,i.jsxs)(n.p,{children:["Alias: ",(0,i.jsx)(n.code,{children:"duration()"}),", ",(0,i.jsx)(n.code,{children:"shape()"})]}),"\n",(0,i.jsx)(n.h3,{id:"channel",children:"channel"}),"\n",(0,i.jsxs)(n.p,{children:["Set the midi-channel output for the midi-note to be send to. ",(0,i.jsx)(n.code,{children:"out()"})," can be used as an alias to reduce some typing."]}),"\n",(0,i.jsx)(n.p,{children:(0,i.jsx)(n.strong,{children:"arguments"})}),"\n",(0,i.jsxs)(n.ul,{children:["\n",(0,i.jsxs)(n.li,{children:[(0,i.jsx)(n.code,{children:"Number+(List)"})," -> Channel to send the midi-note to"]}),"\n"]}),"\n",(0,i.jsx)(n.pre,{children:(0,i.jsx)(n.code,{className:"language-js",children:"new midi default note(7 2) channel(1)\nnew midi default note(0 0) channel(2)\n"})}),"\n",(0,i.jsxs)(n.p,{children:["Alias: ",(0,i.jsx)(n.code,{children:"out()"})]}),"\n",(0,i.jsx)(n.h3,{id:"chord",children:"chord"}),"\n",(0,i.jsxs)(n.p,{children:["By default the ",(0,i.jsx)(n.code,{children:"midi"})," instrument's output is monophonic. You can turn the chord output (polyphony) on for a midi instrument with this function. This allows you to use ",(0,i.jsx)(n.code,{children:"2D-list"}),"s where the 2nd dimension is used to generate chords. Read more about chords under ",(0,i.jsx)(n.a,{href:"#polysynth",children:(0,i.jsx)(n.code,{children:"polySynth"})}),"."]}),"\n",(0,i.jsx)(n.p,{children:(0,i.jsx)(n.strong,{children:"arguments"})}),"\n",(0,i.jsxs)(n.ul,{children:["\n",(0,i.jsxs)(n.li,{children:[(0,i.jsx)(n.code,{children:"Bool"})," -> Turn chord output on/off"]}),"\n"]}),"\n",(0,i.jsx)(n.pre,{children:(0,i.jsx)(n.code,{className:"language-js",children:"list chords [[0 4 7] [2 5 9] [5 9 0]]\n\nnew midi default note(chords 1) chord(on)\n"})}),"\n",(0,i.jsx)(n.h3,{id:"program",children:"program"}),"\n",(0,i.jsxs)(n.p,{children:["Send program change messages to the specified midi-channel of the instrument. The channel number is based on the ",(0,i.jsx)(n.code,{children:"out()"})," function (see ",(0,i.jsx)(n.a,{href:"#channel",children:(0,i.jsx)(n.code,{children:"channel"})}),"). The default channel ",(0,i.jsx)(n.code,{children:"1"})," is used if no channel is selected. The program change value is zero-based, an integer from ",(0,i.jsx)(n.code,{children:"0"})," - ",(0,i.jsx)(n.code,{children:"127"})," and can be sequenced as a list. If no value is provided there is no program change send. The value is ",(0,i.jsx)(n.strong,{children:"only"})," send when it changes based on the previous value. This is done because some midi devices react every time a program change is received (for example cutting of notes), even if the value stays the same."]}),"\n",(0,i.jsx)(n.p,{children:(0,i.jsx)(n.strong,{children:"arguments"})}),"\n",(0,i.jsxs)(n.ul,{children:["\n",(0,i.jsxs)(n.li,{children:[(0,i.jsx)(n.code,{children:"Int+(List)"})," -> Program change value 0-127 (default=off)"]}),"\n"]}),"\n",(0,i.jsx)(n.pre,{children:(0,i.jsx)(n.code,{className:"language-js",children:"list notes spread(5 0 12)\nlist changes [0 10 20]\n\nnew midi default note(notes 1) out(1) program(changes)\n"})}),"\n",(0,i.jsxs)(n.p,{children:["Alias: ",(0,i.jsx)(n.code,{children:"pgm()"})]}),"\n",(0,i.jsx)(n.h3,{id:"change",children:"change"}),"\n",(0,i.jsxs)(n.p,{children:["Send control change (CC) messages to the midi device. This function replaces the ",(0,i.jsx)(n.code,{children:"effect()"})," function of an instrument and can have multiple calls in the same instrument, every call can be a different control number. The first argument is the ",(0,i.jsx)(n.code,{children:"number"})," for the control, the second argument is the ",(0,i.jsx)(n.code,{children:"number"})," for the controller value or a list of controller values. You can use ",(0,i.jsx)(n.code,{children:"cc()"})," as an alias to reduce typing."]}),"\n",(0,i.jsx)(n.p,{children:(0,i.jsx)(n.strong,{children:"arguments"})}),"\n",(0,i.jsxs)(n.ul,{children:["\n",(0,i.jsxs)(n.li,{children:[(0,i.jsx)(n.code,{children:"Int+"})," -> controller number between 0-127"]}),"\n",(0,i.jsxs)(n.li,{children:[(0,i.jsx)(n.code,{children:"Int+(List)"})," -> controller value between 0-127"]}),"\n"]}),"\n",(0,i.jsx)(n.pre,{children:(0,i.jsx)(n.code,{className:"language-js",children:"list ccValues [10 20 30 40 50]\n\nnew midi default time(1/8) change(13 100) change(21 ccValues)\n"})}),"\n",(0,i.jsxs)(n.p,{children:["Alias: ",(0,i.jsx)(n.code,{children:"cc()"})]}),"\n",(0,i.jsx)(n.h3,{id:"sync",children:"sync"}),"\n",(0,i.jsx)(n.admonition,{title:"Mercury4Max only",type:"warning"}),"\n",(0,i.jsx)(n.p,{children:"Turn the midiclock syncing on/off for an individual instrument and send it to the selected port/device from that instrument."}),"\n",(0,i.jsx)(n.p,{children:(0,i.jsx)(n.strong,{children:"arguments"})}),"\n",(0,i.jsxs)(n.ul,{children:["\n",(0,i.jsxs)(n.li,{children:[(0,i.jsx)(n.code,{children:"Bool"})," -> Turn syncing on/off"]}),"\n"]}),"\n",(0,i.jsx)(n.pre,{children:(0,i.jsx)(n.code,{className:"language-js",children:'new midi "My Midi Device" sync(on)\nnew midi "Another Device" sync(off)\n'})}),"\n",(0,i.jsxs)(n.p,{children:["Alias: ",(0,i.jsx)(n.code,{children:"clock()"})]}),"\n",(0,i.jsx)(n.h2,{id:"input",children:"input"}),"\n",(0,i.jsxs)(n.p,{children:["Use the input from the soundcard (ADC, Analog Digital Converter) as the source for an instrument. The sound can be modified by all the various ",(0,i.jsx)(n.code,{children:"fx()"}),"'s. The volume can be adjusted with ",(0,i.jsx)(n.code,{children:"gain()"}),". An envelope can be applied on the sound with ",(0,i.jsx)(n.code,{children:"shape()"})," and this envelope can be triggered with ",(0,i.jsx)(n.code,{children:"time()"})," just as with the regular instruments ",(0,i.jsx)(n.code,{children:"sample"}),", ",(0,i.jsx)(n.code,{children:"synth"}),", etc. Use the words ",(0,i.jsx)(n.code,{children:"in1"}),", ",(0,i.jsx)(n.code,{children:"in2"}),", ..., ",(0,i.jsx)(n.code,{children:"inx"})," to choose the input source. Use ",(0,i.jsx)(n.code,{children:"default"})," to pick the first input in the list."]}),"\n",(0,i.jsx)(n.pre,{children:(0,i.jsx)(n.code,{className:"language-js",children:"new input \n"})}),"\n",(0,i.jsx)(n.p,{children:(0,i.jsx)(n.strong,{children:"arguments"})}),"\n",(0,i.jsxs)(n.ul,{children:["\n",(0,i.jsxs)(n.li,{children:[(0,i.jsx)(n.code,{children:"Name"})," -> ",(0,i.jsx)(n.code,{children:"default"})," or the input channel number as a string ",(0,i.jsx)(n.code,{children:"inX"})]}),"\n"]}),"\n",(0,i.jsx)(n.pre,{children:(0,i.jsx)(n.code,{className:"language-js",children:"// use the default input, in most cases channel 1\nnew input default gain(1)\n\n// use a specific channel\nnew input in3 gain(0.9) \n\n// add functions like shape, time and fx\nnew input in4 gain(0.9) time(1/16) shape(1 100) fx(reverb) fx(distort)\n"})}),"\n",(0,i.jsx)(n.admonition,{type:"info",children:(0,i.jsx)(n.p,{children:"In the browser you will need to give permission to use the microphone. Afterwards you might need to refresh the page."})}),"\n",(0,i.jsx)(n.h2,{id:"osc",children:"osc"}),"\n",(0,i.jsxs)(n.p,{children:["Create an instrument that sends OSC-messages. The ",(0,i.jsx)(n.code,{children:""})," is used to set the opening address of the message to ",(0,i.jsx)(n.code,{children:"/"}),". Any arbitrary function name is used to set as second address in the osc-string. If no name is provided it will default to a unique number for every instrument instance. By adding other functions with any arbitrary name you can send a message with the address in the form of ",(0,i.jsx)(n.code,{children:"// "})]}),"\n",(0,i.jsx)(n.pre,{children:(0,i.jsx)(n.code,{className:"language-js",children:"new osc \n"})}),"\n",(0,i.jsx)(n.pre,{children:(0,i.jsx)(n.code,{className:"language-js",children:'list params [0.25 0.5 0.75]\nlist values [3 1]\n\nnew osc "myOSC" time(1/4) someParam(params) anotherParam(values)\n\n// sends => /myOSC/someParams 0.25\n// /myOSC/anotherParam 3\n// /myOSC/someParams 0.5\n// /myOSC/anotherParam 1\n// etc...\n'})}),"\n",(0,i.jsxs)(n.p,{children:["The messages also support multiple arguments up to a length of 256. Multiple arguments can be provided as ",(0,i.jsx)(n.code,{children:"list"}),"s, ",(0,i.jsx)(n.code,{children:"string"}),"s, ",(0,i.jsx)(n.code,{children:"float"}),"s or ",(0,i.jsx)(n.code,{children:"int"}),"s."]}),"\n",(0,i.jsx)(n.pre,{children:(0,i.jsx)(n.code,{className:"language-js",children:"list val1 [0.25 0.5 0.75]\nlist val2 [3 1]\n\nnew osc myOSC time(1/4) aMessage(0.1 val1 val2 100)\n\n// emits => /myOSC/aMessage 0.1 0.25 3 100\n// /myOSC/aMessage 0.1 0.5 1 100\n// /myOSC/aMessage 0.1 0.75 3 100\n// etc...\n"})}),"\n",(0,i.jsxs)(n.admonition,{type:"tip",children:[(0,i.jsxs)(n.p,{children:["If you want multiple ",(0,i.jsx)(n.code,{children:"osc"})," to send to the same address, you can use the same ",(0,i.jsx)(n.code,{children:""})," but use different ",(0,i.jsx)(n.code,{children:"name()"}),"s for reference in the code. Useful if you want to send messages to the same address, but with different timing-intervals."]}),(0,i.jsx)(n.pre,{children:(0,i.jsx)(n.code,{className:"language-js",children:"list params [0.25 0.5 0.75]\nlist values [3 1 4]\n\nnew osc myOSC name(osc1) time(1/4) \n set osc1 someParam(params)\n\nnew osc myOSC name(osc2) time(1/2)\n set osc2 anotherParam(values)\n"})})]}),"\n",(0,i.jsx)(n.h3,{id:"receiving",children:"receiving"}),"\n",(0,i.jsxs)(n.p,{children:["You can use osc adresses as arguments for other functions by putting the address as argument in the form: ",(0,i.jsx)(n.code,{children:"/
//"}),". For example to control the ",(0,i.jsx)(n.code,{children:"gain()"})," of a ",(0,i.jsx)(n.code,{children:"sample"})," and the ",(0,i.jsx)(n.code,{children:"note()"})," value of a ",(0,i.jsx)(n.code,{children:"synth"})," enter the following:"]}),"\n",(0,i.jsx)(n.pre,{children:(0,i.jsx)(n.code,{className:"language-js",children:"new sample kick_909 time(1/4) gain(/myOSC/sliderValue1)\nnew synth saw note(/myOSC/sliderValue2) shape(1 100) time(1/8)\n"})}),"\n",(0,i.jsxs)(n.p,{children:["It is possible to scale the incoming osc value to a different range by using ",(0,i.jsx)(n.code,{children:"{}"})," after the address inputting a low and high output range separated by a colon ",(0,i.jsx)(n.code,{children:":"}),". The scaling function considers an incoming range of ",(0,i.jsx)(n.code,{children:"0 - 1"})," floatingpoint values. For example to control the ",(0,i.jsx)(n.code,{children:"note()"})," and ",(0,i.jsx)(n.code,{children:"shape()"})," ranges in a ",(0,i.jsx)(n.code,{children:"synth"})," enter the following:"]}),"\n",(0,i.jsx)(n.pre,{children:(0,i.jsx)(n.code,{className:"language-js",children:"new synth saw note(/myOsc/sliderValue3{2:19} 0) shape(1 /myOsc/sliderValue4{50:500}) \n// => converts incoming slider values from 0-1 to 2-19 for note and 0-1 to 50-500 for note length\n"})}),"\n",(0,i.jsx)(n.h2,{id:"modulator",children:"modulator"}),"\n",(0,i.jsx)(n.admonition,{title:"Mercury4Max only",type:"warning"}),"\n",(0,i.jsxs)(n.p,{children:["The modulator allows you to send a modulation signal as an argument to parameters in ",(0,i.jsx)(n.code,{children:"instrument-function"}),"s of other instruments. These parameters are continuously modulated at a specific rate with a specific waveform. The modulation rate is independent from the instruments ",(0,i.jsx)(n.code,{children:"time()"})," (in comparison when using a list as an argument). It is also possible to send the modulation signal directly out to the connected soundcard on a specific DAC channel (Digital Analog Converter). This can for example be used for CV-modulations."]}),"\n",(0,i.jsxs)(n.admonition,{type:"info",children:[(0,i.jsx)(n.mdxAdmonitionTitle,{}),(0,i.jsx)(n.p,{children:"Mercury has a limit of 8 active Modulators. This may be relevant when using an external editor (Pulsar) with multiple instruments. If you exceed 8 Modulators, a warning will go to the Max Console and the last Modulator won't be evaluated. If you encounter this limit, you can comment out Modulator lines and uncomment them when you need them."})]}),"\n",(0,i.jsx)(n.p,{children:(0,i.jsx)(n.strong,{children:"arguments"})}),"\n",(0,i.jsxs)(n.ul,{children:["\n",(0,i.jsxs)(n.li,{children:[(0,i.jsx)(n.code,{children:"Name"})," -> modulator waveform type: ",(0,i.jsx)(n.code,{children:"sine"}),"/",(0,i.jsx)(n.code,{children:"sin"}),", ",(0,i.jsx)(n.code,{children:"sawUp"}),"/",(0,i.jsx)(n.code,{children:"phasor"}),", ",(0,i.jsx)(n.code,{children:"sawDown"}),"/",(0,i.jsx)(n.code,{children:"saw"}),", ",(0,i.jsx)(n.code,{children:"square"}),"/",(0,i.jsx)(n.code,{children:"rect"}),", ",(0,i.jsx)(n.code,{children:"triangle"}),"/",(0,i.jsx)(n.code,{children:"tri"}),", ",(0,i.jsx)(n.code,{children:"random"}),"/",(0,i.jsx)(n.code,{children:"rand"}),", ",(0,i.jsx)(n.code,{children:"randomLine"}),"/",(0,i.jsx)(n.code,{children:"randL"}),", ",(0,i.jsx)(n.code,{children:"trigger"}),"/",(0,i.jsx)(n.code,{children:"gate"})]}),"\n"]}),"\n",(0,i.jsx)(n.pre,{children:(0,i.jsx)(n.code,{className:"language-js",children:"new modulator name() range( ) time() out()\n"})}),"\n",(0,i.jsx)(n.h3,{id:"name-1",children:"name"}),"\n",(0,i.jsxs)(n.p,{children:["Replaces the ",(0,i.jsx)(n.code,{children:"name()"})," function. Set the name for the modulator, this name can be used as argument in the functions of an instrument like ",(0,i.jsx)(n.code,{children:"synth"})," and ",(0,i.jsx)(n.code,{children:"sample"})]}),"\n",(0,i.jsx)(n.p,{children:(0,i.jsx)(n.strong,{children:"arguments"})}),"\n",(0,i.jsxs)(n.ul,{children:["\n",(0,i.jsxs)(n.li,{children:[(0,i.jsx)(n.code,{children:"Name"})," -> the modulator ",(0,i.jsx)(n.code,{children:"name"})," for reference in other functions"]}),"\n"]}),"\n",(0,i.jsx)(n.pre,{children:(0,i.jsx)(n.code,{className:"language-js",children:"// set the name to myModulator\nnew modulator sine name(myModulator)\n\n// the synth uses the modulator in the gain function\nnew synth saw gain(myModulator)\n"})}),"\n",(0,i.jsx)(n.h3,{id:"time-1",children:"time"}),"\n",(0,i.jsxs)(n.p,{children:["Replaces the ",(0,i.jsx)(n.code,{children:"time()"})," function. Set the modulation speed as a ",(0,i.jsx)(n.code,{children:"fraction"})," or ",(0,i.jsx)(n.code,{children:"float+"}),". The default is ",(0,i.jsx)(n.code,{children:"1/1"})," (one period per bar)."]}),"\n",(0,i.jsx)(n.p,{children:(0,i.jsx)(n.strong,{children:"arguments"})}),"\n",(0,i.jsxs)(n.ul,{children:["\n",(0,i.jsxs)(n.li,{children:[(0,i.jsx)(n.code,{children:"Fraction/Float+"})," -> The time interval for one period of the modulation waveform (optional, default=1/1)"]}),"\n",(0,i.jsxs)(n.li,{children:[(0,i.jsx)(n.code,{children:"Fraction/Float+"})," -> The time offset for the modulation (optional, default=0)"]}),"\n"]}),"\n",(0,i.jsx)(n.pre,{children:(0,i.jsx)(n.code,{className:"language-js",children:"// modulate a sinewave at a period of one per 4 bars\nnew modulator sine time(4/1)\n"})}),"\n",(0,i.jsx)(n.h3,{id:"range",children:"range"}),"\n",(0,i.jsxs)(n.p,{children:["Set the modulation range between a lower and upper value with an optional exponential value. The default range is ",(0,i.jsx)(n.code,{children:"0"})," to ",(0,i.jsx)(n.code,{children:"1"}),"."]}),"\n",(0,i.jsx)(n.p,{children:(0,i.jsx)(n.strong,{children:"arguments"})}),"\n",(0,i.jsxs)(n.ul,{children:["\n",(0,i.jsxs)(n.li,{children:[(0,i.jsx)(n.code,{children:"Number"})," -> The low output range (optional, default=0)"]}),"\n",(0,i.jsxs)(n.li,{children:[(0,i.jsx)(n.code,{children:"Number"})," -> The high output range (optional, default=1)"]}),"\n",(0,i.jsxs)(n.li,{children:[(0,i.jsx)(n.code,{children:"Number"})," -> The scaling exponent (optional, default=1)"]}),"\n"]}),"\n",(0,i.jsx)(n.pre,{children:(0,i.jsx)(n.code,{className:"language-js",children:"// set the range from 200 to 5000, for example to modulate a filter cutoff in Hz\nnew modulator sine range(200 5000)\n\n// include the third argument to set the exponential in the scaling\nnew modulator sine range(200 5000 3)\n"})}),"\n",(0,i.jsx)(n.h3,{id:"out",children:"out"}),"\n",(0,i.jsxs)(n.p,{children:["Set the output channel from your connected soundcard to send the modulation signal directly to. The default is 0 (no output to DAC). Currently the maximum number of channels that can be used is 16. If the modulation signal is only used for direct output it is not necessary to also ",(0,i.jsx)(n.code,{children:"name()"})," the modulator."]}),"\n",(0,i.jsx)(n.p,{children:(0,i.jsx)(n.strong,{children:"arguments"})}),"\n",(0,i.jsxs)(n.ul,{children:["\n",(0,i.jsxs)(n.li,{children:[(0,i.jsx)(n.code,{children:"Number+"})," -> The channel number from 1 till number of outputs available, maximum of 16 (default=0)"]}),"\n"]}),"\n",(0,i.jsx)(n.pre,{children:(0,i.jsx)(n.code,{className:"language-js",children:"// send a sinewave modulator signal to DAC channel 3\nnew modulator sine range(-1 1) out(3)\n"})}),"\n",(0,i.jsx)(n.admonition,{type:"warning",children:(0,i.jsx)(n.p,{children:"Be careful when sending DC signals with large ranges to your DAC, this could damage your speakers if you choose the wrong output!"})}),"\n",(0,i.jsx)(n.h3,{id:"trigger",children:"trigger"}),"\n",(0,i.jsxs)(n.p,{children:["When using the mode ",(0,i.jsx)(n.code,{children:"trigger"}),"/",(0,i.jsx)(n.code,{children:"gate"})," the modulator functions like the sequencer in the other instruments. Meaning that you can include the ",(0,i.jsx)(n.code,{children:"play()"})," function to add a rhythm list, use ",(0,i.jsx)(n.code,{children:"ratchet()"})," to add a list of timing subdivisions with probability and use ",(0,i.jsx)(n.code,{children:"warp()"})," to add a list of time warpings."]}),"\n",(0,i.jsx)(n.p,{children:(0,i.jsx)(n.strong,{children:"arguments"})}),"\n",(0,i.jsxs)(n.ul,{children:["\n",(0,i.jsxs)(n.li,{children:[(0,i.jsx)(n.code,{children:"Name"})," -> ",(0,i.jsx)(n.code,{children:"trigger"}),"/",(0,i.jsx)(n.code,{children:"gate"})," sets the intrument to use the stepsequencer (default=off)"]}),"\n"]}),"\n",(0,i.jsx)(n.pre,{children:(0,i.jsx)(n.code,{className:"language-js",children:"// generate a euclidean rhythm and use it in the trigger\nlist rtm euclid(16 11)\nnew modulator trigger time(1/8) play(rtm) ratchet(0.1 2)\n"})}),"\n",(0,i.jsx)(n.h3,{id:"hold",children:"hold"}),"\n",(0,i.jsxs)(n.p,{children:["The hold function transforms the ",(0,i.jsx)(n.code,{children:"trigger"})," into a gate that goes open and closes after a certain amount of time. The time value can be either ",(0,i.jsx)(n.code,{children:"ms"})," or a ",(0,i.jsx)(n.code,{children:"fraction"}),". If the hold time is longer than the time interval between triggers the gate stays open. A hold of ",(0,i.jsx)(n.code,{children:"0"})," results in the click from the default trigger."]}),"\n",(0,i.jsx)(n.p,{children:(0,i.jsx)(n.strong,{children:"arguments"})}),"\n",(0,i.jsxs)(n.ul,{children:["\n",(0,i.jsxs)(n.li,{children:[(0,i.jsx)(n.code,{children:"Number+"})," -> hold time in ms or fraction (default=0)"]}),"\n"]}),"\n",(0,i.jsx)(n.pre,{children:(0,i.jsx)(n.code,{className:"language-js",children:"// trigger every 8th note, and leave the gate open for the length of 50ms\nnew modulator trigger time(1/8) hold(50)\n\n// trigger every 8th note, and leave the gate open for the length of a 16th\nnew modulator trigger time(1/8) hold(1/16)\n"})}),"\n",(0,i.jsx)(n.h2,{id:"emitter",children:"emitter"}),"\n",(0,i.jsx)(n.admonition,{title:"Deprecated in Mercury4Max",type:"warning",children:(0,i.jsxs)(n.p,{children:["Use ",(0,i.jsx)(n.a,{href:"#osc",children:(0,i.jsx)(n.code,{children:"osc"})})," instead (similar as in MercuryPlayground now)"]})}),"\n",(0,i.jsxs)(n.p,{children:["Create an emitter object. Use this object to send messages to other platforms. The emitter object works similarly to the Instruments in the sense that it also has the ",(0,i.jsx)(n.code,{children:"time"}),", ",(0,i.jsx)(n.code,{children:"beat"})," and ",(0,i.jsx)(n.code,{children:"name"})," functions by default. The ",(0,i.jsx)(n.code,{children:"time"})," determines the time-interval at which messages are send. The ",(0,i.jsx)(n.code,{children:"beat"})," can turn send moments on or off."]})]})}function h(e={}){const{wrapper:n}={...(0,t.R)(),...e.components};return n?(0,i.jsx)(n,{...e,children:(0,i.jsx)(c,{...e})}):c(e)}},8453:(e,n,s)=>{s.d(n,{R:()=>l,x:()=>d});var i=s(6540);const t={},r=i.createContext(t);function l(e){const n=i.useContext(r);return i.useMemo((function(){return"function"==typeof e?e(n):{...n,...e}}),[n,e])}function d(e){let n;return n=e.disableParentContext?"function"==typeof e.components?e.components(t):e.components||t:l(e.components),i.createElement(r.Provider,{value:n},e.children)}}}]); \ No newline at end of file diff --git a/assets/js/e59418e5.9e96f3d8.js b/assets/js/e59418e5.9e96f3d8.js deleted file mode 100644 index 0061017c..00000000 --- a/assets/js/e59418e5.9e96f3d8.js +++ /dev/null @@ -1 +0,0 @@ -"use strict";(self.webpackChunkmercury_docs=self.webpackChunkmercury_docs||[]).push([[28],{2472:(e,i,n)=>{n.r(i),n.d(i,{assets:()=>h,contentTitle:()=>a,default:()=>d,frontMatter:()=>t,metadata:()=>o,toc:()=>l});var s=n(4848),r=n(8453);const t={},a="\ud83d\udc7e Made with Mercury",o={id:"about/inspiration",title:"\ud83d\udc7e Made with Mercury",description:"Below is some inspiration of awesome things made by the Mercury community.",source:"@site/docs/about/inspiration.md",sourceDirName:"about",slug:"/about/inspiration",permalink:"/mercury/docs/about/inspiration",draft:!1,unlisted:!1,tags:[],version:"current",frontMatter:{},sidebar:"tutorialSidebar",previous:{title:"\ud83c\udfae Quick Features Overview",permalink:"/mercury/docs/about/features"},next:{title:"\ud83d\ude80 Getting Started",permalink:"/mercury/docs/getting-started"}},h={},l=[{value:"\ud83d\udd0d Further reading",id:"-further-reading",level:2},{value:"\u2728 Inspiration & Bibliography",id:"-inspiration--bibliography",level:2}];function c(e){const i={a:"a",code:"code",em:"em",h1:"h1",h2:"h2",li:"li",p:"p",ul:"ul",...(0,r.R)(),...e.components};return(0,s.jsxs)(s.Fragment,{children:[(0,s.jsx)(i.h1,{id:"-made-with-mercury",children:"\ud83d\udc7e Made with Mercury"}),"\n",(0,s.jsx)(i.p,{children:"Below is some inspiration of awesome things made by the Mercury community."}),"\n",(0,s.jsxs)(i.p,{children:["Made something with Mercury? I'm very happy to add it to the list! So please edit this file by adding a URL here and send a pull request! \ud83d\ude0e Read ",(0,s.jsx)(i.a,{href:"./../contribute",children:"Contribute"})," to find out more about editting files on github."]}),"\n",(0,s.jsxs)(i.ul,{children:["\n",(0,s.jsx)(i.li,{children:(0,s.jsx)(i.a,{href:"https://youtu.be/Ykhjx7ZkaEQ?si=_POsFQqALz3jeijJ&t=336",children:"Damage Such - Live at Algorave Barcelona"})}),"\n",(0,s.jsx)(i.li,{children:(0,s.jsx)(i.a,{href:"https://www.youtube.com/live/iY9Vc8LpMFQ?si=vsDIlYW3YXhF29iq&t=3494",children:"Sabrina Verhage & Flor de Fuego - Live at LIVECODERA8M"})}),"\n",(0,s.jsx)(i.li,{children:(0,s.jsx)(i.a,{href:"https://youtu.be/aB1mdxLCR7c?si=6Vk0MzKmK0bDoX_K&t=856",children:"iTypeMusic - Live Coding Techno Vibes"})}),"\n",(0,s.jsx)(i.li,{children:(0,s.jsx)(i.a,{href:"https://www.youtube.com/watch?v=TzM-koWkRow&ab_channel=Eulerroom",children:"LXT @levoxtrip (at Solstice Stream December 2023)"})}),"\n",(0,s.jsx)(i.li,{children:(0,s.jsx)(i.a,{href:"https://youtu.be/WSPNDC0a2X4",children:"Linalab(Mercury) + Turbulente(p5Live) - Live at Algorave Lisbon"})}),"\n",(0,s.jsx)(i.li,{children:(0,s.jsx)(i.a,{href:"https://youtu.be/nnhLPL-kKMs?si=iZ0rePJXhC54SHhx&t=988",children:"Timo - Live at Algorave D\xfcsseldorf"})}),"\n",(0,s.jsx)(i.li,{children:(0,s.jsx)(i.a,{href:"https://youtu.be/syUL76qCV6w",children:"Timo - Liber Abaci (Mercury Coding Sessions)"})}),"\n",(0,s.jsx)(i.li,{children:(0,s.jsx)(i.a,{href:"https://youtu.be/KJ4OpJ3-Ik0",children:"Roald van Dillewijn - Smashing Temparateness (Mercury Coding Sessions)"})}),"\n",(0,s.jsx)(i.li,{children:(0,s.jsx)(i.a,{href:"https://youtu.be/BbOz1XBu8f8",children:'Rafa & Timo - "Hello, off-world!" (Mercury Coding Sessions)'})}),"\n",(0,s.jsx)(i.li,{children:(0,s.jsx)(i.a,{href:"https://youtu.be/wRVQHlghitM",children:"Guillem G\xf3ngora Moral - Transcription #1 (Mercury Coding Sessions)"})}),"\n",(0,s.jsx)(i.li,{children:(0,s.jsx)(i.a,{href:"https://youtu.be/e4sPKOlaYS8",children:"Anne Veinberg - CodeKlavier meets Mercury (Mercury Coding Sessions)"})}),"\n",(0,s.jsx)(i.li,{children:(0,s.jsx)(i.a,{href:"https://youtu.be/UsfKF0ggn7k",children:"Nick Levantis - Wake Up"})}),"\n",(0,s.jsx)(i.li,{children:(0,s.jsx)(i.a,{href:"https://www.youtube.com/watch?v=7UWywv_DPHI&t=4s",children:'Rafa & Timo - "Hello, off-world!" (Live at NMF)'})}),"\n",(0,s.jsx)(i.li,{children:(0,s.jsx)(i.a,{href:"https://www.youtube.com/watch?v=1v7xicXuSbo&t=346s",children:"Roald van Dillewijn - Mercury & DigiLog"})}),"\n",(0,s.jsx)(i.li,{children:(0,s.jsx)(i.a,{href:"https://www.youtube.com/watch?v=zzmgX4QSBMM",children:"Sasj & Timo - Amalgam (Live at Github Sattelite 2020)"})}),"\n",(0,s.jsx)(i.li,{children:(0,s.jsx)(i.a,{href:"https://www.youtube.com/watch?v=VSoibHwQJ98&t=175s",children:"Anne Veinberg - CodeKlaver & Mercury Extension Tryout"})}),"\n",(0,s.jsx)(i.li,{children:(0,s.jsx)(i.a,{href:"https://www.youtube.com/watch?v=EW9x68sxhvM",children:"Timo - Live at NerdLab VR 2020"})}),"\n",(0,s.jsx)(i.li,{children:(0,s.jsx)(i.a,{href:"https://www.youtube.com/watch?v=X0FFcdd1QEE",children:"Timo - Live at Eulerroom Equinox 2020"})}),"\n",(0,s.jsx)(i.li,{children:(0,s.jsxs)(i.a,{href:"https://www.facebook.com/timohoogland/videos/3654187371320680/",children:["Timo - Live at Algo",":Ritmi"," 2020"]})}),"\n",(0,s.jsx)(i.li,{children:(0,s.jsx)(i.a,{href:"https://www.youtube.com/watch?v=leckC_yUMss",children:"Timo - Live at NLCL Meetup STEIM"})}),"\n"]}),"\n",(0,s.jsx)(i.h2,{id:"-further-reading",children:"\ud83d\udd0d Further reading"}),"\n",(0,s.jsx)(i.p,{children:"On my website you can find projects I'm working on that involve Mercury and live coding"}),"\n",(0,s.jsxs)(i.ul,{children:["\n",(0,s.jsx)(i.li,{children:(0,s.jsx)(i.a,{href:"http://www.timohoogland.com/mercury-livecoding",children:"Mercury homepage"})}),"\n"]}),"\n",(0,s.jsx)(i.p,{children:"I published a paper at the International Conference on Live Coding in Madrid in 2019. The paper is a bit outdated now tho, but you can still read it!"}),"\n",(0,s.jsxs)(i.ul,{children:["\n",(0,s.jsx)(i.li,{children:(0,s.jsx)(i.a,{href:"http://iclc.livecodenetwork.org/2019/papers/paper67.pdf",children:"Paper in ICLC 2019"})}),"\n"]}),"\n",(0,s.jsx)(i.h2,{id:"-inspiration--bibliography",children:"\u2728 Inspiration & Bibliography"}),"\n",(0,s.jsxs)(i.p,{children:["This project is inspired by the composition techniques named ",(0,s.jsx)(i.code,{children:"Serialism"})," and ",(0,s.jsx)(i.code,{children:"Total Serialism"}),". The technique approaches the parameters that make up a piece of music as individual series of values. These parameters are (but not limited to) ",(0,s.jsx)(i.em,{children:"pitch, duration/rhythm and velocity/dynamics"}),"."]}),"\n",(0,s.jsxs)(i.p,{children:["Serialism originated from the ",(0,s.jsx)(i.code,{children:"twelve-tone"}),' technique, described in 1919 by Josef Hauer in his published work "Law of the twelve tones". This technique starts out with a randomly ordered set of the twelve chromatic notes. From there on out you can apply transformations on this set, such as reverse/retrograde, inverse, transpose, and combinations between those.']}),"\n",(0,s.jsxs)(i.ul,{children:["\n",(0,s.jsxs)(i.li,{children:["\n",(0,s.jsx)(i.p,{children:(0,s.jsx)(i.a,{href:"https://en.wikipedia.org/wiki/Serialism",children:"Serialism on Wikipedia"})}),"\n"]}),"\n",(0,s.jsxs)(i.li,{children:["\n",(0,s.jsx)(i.p,{children:(0,s.jsx)(i.a,{href:"https://en.wikipedia.org/wiki/Twelve-tone_technique",children:"Twelve-Tone on Wikipedia"})}),"\n"]}),"\n",(0,s.jsxs)(i.li,{children:["\n",(0,s.jsx)(i.p,{children:(0,s.jsx)(i.a,{href:"http://academic.udayton.edu/PhillipMagnuson/soundpatterns/microcosms/serialism.html",children:"Phillip Magnuson - Sound Patterns Ch.45 - Serialism"})}),"\n"]}),"\n"]}),"\n",(0,s.jsxs)(i.p,{children:['For many of the functions programmed much inspiration was gained from Laurie Spiegels paper on "Manipulation of Musical Patterns" (1981) in which she suggests to ',(0,s.jsx)(i.em,{children:'"extract a basic "library" consisting of the most elemental transformations which have consistently been successfully used on musical patterns, a basic group of "tried-and-true" musical manipulations."'})," Specifically the stretch and expand methods were inspired by Laurie Spiegels writings in this paper. Stretch is a method that is ",(0,s.jsx)(i.em,{children:'"inserting a smooth ramp between discretely separated values"'})," and expand is an interpretation of ",(0,s.jsx)(i.em,{children:'"Extension beyond that which already exists in such a way as to preserve continuity with it, to project from it"'})]}),"\n",(0,s.jsxs)(i.ul,{children:["\n",(0,s.jsx)(i.li,{children:(0,s.jsx)(i.a,{href:"https://github.com/calpicasso/Manipulations-of-musical-patterns/blob/master/Manipulations%20of%20Musical%20Patterns.md",children:"Laurie Spiegel - Manipulations of Musical Patterns"})}),"\n"]}),"\n",(0,s.jsx)(i.p,{children:"The euclidean rhythm generator was inspired by the famous paper by Godfried Toussaint."}),"\n",(0,s.jsxs)(i.ul,{children:["\n",(0,s.jsx)(i.li,{children:(0,s.jsx)(i.a,{href:"http://cgm.cs.mcgill.ca/~godfried/publications/banff.pdf",children:"Godfried Toussaint - The Euclidean Algorithm Generates Traditional Musical Rhythms"})}),"\n"]}),"\n",(0,s.jsx)(i.p,{children:"The clave rhythm generator was inspired by another paper by Godfried Toussaint."}),"\n",(0,s.jsxs)(i.ul,{children:["\n",(0,s.jsx)(i.li,{children:(0,s.jsx)(i.a,{href:"http://cgm.cs.mcgill.ca/~godfried/publications/bridges.pdf",children:"Godfried Toussaint - A mathematical analysis of African, Brazilian, and Cuban clave rhythms"})}),"\n",(0,s.jsx)(i.li,{children:(0,s.jsx)(i.a,{href:"http://cgm.cs.mcgill.ca/~godfried/rhythm-and-mathematics.html",children:"Comparative Musicology - Musical Rhythm and Mathematics"})}),"\n"]}),"\n",(0,s.jsx)(i.p,{children:"Inspiration for the sequencing also came from the Live Coding scene and current programming languages available such as Tidal, Extempore, SonicPi and more. In Live Coding the Serialism technique is very common when programming music. In many cases the rhythms, melodies, and other musical expressions are expressed in arrays that are iterated based on the timing of the system."}),"\n",(0,s.jsxs)(i.ul,{children:["\n",(0,s.jsx)(i.li,{children:(0,s.jsx)(i.a,{href:"https://s3.amazonaws.com/academia.edu.documents/11010319/39.pdf?response-content-disposition=inline%3B%20filename%3DTidal_Pattern_Language_for_Live_Coding_o.pdf&X-Amz-Algorithm=AWS4-HMAC-SHA256&X-Amz-Credential=AKIAIWOWYYGZ2Y53UL3A%2F20200115%2Fus-east-1%2Fs3%2Faws4_request&X-Amz-Date=20200115T225654Z&X-Amz-Expires=3600&X-Amz-SignedHeaders=host&X-Amz-Signature=a1d10c16a032d819fa4b9c8f9bb6f79eacf3a81fb13704d60cd08ef4cd0e1f51",children:"Alex McLean - Tidal Pattern Language for Live Coding of Music"})}),"\n"]}),"\n",(0,s.jsxs)(i.p,{children:["The inspiration for usage of Integer Sequences came from composers such as Iannis Xenakis, who used the fibonacci formula in his piece ",(0,s.jsx)(i.em,{children:"Nomos Alpha"})," and referred to the technique as ",(0,s.jsx)(i.em,{children:"Fibonacci Motion"}),". Also Xenakis referred to the usuage of set theory for composition as ",(0,s.jsx)(i.em,{children:"Symbolic Music"}),"."]}),"\n",(0,s.jsxs)(i.ul,{children:["\n",(0,s.jsxs)(i.li,{children:["\n",(0,s.jsx)(i.p,{children:(0,s.jsx)(i.a,{href:"https://books.google.nl/books?hl=en&lr=&id=y6lL3I0vmMwC&oi=fnd&pg=PR7&dq=symbolic+music+xenakis&ots=W_s_gzotb2&sig=Y6-2zjquOIwju7q8uaoRcPuboC8&redir_esc=y#v=onepage&q=symbolic%20music%20xenakis&f=false",children:"Iannis Xenakis - Formalized Music, Thought and Mathematics in Music"})}),"\n"]}),"\n",(0,s.jsxs)(i.li,{children:["\n",(0,s.jsx)(i.p,{children:(0,s.jsx)(i.a,{href:"https://www.jstor.org/stable/843739?seq=1",children:"Thomas DeLio - Nomos Alpha: The Dialects of Structure and Materials"})}),"\n"]}),"\n"]}),"\n",(0,s.jsx)(i.p,{children:"The Online Encyclopedia of Integer Sequences is a great resource for number sequences that can be derived from a wide variety of mathematical functions. A famous sequence is the Fibonacci sequence. An interesting approach used with integer sequences in algorithmic composition is applying a modulo operation. For the fibonacci sequence this results in the Pisano periods."}),"\n",(0,s.jsxs)(i.ul,{children:["\n",(0,s.jsxs)(i.li,{children:["\n",(0,s.jsx)(i.p,{children:(0,s.jsx)(i.a,{href:"https://oeis.org/A000045",children:"Online Encyclopedia of Integer Sequences"})}),"\n"]}),"\n",(0,s.jsxs)(i.li,{children:["\n",(0,s.jsx)(i.p,{children:(0,s.jsx)(i.a,{href:"https://www.youtube.com/watch?v=Nu-lW-Ifyec",children:"Pisano Periods explained on Numberphile"})}),"\n"]}),"\n"]}),"\n",(0,s.jsx)(i.p,{children:"The Hexadecimal rhythm generator was inspired by a workshop by Steven Yi at the International Conference on Live Coding 2020 at the University of Limerick, Ireland."}),"\n",(0,s.jsxs)(i.ul,{children:["\n",(0,s.jsxs)(i.li,{children:["\n",(0,s.jsx)(i.p,{children:(0,s.jsx)(i.a,{href:"https://github.com/kunstmusik/csound-live-code/blob/master/doc/hexadecimal_beats.md",children:"Steven Yi - Hexadecimal Beat"})}),"\n"]}),"\n",(0,s.jsxs)(i.li,{children:["\n",(0,s.jsx)(i.p,{children:(0,s.jsx)(i.a,{href:"https://kunstmusik.github.io/learn-hex-beats/",children:"Learn hex beats"})}),"\n"]}),"\n",(0,s.jsxs)(i.li,{children:["\n",(0,s.jsx)(i.p,{children:(0,s.jsx)(i.a,{href:"http://bernhardwagner.net/musings/RPABN.html",children:"Bernhard Wagner - Rhythmic Patterns As Binary Numbers"})}),"\n"]}),"\n"]}),"\n",(0,s.jsx)(i.p,{children:"Some methods from the Transformational and Stochastic library are inspired by objects or functions in the Max/MSP programming environment. Such as the urn, spread and spreadInclusive methods."}),"\n",(0,s.jsx)(i.p,{children:"The collatz conjecture algorithm was inspired by a Numberphile and Coding Train video on youtube. The conjecture allows for very organic graphs when drawing the even-odd numbers in sequence as small rotations in angles of lines."}),"\n",(0,s.jsxs)(i.ul,{children:["\n",(0,s.jsx)(i.li,{children:(0,s.jsx)(i.a,{href:"https://youtu.be/LqKpkdRRLZw",children:"Collatz Conjecture on Numberphile"})}),"\n"]}),"\n",(0,s.jsx)(i.p,{children:"The Infinity Series is based on the work by composer Per N\xf8rg\xe5rd. The method takes its name from the endlessly self-similar nature of the resulting musical material, comparable to fractal geometry. Mathematically, the infinity series is an integer sequence. A great explanation can be found here:"}),"\n",(0,s.jsxs)(i.ul,{children:["\n",(0,s.jsx)(i.li,{children:(0,s.jsx)(i.a,{href:"https://www.lawtonhall.com/blog/2019/9/9/per-nrgrds-infinity-series#:~:text=Coding%20the%20Infinity%20Series",children:"Per N\xf8rg\xe5rd's Infinity Series"})}),"\n"]}),"\n",(0,s.jsx)(i.p,{children:"Some other interesting resources and papers that have been used for some of the methods within this library."}),"\n",(0,s.jsxs)(i.ul,{children:["\n",(0,s.jsxs)(i.li,{children:["\n",(0,s.jsx)(i.p,{children:(0,s.jsx)(i.a,{href:"https://www.dmu.ac.uk/documents/technology-documents/research/mtirc/nowalls/mww-collins.pdf",children:"Nick Collins - Algorithmic Composition Methods for Breakbeat Science"})}),"\n"]}),"\n",(0,s.jsxs)(i.li,{children:["\n",(0,s.jsx)(i.p,{children:(0,s.jsx)(i.a,{href:"https://en.wikipedia.org/wiki/Markov_chain",children:"Markov Chain on wikipedia"})}),"\n"]}),"\n"]})]})}function d(e={}){const{wrapper:i}={...(0,r.R)(),...e.components};return i?(0,s.jsx)(i,{...e,children:(0,s.jsx)(c,{...e})}):c(e)}},8453:(e,i,n)=>{n.d(i,{R:()=>a,x:()=>o});var s=n(6540);const r={},t=s.createContext(r);function a(e){const i=s.useContext(t);return s.useMemo((function(){return"function"==typeof e?e(i):{...i,...e}}),[i,e])}function o(e){let i;return i=e.disableParentContext?"function"==typeof e.components?e.components(r):e.components||r:a(e.components),s.createElement(t.Provider,{value:i},e.children)}}}]); \ No newline at end of file diff --git a/assets/js/e59418e5.c758c2c2.js b/assets/js/e59418e5.c758c2c2.js new file mode 100644 index 00000000..e6c4d2c7 --- /dev/null +++ b/assets/js/e59418e5.c758c2c2.js @@ -0,0 +1 @@ +"use strict";(self.webpackChunkmercury_docs=self.webpackChunkmercury_docs||[]).push([[28],{2472:(e,i,n)=>{n.r(i),n.d(i,{assets:()=>h,contentTitle:()=>a,default:()=>d,frontMatter:()=>t,metadata:()=>o,toc:()=>l});var s=n(4848),r=n(8453);const t={},a="\ud83d\udc7e Made with Mercury",o={id:"about/inspiration",title:"\ud83d\udc7e Made with Mercury",description:"Below is some inspiration of awesome things made by the Mercury community.",source:"@site/docs/about/inspiration.md",sourceDirName:"about",slug:"/about/inspiration",permalink:"/mercury/docs/about/inspiration",draft:!1,unlisted:!1,tags:[],version:"current",frontMatter:{},sidebar:"tutorialSidebar",previous:{title:"\ud83c\udfae Quick Features Overview",permalink:"/mercury/docs/about/features"},next:{title:"\ud83d\ude80 Getting Started",permalink:"/mercury/docs/getting-started"}},h={},l=[{value:"\ud83d\udd0d Further reading",id:"-further-reading",level:2},{value:"\u2728 Inspiration & Bibliography",id:"-inspiration--bibliography",level:2}];function c(e){const i={a:"a",code:"code",em:"em",h1:"h1",h2:"h2",li:"li",p:"p",ul:"ul",...(0,r.R)(),...e.components};return(0,s.jsxs)(s.Fragment,{children:[(0,s.jsx)(i.h1,{id:"-made-with-mercury",children:"\ud83d\udc7e Made with Mercury"}),"\n",(0,s.jsx)(i.p,{children:"Below is some inspiration of awesome things made by the Mercury community."}),"\n",(0,s.jsxs)(i.p,{children:["Made something with Mercury? I'm very happy to add it to the list! So please edit this file by adding a URL here and send a pull request! \ud83d\ude0e Read ",(0,s.jsx)(i.a,{href:"./../contribute",children:"Contribute"})," to find out more about editting files on github."]}),"\n",(0,s.jsxs)(i.ul,{children:["\n",(0,s.jsx)(i.li,{children:(0,s.jsx)(i.a,{href:"https://youtu.be/lG67cQcAN9c?si=HfkEvG4gLHZER3cq",children:"Pere Faura"})}),"\n",(0,s.jsx)(i.li,{children:(0,s.jsx)(i.a,{href:"https://youtu.be/hbu_Q_8NAe0?si=NB7V4HD4CMFYFpcx",children:"Mia Knop Jacobsen"})}),"\n",(0,s.jsx)(i.li,{children:(0,s.jsx)(i.a,{href:"https://youtu.be/n13y0xwCqks?si=awdPUIB6LOHB9EGd",children:"Felipe Gonzalez"})}),"\n",(0,s.jsx)(i.li,{children:(0,s.jsx)(i.a,{href:"https://youtu.be/sp2oCJ7ay18?si=3CSPYyXq-dZWlzRR",children:"el Amaru"})}),"\n",(0,s.jsx)(i.li,{children:(0,s.jsx)(i.a,{href:"https://youtu.be/O9RB_ovurVk?si=j4XvKCvyZSdV1sD3",children:"Agustin (Elconx)"})}),"\n",(0,s.jsx)(i.li,{children:(0,s.jsx)(i.a,{href:"https://youtu.be/7KH7fn4k8kE?si=8Dv_l1gHcyIaL7Bv&t=1429",children:"Damage Such - Live at /* VIU */ Algorave Barcelona"})}),"\n"]}),"\n",(0,s.jsxs)(i.ul,{children:["\n",(0,s.jsx)(i.li,{children:(0,s.jsx)(i.a,{href:"https://www.youtube.com/live/iY9Vc8LpMFQ?si=vsDIlYW3YXhF29iq&t=3494",children:"Sabrina Verhage & Flor de Fuego - Live at LIVECODERA8M"})}),"\n",(0,s.jsx)(i.li,{children:(0,s.jsx)(i.a,{href:"https://youtu.be/aB1mdxLCR7c?si=6Vk0MzKmK0bDoX_K&t=856",children:"iTypeMusic - Live Coding Techno Vibes"})}),"\n",(0,s.jsx)(i.li,{children:(0,s.jsx)(i.a,{href:"https://www.youtube.com/watch?v=TzM-koWkRow&ab_channel=Eulerroom",children:"LXT @levoxtrip (at Solstice Stream December 2023)"})}),"\n",(0,s.jsx)(i.li,{children:(0,s.jsx)(i.a,{href:"https://youtu.be/WSPNDC0a2X4",children:"Linalab(Mercury) + Turbulente(p5Live) - Live at Algorave Lisbon"})}),"\n",(0,s.jsx)(i.li,{children:(0,s.jsx)(i.a,{href:"https://youtu.be/nnhLPL-kKMs?si=iZ0rePJXhC54SHhx&t=988",children:"Timo - Live at Algorave D\xfcsseldorf"})}),"\n",(0,s.jsx)(i.li,{children:(0,s.jsx)(i.a,{href:"https://youtu.be/syUL76qCV6w",children:"Timo - Liber Abaci (Mercury Coding Sessions)"})}),"\n",(0,s.jsx)(i.li,{children:(0,s.jsx)(i.a,{href:"https://youtu.be/KJ4OpJ3-Ik0",children:"Roald van Dillewijn - Smashing Temparateness (Mercury Coding Sessions)"})}),"\n",(0,s.jsx)(i.li,{children:(0,s.jsx)(i.a,{href:"https://youtu.be/BbOz1XBu8f8",children:'Rafa & Timo - "Hello, off-world!" (Mercury Coding Sessions)'})}),"\n",(0,s.jsx)(i.li,{children:(0,s.jsx)(i.a,{href:"https://youtu.be/wRVQHlghitM",children:"Guillem G\xf3ngora Moral - Transcription #1 (Mercury Coding Sessions)"})}),"\n",(0,s.jsx)(i.li,{children:(0,s.jsx)(i.a,{href:"https://youtu.be/e4sPKOlaYS8",children:"Anne Veinberg - CodeKlavier meets Mercury (Mercury Coding Sessions)"})}),"\n",(0,s.jsx)(i.li,{children:(0,s.jsx)(i.a,{href:"https://youtu.be/UsfKF0ggn7k",children:"Nick Levantis - Wake Up"})}),"\n",(0,s.jsx)(i.li,{children:(0,s.jsx)(i.a,{href:"https://www.youtube.com/watch?v=7UWywv_DPHI&t=4s",children:'Rafa & Timo - "Hello, off-world!" (Live at NMF)'})}),"\n",(0,s.jsx)(i.li,{children:(0,s.jsx)(i.a,{href:"https://www.youtube.com/watch?v=1v7xicXuSbo&t=346s",children:"Roald van Dillewijn - Mercury & DigiLog"})}),"\n",(0,s.jsx)(i.li,{children:(0,s.jsx)(i.a,{href:"https://www.youtube.com/watch?v=zzmgX4QSBMM",children:"Sasj & Timo - Amalgam (Live at Github Sattelite 2020)"})}),"\n",(0,s.jsx)(i.li,{children:(0,s.jsx)(i.a,{href:"https://www.youtube.com/watch?v=VSoibHwQJ98&t=175s",children:"Anne Veinberg - CodeKlaver & Mercury Extension Tryout"})}),"\n"]}),"\n",(0,s.jsx)(i.h2,{id:"-further-reading",children:"\ud83d\udd0d Further reading"}),"\n",(0,s.jsx)(i.p,{children:"On my website you can find projects I'm working on that involve Mercury and live coding"}),"\n",(0,s.jsxs)(i.ul,{children:["\n",(0,s.jsx)(i.li,{children:(0,s.jsx)(i.a,{href:"http://www.timohoogland.com/mercury-livecoding",children:"Mercury homepage"})}),"\n"]}),"\n",(0,s.jsx)(i.p,{children:"I published a paper at the International Conference on Live Coding in Madrid in 2019. The paper is a bit outdated now tho, but you can still read it!"}),"\n",(0,s.jsxs)(i.ul,{children:["\n",(0,s.jsx)(i.li,{children:(0,s.jsx)(i.a,{href:"http://iclc.livecodenetwork.org/2019/papers/paper67.pdf",children:"Paper in ICLC 2019"})}),"\n"]}),"\n",(0,s.jsx)(i.h2,{id:"-inspiration--bibliography",children:"\u2728 Inspiration & Bibliography"}),"\n",(0,s.jsxs)(i.p,{children:["This project is inspired by the composition techniques named ",(0,s.jsx)(i.code,{children:"Serialism"})," and ",(0,s.jsx)(i.code,{children:"Total Serialism"}),". The technique approaches the parameters that make up a piece of music as individual series of values. These parameters are (but not limited to) ",(0,s.jsx)(i.em,{children:"pitch, duration/rhythm and velocity/dynamics"}),"."]}),"\n",(0,s.jsxs)(i.p,{children:["Serialism originated from the ",(0,s.jsx)(i.code,{children:"twelve-tone"}),' technique, described in 1919 by Josef Hauer in his published work "Law of the twelve tones". This technique starts out with a randomly ordered set of the twelve chromatic notes. From there on out you can apply transformations on this set, such as reverse/retrograde, inverse, transpose, and combinations between those.']}),"\n",(0,s.jsxs)(i.ul,{children:["\n",(0,s.jsxs)(i.li,{children:["\n",(0,s.jsx)(i.p,{children:(0,s.jsx)(i.a,{href:"https://en.wikipedia.org/wiki/Serialism",children:"Serialism on Wikipedia"})}),"\n"]}),"\n",(0,s.jsxs)(i.li,{children:["\n",(0,s.jsx)(i.p,{children:(0,s.jsx)(i.a,{href:"https://en.wikipedia.org/wiki/Twelve-tone_technique",children:"Twelve-Tone on Wikipedia"})}),"\n"]}),"\n",(0,s.jsxs)(i.li,{children:["\n",(0,s.jsx)(i.p,{children:(0,s.jsx)(i.a,{href:"http://academic.udayton.edu/PhillipMagnuson/soundpatterns/microcosms/serialism.html",children:"Phillip Magnuson - Sound Patterns Ch.45 - Serialism"})}),"\n"]}),"\n"]}),"\n",(0,s.jsxs)(i.p,{children:['For many of the functions programmed much inspiration was gained from Laurie Spiegels paper on "Manipulation of Musical Patterns" (1981) in which she suggests to ',(0,s.jsx)(i.em,{children:'"extract a basic "library" consisting of the most elemental transformations which have consistently been successfully used on musical patterns, a basic group of "tried-and-true" musical manipulations."'})," Specifically the stretch and expand methods were inspired by Laurie Spiegels writings in this paper. Stretch is a method that is ",(0,s.jsx)(i.em,{children:'"inserting a smooth ramp between discretely separated values"'})," and expand is an interpretation of ",(0,s.jsx)(i.em,{children:'"Extension beyond that which already exists in such a way as to preserve continuity with it, to project from it"'})]}),"\n",(0,s.jsxs)(i.ul,{children:["\n",(0,s.jsx)(i.li,{children:(0,s.jsx)(i.a,{href:"https://github.com/calpicasso/Manipulations-of-musical-patterns/blob/master/Manipulations%20of%20Musical%20Patterns.md",children:"Laurie Spiegel - Manipulations of Musical Patterns"})}),"\n"]}),"\n",(0,s.jsx)(i.p,{children:"The euclidean rhythm generator was inspired by the famous paper by Godfried Toussaint."}),"\n",(0,s.jsxs)(i.ul,{children:["\n",(0,s.jsx)(i.li,{children:(0,s.jsx)(i.a,{href:"http://cgm.cs.mcgill.ca/~godfried/publications/banff.pdf",children:"Godfried Toussaint - The Euclidean Algorithm Generates Traditional Musical Rhythms"})}),"\n"]}),"\n",(0,s.jsx)(i.p,{children:"The clave rhythm generator was inspired by another paper by Godfried Toussaint."}),"\n",(0,s.jsxs)(i.ul,{children:["\n",(0,s.jsx)(i.li,{children:(0,s.jsx)(i.a,{href:"http://cgm.cs.mcgill.ca/~godfried/publications/bridges.pdf",children:"Godfried Toussaint - A mathematical analysis of African, Brazilian, and Cuban clave rhythms"})}),"\n",(0,s.jsx)(i.li,{children:(0,s.jsx)(i.a,{href:"http://cgm.cs.mcgill.ca/~godfried/rhythm-and-mathematics.html",children:"Comparative Musicology - Musical Rhythm and Mathematics"})}),"\n"]}),"\n",(0,s.jsx)(i.p,{children:"Inspiration for the sequencing also came from the Live Coding scene and current programming languages available such as Tidal, Extempore, SonicPi and more. In Live Coding the Serialism technique is very common when programming music. In many cases the rhythms, melodies, and other musical expressions are expressed in arrays that are iterated based on the timing of the system."}),"\n",(0,s.jsxs)(i.ul,{children:["\n",(0,s.jsx)(i.li,{children:(0,s.jsx)(i.a,{href:"https://s3.amazonaws.com/academia.edu.documents/11010319/39.pdf?response-content-disposition=inline%3B%20filename%3DTidal_Pattern_Language_for_Live_Coding_o.pdf&X-Amz-Algorithm=AWS4-HMAC-SHA256&X-Amz-Credential=AKIAIWOWYYGZ2Y53UL3A%2F20200115%2Fus-east-1%2Fs3%2Faws4_request&X-Amz-Date=20200115T225654Z&X-Amz-Expires=3600&X-Amz-SignedHeaders=host&X-Amz-Signature=a1d10c16a032d819fa4b9c8f9bb6f79eacf3a81fb13704d60cd08ef4cd0e1f51",children:"Alex McLean - Tidal Pattern Language for Live Coding of Music"})}),"\n"]}),"\n",(0,s.jsxs)(i.p,{children:["The inspiration for usage of Integer Sequences came from composers such as Iannis Xenakis, who used the fibonacci formula in his piece ",(0,s.jsx)(i.em,{children:"Nomos Alpha"})," and referred to the technique as ",(0,s.jsx)(i.em,{children:"Fibonacci Motion"}),". Also Xenakis referred to the usuage of set theory for composition as ",(0,s.jsx)(i.em,{children:"Symbolic Music"}),"."]}),"\n",(0,s.jsxs)(i.ul,{children:["\n",(0,s.jsxs)(i.li,{children:["\n",(0,s.jsx)(i.p,{children:(0,s.jsx)(i.a,{href:"https://books.google.nl/books?hl=en&lr=&id=y6lL3I0vmMwC&oi=fnd&pg=PR7&dq=symbolic+music+xenakis&ots=W_s_gzotb2&sig=Y6-2zjquOIwju7q8uaoRcPuboC8&redir_esc=y#v=onepage&q=symbolic%20music%20xenakis&f=false",children:"Iannis Xenakis - Formalized Music, Thought and Mathematics in Music"})}),"\n"]}),"\n",(0,s.jsxs)(i.li,{children:["\n",(0,s.jsx)(i.p,{children:(0,s.jsx)(i.a,{href:"https://www.jstor.org/stable/843739?seq=1",children:"Thomas DeLio - Nomos Alpha: The Dialects of Structure and Materials"})}),"\n"]}),"\n"]}),"\n",(0,s.jsx)(i.p,{children:"The Online Encyclopedia of Integer Sequences is a great resource for number sequences that can be derived from a wide variety of mathematical functions. A famous sequence is the Fibonacci sequence. An interesting approach used with integer sequences in algorithmic composition is applying a modulo operation. For the fibonacci sequence this results in the Pisano periods."}),"\n",(0,s.jsxs)(i.ul,{children:["\n",(0,s.jsxs)(i.li,{children:["\n",(0,s.jsx)(i.p,{children:(0,s.jsx)(i.a,{href:"https://oeis.org/A000045",children:"Online Encyclopedia of Integer Sequences"})}),"\n"]}),"\n",(0,s.jsxs)(i.li,{children:["\n",(0,s.jsx)(i.p,{children:(0,s.jsx)(i.a,{href:"https://www.youtube.com/watch?v=Nu-lW-Ifyec",children:"Pisano Periods explained on Numberphile"})}),"\n"]}),"\n"]}),"\n",(0,s.jsx)(i.p,{children:"The Hexadecimal rhythm generator was inspired by a workshop by Steven Yi at the International Conference on Live Coding 2020 at the University of Limerick, Ireland."}),"\n",(0,s.jsxs)(i.ul,{children:["\n",(0,s.jsxs)(i.li,{children:["\n",(0,s.jsx)(i.p,{children:(0,s.jsx)(i.a,{href:"https://github.com/kunstmusik/csound-live-code/blob/master/doc/hexadecimal_beats.md",children:"Steven Yi - Hexadecimal Beat"})}),"\n"]}),"\n",(0,s.jsxs)(i.li,{children:["\n",(0,s.jsx)(i.p,{children:(0,s.jsx)(i.a,{href:"https://kunstmusik.github.io/learn-hex-beats/",children:"Learn hex beats"})}),"\n"]}),"\n",(0,s.jsxs)(i.li,{children:["\n",(0,s.jsx)(i.p,{children:(0,s.jsx)(i.a,{href:"http://bernhardwagner.net/musings/RPABN.html",children:"Bernhard Wagner - Rhythmic Patterns As Binary Numbers"})}),"\n"]}),"\n"]}),"\n",(0,s.jsx)(i.p,{children:"Some methods from the Transformational and Stochastic library are inspired by objects or functions in the Max/MSP programming environment. Such as the urn, spread and spreadInclusive methods."}),"\n",(0,s.jsx)(i.p,{children:"The collatz conjecture algorithm was inspired by a Numberphile and Coding Train video on youtube. The conjecture allows for very organic graphs when drawing the even-odd numbers in sequence as small rotations in angles of lines."}),"\n",(0,s.jsxs)(i.ul,{children:["\n",(0,s.jsx)(i.li,{children:(0,s.jsx)(i.a,{href:"https://youtu.be/LqKpkdRRLZw",children:"Collatz Conjecture on Numberphile"})}),"\n"]}),"\n",(0,s.jsx)(i.p,{children:"The Infinity Series is based on the work by composer Per N\xf8rg\xe5rd. The method takes its name from the endlessly self-similar nature of the resulting musical material, comparable to fractal geometry. Mathematically, the infinity series is an integer sequence. A great explanation can be found here:"}),"\n",(0,s.jsxs)(i.ul,{children:["\n",(0,s.jsx)(i.li,{children:(0,s.jsx)(i.a,{href:"https://www.lawtonhall.com/blog/2019/9/9/per-nrgrds-infinity-series#:~:text=Coding%20the%20Infinity%20Series",children:"Per N\xf8rg\xe5rd's Infinity Series"})}),"\n"]}),"\n",(0,s.jsx)(i.p,{children:"Some other interesting resources and papers that have been used for some of the methods within this library."}),"\n",(0,s.jsxs)(i.ul,{children:["\n",(0,s.jsxs)(i.li,{children:["\n",(0,s.jsx)(i.p,{children:(0,s.jsx)(i.a,{href:"https://www.dmu.ac.uk/documents/technology-documents/research/mtirc/nowalls/mww-collins.pdf",children:"Nick Collins - Algorithmic Composition Methods for Breakbeat Science"})}),"\n"]}),"\n",(0,s.jsxs)(i.li,{children:["\n",(0,s.jsx)(i.p,{children:(0,s.jsx)(i.a,{href:"https://en.wikipedia.org/wiki/Markov_chain",children:"Markov Chain on wikipedia"})}),"\n"]}),"\n"]})]})}function d(e={}){const{wrapper:i}={...(0,r.R)(),...e.components};return i?(0,s.jsx)(i,{...e,children:(0,s.jsx)(c,{...e})}):c(e)}},8453:(e,i,n)=>{n.d(i,{R:()=>a,x:()=>o});var s=n(6540);const r={},t=s.createContext(r);function a(e){const i=s.useContext(t);return s.useMemo((function(){return"function"==typeof e?e(i):{...i,...e}}),[i,e])}function o(e){let i;return i=e.disableParentContext?"function"==typeof e.components?e.components(r):e.components||r:a(e.components),s.createElement(t.Provider,{value:i},e.children)}}}]); \ No newline at end of file diff --git a/assets/js/runtime~main.952a522a.js b/assets/js/runtime~main.46f6a8f1.js similarity index 97% rename from assets/js/runtime~main.952a522a.js rename to assets/js/runtime~main.46f6a8f1.js index b100b401..5aa6b149 100644 --- a/assets/js/runtime~main.952a522a.js +++ b/assets/js/runtime~main.46f6a8f1.js @@ -1 +1 @@ -(()=>{"use strict";var e,a,r,t,c,b={},f={};function o(e){var a=f[e];if(void 0!==a)return a.exports;var r=f[e]={id:e,loaded:!1,exports:{}};return b[e].call(r.exports,r,r.exports,o),r.loaded=!0,r.exports}o.m=b,o.c=f,e=[],o.O=(a,r,t,c)=>{if(!r){var b=1/0;for(i=0;i=c)&&Object.keys(o.O).every((e=>o.O[e](r[d])))?r.splice(d--,1):(f=!1,c0&&e[i-1][2]>c;i--)e[i]=e[i-1];e[i]=[r,t,c]},o.n=e=>{var a=e&&e.__esModule?()=>e.default:()=>e;return o.d(a,{a:a}),a},r=Object.getPrototypeOf?e=>Object.getPrototypeOf(e):e=>e.__proto__,o.t=function(e,t){if(1&t&&(e=this(e)),8&t)return e;if("object"==typeof e&&e){if(4&t&&e.__esModule)return e;if(16&t&&"function"==typeof e.then)return e}var c=Object.create(null);o.r(c);var b={};a=a||[null,r({}),r([]),r(r)];for(var f=2&t&&e;"object"==typeof f&&!~a.indexOf(f);f=r(f))Object.getOwnPropertyNames(f).forEach((a=>b[a]=()=>e[a]));return b.default=()=>e,o.d(c,b),c},o.d=(e,a)=>{for(var r in a)o.o(a,r)&&!o.o(e,r)&&Object.defineProperty(e,r,{enumerable:!0,get:a[r]})},o.f={},o.e=e=>Promise.all(Object.keys(o.f).reduce(((a,r)=>(o.f[r](e,a),a)),[])),o.u=e=>"assets/js/"+({28:"e59418e5",48:"a94703ab",61:"1f391b9e",98:"a7bd4aaa",134:"393be207",138:"1a4e3797",163:"8f7dbc55",168:"c6a20f18",196:"23c07e7b",258:"2c9d0a4b",283:"bbca2b71",295:"f6471318",316:"8232b325",385:"6c1c1008",386:"ebfee794",401:"17896441",410:"54934235",452:"643a29c7",464:"b096b7b7",470:"610af566",485:"a63bd564",503:"83adf833",522:"d744ed8e",543:"e92cf459",581:"935f2afb",591:"4ba7e5a3",613:"ba4e2648",634:"c4f5d8e4",647:"5e95c892",707:"d44737fc",716:"89be51a8",856:"2bac5d97",866:"3025b0a2",868:"6c9bc4e1",888:"2730afdf",924:"d589d3a7",957:"613c1710",969:"14eb3368",989:"9d8cf1de",991:"46fe9eed"}[e]||e)+"."+{28:"9e96f3d8",48:"56de08cd",49:"20e7adae",61:"70c80980",98:"5ee94849",134:"25e8b0de",138:"19d64b3b",158:"42cdc515",163:"4e774b3a",168:"eba7c0e1",196:"0c207194",237:"04257d37",258:"c9d55568",283:"4f690aec",295:"ad2c1413",316:"6e8b0de9",385:"704bc95e",386:"0eb9da97",401:"dd621007",410:"aa4288f1",452:"3df7bc32",464:"caf228a8",470:"51d2f154",485:"0d9fcbf0",503:"0c1fb6f8",522:"b997c7bc",543:"fe096c80",581:"118ccadc",591:"a887d9b9",613:"5cb15272",634:"7a61c0f1",647:"70e76810",707:"5891da8c",716:"e31ba57b",794:"76223526",856:"25713b95",866:"e8871151",868:"3c0d64a8",888:"c79dec0f",913:"e34cd1d3",924:"6186ee36",957:"8b6eeae8",969:"2e271b7a",989:"68c269ca",991:"5dcaeb57"}[e]+".js",o.miniCssF=e=>{},o.g=function(){if("object"==typeof globalThis)return globalThis;try{return this||new Function("return this")()}catch(e){if("object"==typeof window)return window}}(),o.o=(e,a)=>Object.prototype.hasOwnProperty.call(e,a),t={},c="mercury-docs:",o.l=(e,a,r,b)=>{if(t[e])t[e].push(a);else{var f,d;if(void 0!==r)for(var n=document.getElementsByTagName("script"),i=0;i{f.onerror=f.onload=null,clearTimeout(s);var c=t[e];if(delete t[e],f.parentNode&&f.parentNode.removeChild(f),c&&c.forEach((e=>e(r))),a)return a(r)},s=setTimeout(l.bind(null,void 0,{type:"timeout",target:f}),12e4);f.onerror=l.bind(null,f.onerror),f.onload=l.bind(null,f.onload),d&&document.head.appendChild(f)}},o.r=e=>{"undefined"!=typeof Symbol&&Symbol.toStringTag&&Object.defineProperty(e,Symbol.toStringTag,{value:"Module"}),Object.defineProperty(e,"__esModule",{value:!0})},o.p="/mercury/",o.gca=function(e){return e={17896441:"401",54934235:"410",e59418e5:"28",a94703ab:"48","1f391b9e":"61",a7bd4aaa:"98","393be207":"134","1a4e3797":"138","8f7dbc55":"163",c6a20f18:"168","23c07e7b":"196","2c9d0a4b":"258",bbca2b71:"283",f6471318:"295","8232b325":"316","6c1c1008":"385",ebfee794:"386","643a29c7":"452",b096b7b7:"464","610af566":"470",a63bd564:"485","83adf833":"503",d744ed8e:"522",e92cf459:"543","935f2afb":"581","4ba7e5a3":"591",ba4e2648:"613",c4f5d8e4:"634","5e95c892":"647",d44737fc:"707","89be51a8":"716","2bac5d97":"856","3025b0a2":"866","6c9bc4e1":"868","2730afdf":"888",d589d3a7:"924","613c1710":"957","14eb3368":"969","9d8cf1de":"989","46fe9eed":"991"}[e]||e,o.p+o.u(e)},(()=>{var e={354:0,869:0};o.f.j=(a,r)=>{var t=o.o(e,a)?e[a]:void 0;if(0!==t)if(t)r.push(t[2]);else if(/^(354|869)$/.test(a))e[a]=0;else{var c=new Promise(((r,c)=>t=e[a]=[r,c]));r.push(t[2]=c);var b=o.p+o.u(a),f=new Error;o.l(b,(r=>{if(o.o(e,a)&&(0!==(t=e[a])&&(e[a]=void 0),t)){var c=r&&("load"===r.type?"missing":r.type),b=r&&r.target&&r.target.src;f.message="Loading chunk "+a+" failed.\n("+c+": "+b+")",f.name="ChunkLoadError",f.type=c,f.request=b,t[1](f)}}),"chunk-"+a,a)}},o.O.j=a=>0===e[a];var a=(a,r)=>{var t,c,b=r[0],f=r[1],d=r[2],n=0;if(b.some((a=>0!==e[a]))){for(t in f)o.o(f,t)&&(o.m[t]=f[t]);if(d)var i=d(o)}for(a&&a(r);n{"use strict";var e,a,r,t,c,b={},f={};function o(e){var a=f[e];if(void 0!==a)return a.exports;var r=f[e]={id:e,loaded:!1,exports:{}};return b[e].call(r.exports,r,r.exports,o),r.loaded=!0,r.exports}o.m=b,o.c=f,e=[],o.O=(a,r,t,c)=>{if(!r){var b=1/0;for(i=0;i=c)&&Object.keys(o.O).every((e=>o.O[e](r[d])))?r.splice(d--,1):(f=!1,c0&&e[i-1][2]>c;i--)e[i]=e[i-1];e[i]=[r,t,c]},o.n=e=>{var a=e&&e.__esModule?()=>e.default:()=>e;return o.d(a,{a:a}),a},r=Object.getPrototypeOf?e=>Object.getPrototypeOf(e):e=>e.__proto__,o.t=function(e,t){if(1&t&&(e=this(e)),8&t)return e;if("object"==typeof e&&e){if(4&t&&e.__esModule)return e;if(16&t&&"function"==typeof e.then)return e}var c=Object.create(null);o.r(c);var b={};a=a||[null,r({}),r([]),r(r)];for(var f=2&t&&e;"object"==typeof f&&!~a.indexOf(f);f=r(f))Object.getOwnPropertyNames(f).forEach((a=>b[a]=()=>e[a]));return b.default=()=>e,o.d(c,b),c},o.d=(e,a)=>{for(var r in a)o.o(a,r)&&!o.o(e,r)&&Object.defineProperty(e,r,{enumerable:!0,get:a[r]})},o.f={},o.e=e=>Promise.all(Object.keys(o.f).reduce(((a,r)=>(o.f[r](e,a),a)),[])),o.u=e=>"assets/js/"+({28:"e59418e5",48:"a94703ab",61:"1f391b9e",98:"a7bd4aaa",134:"393be207",138:"1a4e3797",163:"8f7dbc55",168:"c6a20f18",196:"23c07e7b",258:"2c9d0a4b",283:"bbca2b71",295:"f6471318",316:"8232b325",385:"6c1c1008",386:"ebfee794",401:"17896441",410:"54934235",452:"643a29c7",464:"b096b7b7",470:"610af566",485:"a63bd564",503:"83adf833",522:"d744ed8e",543:"e92cf459",581:"935f2afb",591:"4ba7e5a3",613:"ba4e2648",634:"c4f5d8e4",647:"5e95c892",707:"d44737fc",716:"89be51a8",856:"2bac5d97",866:"3025b0a2",868:"6c9bc4e1",888:"2730afdf",924:"d589d3a7",957:"613c1710",969:"14eb3368",989:"9d8cf1de",991:"46fe9eed"}[e]||e)+"."+{28:"c758c2c2",48:"56de08cd",49:"20e7adae",61:"70c80980",98:"5ee94849",134:"25e8b0de",138:"19d64b3b",158:"42cdc515",163:"4e774b3a",168:"eba7c0e1",196:"0c207194",237:"04257d37",258:"c9d55568",283:"c97cfd78",295:"ad2c1413",316:"6e8b0de9",385:"704bc95e",386:"0eb9da97",401:"dd621007",410:"aa4288f1",452:"3df7bc32",464:"caf228a8",470:"51d2f154",485:"0d9fcbf0",503:"0c1fb6f8",522:"b997c7bc",543:"fe096c80",581:"118ccadc",591:"a887d9b9",613:"5cb15272",634:"7a61c0f1",647:"70e76810",707:"5891da8c",716:"e31ba57b",794:"76223526",856:"25713b95",866:"e8871151",868:"3c0d64a8",888:"c79dec0f",913:"e34cd1d3",924:"6186ee36",957:"8b6eeae8",969:"2e271b7a",989:"68c269ca",991:"5dcaeb57"}[e]+".js",o.miniCssF=e=>{},o.g=function(){if("object"==typeof globalThis)return globalThis;try{return this||new Function("return this")()}catch(e){if("object"==typeof window)return window}}(),o.o=(e,a)=>Object.prototype.hasOwnProperty.call(e,a),t={},c="mercury-docs:",o.l=(e,a,r,b)=>{if(t[e])t[e].push(a);else{var f,d;if(void 0!==r)for(var n=document.getElementsByTagName("script"),i=0;i{f.onerror=f.onload=null,clearTimeout(s);var c=t[e];if(delete t[e],f.parentNode&&f.parentNode.removeChild(f),c&&c.forEach((e=>e(r))),a)return a(r)},s=setTimeout(l.bind(null,void 0,{type:"timeout",target:f}),12e4);f.onerror=l.bind(null,f.onerror),f.onload=l.bind(null,f.onload),d&&document.head.appendChild(f)}},o.r=e=>{"undefined"!=typeof Symbol&&Symbol.toStringTag&&Object.defineProperty(e,Symbol.toStringTag,{value:"Module"}),Object.defineProperty(e,"__esModule",{value:!0})},o.p="/mercury/",o.gca=function(e){return e={17896441:"401",54934235:"410",e59418e5:"28",a94703ab:"48","1f391b9e":"61",a7bd4aaa:"98","393be207":"134","1a4e3797":"138","8f7dbc55":"163",c6a20f18:"168","23c07e7b":"196","2c9d0a4b":"258",bbca2b71:"283",f6471318:"295","8232b325":"316","6c1c1008":"385",ebfee794:"386","643a29c7":"452",b096b7b7:"464","610af566":"470",a63bd564:"485","83adf833":"503",d744ed8e:"522",e92cf459:"543","935f2afb":"581","4ba7e5a3":"591",ba4e2648:"613",c4f5d8e4:"634","5e95c892":"647",d44737fc:"707","89be51a8":"716","2bac5d97":"856","3025b0a2":"866","6c9bc4e1":"868","2730afdf":"888",d589d3a7:"924","613c1710":"957","14eb3368":"969","9d8cf1de":"989","46fe9eed":"991"}[e]||e,o.p+o.u(e)},(()=>{var e={354:0,869:0};o.f.j=(a,r)=>{var t=o.o(e,a)?e[a]:void 0;if(0!==t)if(t)r.push(t[2]);else if(/^(354|869)$/.test(a))e[a]=0;else{var c=new Promise(((r,c)=>t=e[a]=[r,c]));r.push(t[2]=c);var b=o.p+o.u(a),f=new Error;o.l(b,(r=>{if(o.o(e,a)&&(0!==(t=e[a])&&(e[a]=void 0),t)){var c=r&&("load"===r.type?"missing":r.type),b=r&&r.target&&r.target.src;f.message="Loading chunk "+a+" failed.\n("+c+": "+b+")",f.name="ChunkLoadError",f.type=c,f.request=b,t[1](f)}}),"chunk-"+a,a)}},o.O.j=a=>0===e[a];var a=(a,r)=>{var t,c,b=r[0],f=r[1],d=r[2],n=0;if(b.some((a=>0!==e[a]))){for(t in f)o.o(f,t)&&(o.m[t]=f[t]);if(d)var i=d(o)}for(a&&a(r);n 🤔 What is Mercury? | Mercury - + diff --git a/docs/about/features/index.html b/docs/about/features/index.html index 7aacb15d..37fd51dc 100644 --- a/docs/about/features/index.html +++ b/docs/about/features/index.html @@ -4,7 +4,7 @@ 🎮 Quick Features Overview | Mercury - + diff --git a/docs/about/index.html b/docs/about/index.html index ceae3fd8..7e3b3fcc 100644 --- a/docs/about/index.html +++ b/docs/about/index.html @@ -4,7 +4,7 @@ 📟 About | Mercury - + diff --git a/docs/about/inspiration/index.html b/docs/about/inspiration/index.html index 30fb3fe9..6e54fc85 100644 --- a/docs/about/inspiration/index.html +++ b/docs/about/inspiration/index.html @@ -4,7 +4,7 @@ 👾 Made with Mercury | Mercury - + @@ -12,7 +12,14 @@

Below is some inspiration of awesome things made by the Mercury community.

Made something with Mercury? I'm very happy to add it to the list! So please edit this file by adding a URL here and send a pull request! 😎 Read Contribute to find out more about editting files on github.

+

🔍 Further reading

On my website you can find projects I'm working on that involve Mercury and live coding

diff --git a/docs/about/vision/index.html b/docs/about/vision/index.html index 27bbd4ab..29efae59 100644 --- a/docs/about/vision/index.html +++ b/docs/about/vision/index.html @@ -4,7 +4,7 @@ 🔭 What can you do with Mercury? | Mercury - + diff --git a/docs/collaborate/index.html b/docs/collaborate/index.html index 59d29930..e9c57833 100644 --- a/docs/collaborate/index.html +++ b/docs/collaborate/index.html @@ -4,7 +4,7 @@ 👩‍💻👨‍💻 Collaborative Coding | Mercury - + diff --git a/docs/contribute/index.html b/docs/contribute/index.html index 9bcc55b7..7d3dfe03 100644 --- a/docs/contribute/index.html +++ b/docs/contribute/index.html @@ -4,7 +4,7 @@ 📝 Contribute | Mercury - + diff --git a/docs/getting-started/index.html b/docs/getting-started/index.html index 18a74548..5a76be53 100644 --- a/docs/getting-started/index.html +++ b/docs/getting-started/index.html @@ -4,7 +4,7 @@ 🚀 Getting Started | Mercury - + diff --git a/docs/index.html b/docs/index.html index 9b90ac84..5fbe3e6c 100644 --- a/docs/index.html +++ b/docs/index.html @@ -4,7 +4,7 @@ 👋 Welcome | Mercury - + diff --git a/docs/reference/actions/index.html b/docs/reference/actions/index.html index b21bc43b..2ef4dfe2 100644 --- a/docs/reference/actions/index.html +++ b/docs/reference/actions/index.html @@ -4,7 +4,7 @@ Actions | Mercury - + diff --git a/docs/reference/effects/index.html b/docs/reference/effects/index.html index 66f39e14..f8bf6c53 100644 --- a/docs/reference/effects/index.html +++ b/docs/reference/effects/index.html @@ -4,7 +4,7 @@ Instrument Effects | Mercury - + diff --git a/docs/reference/global/index.html b/docs/reference/global/index.html index bf2bb45c..f042093d 100644 --- a/docs/reference/global/index.html +++ b/docs/reference/global/index.html @@ -4,7 +4,7 @@ Global Settings | Mercury - + diff --git a/docs/reference/index.html b/docs/reference/index.html index 24d08dd1..8a77b183 100644 --- a/docs/reference/index.html +++ b/docs/reference/index.html @@ -4,7 +4,7 @@ 📖 Reference | Mercury - + diff --git a/docs/reference/instruments/index.html b/docs/reference/instruments/index.html index 2ac2ffc2..9b1db39c 100644 --- a/docs/reference/instruments/index.html +++ b/docs/reference/instruments/index.html @@ -4,7 +4,7 @@ Instrument Functions | Mercury - + @@ -392,6 +392,7 @@

receivingmodulator

Mercury4Max only

The modulator allows you to send a modulation signal as an argument to parameters in instrument-functions of other instruments. These parameters are continuously modulated at a specific rate with a specific waveform. The modulation rate is independent from the instruments time() (in comparison when using a list as an argument). It is also possible to send the modulation signal directly out to the connected soundcard on a specific DAC channel (Digital Analog Converter). This can for example be used for CV-modulations.

+
info

Mercury has a limit of 8 active Modulators. This may be relevant when using an external editor (Pulsar) with multiple instruments. If you exceed 8 Modulators, a warning will go to the Max Console and the last Modulator won't be evaluated. If you encounter this limit, you can comment out Modulator lines and uncomment them when you need them.

arguments

  • Name -> modulator waveform type: sine/sin, sawUp/phasor, sawDown/saw, square/rect, triangle/tri, random/rand, randomLine/randL, trigger/gate
  • diff --git a/docs/reference/list-functions/index.html b/docs/reference/list-functions/index.html index 58bce397..49e4124c 100644 --- a/docs/reference/list-functions/index.html +++ b/docs/reference/list-functions/index.html @@ -4,7 +4,7 @@ List Functions | Mercury - + diff --git a/docs/reference/syntax/index.html b/docs/reference/syntax/index.html index 1213d251..a7296216 100644 --- a/docs/reference/syntax/index.html +++ b/docs/reference/syntax/index.html @@ -4,7 +4,7 @@ Syntax Overview | Mercury - + diff --git a/docs/usage/coding/index.html b/docs/usage/coding/index.html index 4a6dbd80..35785f19 100644 --- a/docs/usage/coding/index.html +++ b/docs/usage/coding/index.html @@ -4,7 +4,7 @@ 🤓 Coding in Mercury | Mercury - + diff --git a/docs/usage/editors/index.html b/docs/usage/editors/index.html index 2aed1b7e..9ecc6885 100644 --- a/docs/usage/editors/index.html +++ b/docs/usage/editors/index.html @@ -4,7 +4,7 @@ ⌨️ External Editors | Mercury - + diff --git a/docs/usage/embedding/index.html b/docs/usage/embedding/index.html index a5dabca0..464527bd 100644 --- a/docs/usage/embedding/index.html +++ b/docs/usage/embedding/index.html @@ -4,7 +4,7 @@ 📦 Add Mercury in your Site | Mercury - + diff --git a/docs/usage/extending/index.html b/docs/usage/extending/index.html index 6b8a297f..c03510a2 100644 --- a/docs/usage/extending/index.html +++ b/docs/usage/extending/index.html @@ -4,7 +4,7 @@ 🛠 Extending Mercury | Mercury - + diff --git a/docs/usage/howto/index.html b/docs/usage/howto/index.html index da0762d3..b38203ae 100644 --- a/docs/usage/howto/index.html +++ b/docs/usage/howto/index.html @@ -4,7 +4,7 @@ 📚 How To's | Mercury - + diff --git a/docs/usage/index.html b/docs/usage/index.html index 3b8ad915..25c0e396 100644 --- a/docs/usage/index.html +++ b/docs/usage/index.html @@ -4,7 +4,7 @@ 🕹 Usage | Mercury - + diff --git a/docs/usage/mercury4max-overview/index.html b/docs/usage/mercury4max-overview/index.html index 0b6cc53c..60dc9511 100644 --- a/docs/usage/mercury4max-overview/index.html +++ b/docs/usage/mercury4max-overview/index.html @@ -4,7 +4,7 @@ 🏔 Mercury4Max Overview | Mercury - + diff --git a/docs/usage/playground-overview/index.html b/docs/usage/playground-overview/index.html index 193bb65a..6f43b377 100644 --- a/docs/usage/playground-overview/index.html +++ b/docs/usage/playground-overview/index.html @@ -4,7 +4,7 @@ 🛝 MercuryPlayground Overview | Mercury - + diff --git a/docs/usage/shortkeys/index.html b/docs/usage/shortkeys/index.html index 5c441588..5bc7fe8b 100644 --- a/docs/usage/shortkeys/index.html +++ b/docs/usage/shortkeys/index.html @@ -4,7 +4,7 @@ 🩳 Short-keys | Mercury - + diff --git a/docs/usage/sounds/index.html b/docs/usage/sounds/index.html index 1b390103..1a633e5c 100644 --- a/docs/usage/sounds/index.html +++ b/docs/usage/sounds/index.html @@ -4,7 +4,7 @@ 📢 Sounds in Mercury | Mercury - + diff --git a/docs/usage/troubleshooting/index.html b/docs/usage/troubleshooting/index.html index c42bced4..4a1cf055 100644 --- a/docs/usage/troubleshooting/index.html +++ b/docs/usage/troubleshooting/index.html @@ -4,7 +4,7 @@ 🚧 Troubleshooting | Mercury - + diff --git a/index.html b/index.html index 963177f3..7d9f19e3 100644 --- a/index.html +++ b/index.html @@ -4,7 +4,7 @@ Mercury Docs | Mercury - + diff --git a/markdown-page/index.html b/markdown-page/index.html index c78df2d1..51a4cdfc 100644 --- a/markdown-page/index.html +++ b/markdown-page/index.html @@ -4,7 +4,7 @@ Markdown page example | Mercury - + diff --git a/search/index.html b/search/index.html index 32fb0f96..344b9615 100644 --- a/search/index.html +++ b/search/index.html @@ -4,7 +4,7 @@ Search the documentation | Mercury - +