Home

Awesome

๐ŸŒ• Mercury Live Coding Playground

Welcome to the Mercury Playground! โœŒ๏ธ โ˜ฎ๏ธ Make Music, Not War! โ˜ฎ๏ธ โœŒ๏ธ

Mercury Playground is a free/open-source, beginner-friendly, minimal and human-readable language for the live coding of algorithmic electronic music performances running in the browser

Mercury currently has 2 versions:

๐Ÿš€ Start coding directly in the playground! (recommended for beginners)

๐Ÿ‘พ Or code with the latest full version in Max8:

git clone https://github.com/tmhglnd/mercury.git

๐Ÿ“Ÿ Build a local app from the browser version with Electron

๐Ÿ™ Support Mercury by buying me a coffee ko-fi

๐Ÿ’ฌ Join the Mercury Community on Discord

The Mercury playground in the browser

๐Ÿ“‹ Table of Contents

<!-- - [Newest Features](#-newest-features) -->

๐Ÿ“Ÿ About

Mercury is a free/open-source, beginner-friendly, minimal and human-readable language for the live coding of algorithmic electronic music

All elements of the language are designed around making code more accessible and less obfuscating for the audience. This motivation stretches down to the coding style itself which uses clear descriptive names for functions and a clear syntax. Furthermore the editor is restricted to 30 lines of code, keeping all code always visible. Mercury provides the performer with an extensive library of algorithms to generate or transform numbersequences that can modulate parameters, such as melody and rhythm, over time. The environment produces sound in conjunction with visuals. Besides looking at the code, the audience is also looking at the visuals that are reactive to the sound or generated by the sound.

It is named after te planet Mercury. Mercury rules the creation and expression of our mental processes. The planet implores us to express ourselves. Mercury is about a quick wit, quick thinking. It lets us move from one thing to the next.

๐ŸŽฎ Features Overview

Quick access to playback of samples and change timing and tempo of samples or synthesizers

set tempo 89

new sample kick_909 time(1/4)
new sample hat_909 time(3/16)

Make rhythmic patterns with sequences of numbers and probabilities

list loBeat [1 0 0 1 0.5]
list hiBeat [0 1 0.2 0]

new sample tabla_lo time(1/8) play(loBeat)
new sample tabla_hi time(1/8) play(hiBeat)

Generate psuedorandom melodic content for a synthesizer in a range and set a scale

set scale minor a
set randomSeed 31415

list melody random(16 0 24)

new synth saw note(melody) time(1/16) shape(4 100)

Generate sequences algorithmically to compose complex structures and choose from an extensive library of algorithms to work with

set tempo 132
list rhythm euclid(32 13)

list melody spread(5 0 24)
list melody palindrome(melody)
list melody clone(melody 0 5 7 3)
list melody lace(melody melody)

new synth triangle time(1/16) note(melody 1) shape(1 80) play(rhythm)

Design sounds with various effects (and upload your own sounds to use)

new sample chimes time(2) speed(0.25) fx(reverb 0.3 15) fx(drive 10) fx(shift 3 0.5)

Easily give multiple instruments the same effects

new sample chimes time(2)
new sample harp_down time(3)
new sample gong_lo time(5)

set all fx(reverb 0.5 11) fx(drive 1.5) fx(filter low 2000 0.6)

Sync audio loops to the tempo of your music

set tempo 97

new loop amen time(1)
new sample kick_house time(1/4)

Control external midi devices or applications by sending midi and cc <!--and use clock sync-->

new midi "Your Awesome Midi Device" time(1/16) note(7 1) name(mDev)
    set mDev length(1/16) gain(0.8) chord(off)
    set mDev cc(10 [20 50 100])

Sequence Hyrda visuals with instruments (experimental)

list hydras ['osc(10,0.1,2).out()' 'osc(20,-0.5,5).out()' 'osc(5,1,12).out()']

new sample kick_min time(1/16) play([1 0 0 1 0]) visual(hydras)
<!-- Control other environments via OSC-messages ```java ring params [0.25 0.5 0.75] new emitter osc address(yourDevice) theParam(params) time(1/4) // emits => /yourDevice/theParam 0.25 // /yourDevice/theParam 0.5 // /yourDevice/theParam 0.75 // /yourDevice/theParam 0.25 // etc... ``` -->

Easily control parameters in Mercury via external OSC-messages (only when running localhost)

new synth triangle fx(reverb '/synth/verb') fx(filter low '/synth/cutoff' 0.4) time(1) shape(1 'synth/length')

AND MANY MORE (TO COME...)

The playground (browser version) does not have exactly the same functionality as the original Mercury environment running in Max8. See below the differences. You may also encounter some discrepancies in syntax and in the documentation. Please report issues if you find any so they can be fixed. Items marked with a * are only available in the browser version.

โญ๏ธ watch and star this repo to keep up-to-date with the latest changes whenever they're made

๐Ÿ‘ฉโ€๐Ÿ’ป๐Ÿ‘จโ€๐Ÿ’ป Collaborative Coding

You can code together in Mercury by using the amazing Flok live coding environment for the browser developed by Damiรกn Silvani (a.k.a. Munshkr). Flok is a web-based P2P collaborative editor for live coding music and graphics. Similar to Etherpad, but focused on code evaluation for livecoding.

๐Ÿš€ Install

๐Ÿ˜Ž No need for installing! You can start coding immediately in the browser:

https://mercury.timohoogland.com/

๐Ÿ’ป Running without internet

๐Ÿค“ If you want to run the MercuryPlayground locally (for using without internet, or using the OSC-messages functionality, or when developing extra features) you can follow these steps:

๐Ÿ“– Documentation

Full explanation of all the possibilities in Mercury:

NB: There are still some differences between the Mercury Playground and the Max8 version. If you find any discrepancies please report an issue

๐Ÿ’ป System Requirements

Any laptop/desktop that runs a chromium based browser like Chrome or Brave.

๐ŸŽต Sounds

Most of the sounds in Mercury are from freesound.org and are licensed with Creative Commons Attribution or Creative Commons 0 licenses. If not downloaded from freesound it is made sure that the license allows you to redistribute the sounds via the Mercury environment and that you can use them in your projects. All the sounds are listed below with their original source, license and credits.

Use your own sounds

โšก๏ธ Visuals

You can load Hydra visuals by pasting the code in the textarea below the Editor. Removing the code will disable the visual rendering. Hydra is a Live coding visual synthesizer developed Olivia Jack.

The Mercury playground in the browser

Visual "Pixelscape" by Marianne Teixido

You can also code a small Hydra snippet inside the visual() function. This function can be added to a specific instrument and is evaluated upon triggering of the instrument. Please see tutorial 601 on the mercury playground site.

๐Ÿ‘พ Made with Mercury

Made something with Mercury? Please add a URL here and send a pull request! ๐Ÿ˜Ž

See the full list here

Small selection

๐Ÿ“ Contribute

Contributions to the Mercury environment are much appreciated in whatever form they come! You can contribute in any many ways!

Please follow the steps here

๐Ÿ”‹ Powered By

๐Ÿ™ Thanks

โœจ Inspiration

During the development of Mercury (both the playground and the full version) I've found inspiration in many other live coding environments, practices and platforms. Some of these are:

๐Ÿ“„ Licenses

THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.