π Getting Started
Hello, World! Welcome to the Getting Started guide for Mercury. This page will get you up and running in no time! But, before we get started it is good to know that Mercury has 2 versions:
- MercuryPlayground, running in the browser (Windows/Mac/Linux)
- Mercury4Max, running in Cycling'74's Max9 (Windows/Mac/Experimental Linux via Wine)
I recommend to use the MercuryPlayground (in the browser) first. Please read further in chapter MercuryPlayground.
If you have experience with MaxMSP you can also use Mercury4Max. Please read the chapter Mercury4Max for further instructions.
π MercuryPlaygroundβ
The MercuryPlayground runs directly in the browser using WebAudio and WebMIDI technologies based on the JavaScript WebAudioAPI and the ToneJS framework. This makes it very accessible for everyone, no matter if you're a beginner or an expert.
-
Install a Chromium based browser on your computer (for example Chrome, Brave, Arc, Opera)
-
You can start coding immediately: https://mercury-playground.cc/
-
Wait till the sounds are loaded (depending on your internet speed this could take some time)
-
You are now ready to start coding your first sounds or follow the tutorials! πΆπ»πΆ
π 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 use the steps below. This requires some Terminal (Mac/Linux) or Command Prompt (Win) knowledge. If you've never used the Terminal or Command Prompt before I recommend you search for some basic tutorial on Google/Youtube first.
-
Make sure you have Git and NodeJS installed for your Operating System.
-
In the Terminal (Mac/Linux) or Command Prompt (Win) navigate to the folder where you want to install Mercury (do this with
cd).- Then run:
git clone http://github.com/tmhglnd/mercury-playground
- Then run:
-
Navigate to the cloned folder with:
cd mercury-playground -
Install all the dependencies:
npm install -
Build your local version:
npm run build(ornpm run watchwhile developing)-
You can add your own samples to
/public/assets/samples -
When you added samples make sure you
npm run buildagain
-
-
Now start the local server:
npm start, open a browser and go tohttp://localhost:8080.Once connected the Terminal will print something like:
Connected yH0SGEdRHbZD1IACAAAB
Receive messages from Mercury on port 2440
Send messages to Mercury on port 4880Mercury can now receive OSC-messages on port
4880(the portnumber is chosen to not interfere with many other default portnumbers. The number is the diameter in kilometers of the planet Mercury) -
You are now ready to start coding your first sounds or follow the tutorials! πΆπ»πΆ
π» Mercury4Maxβ
Mercury also runs in Max8/9 (a.k.a. MaxMSP), a node-based creative coding environment from Cycling'74 for MacOS or Windows. Linux users can try the Experimental Linux Guide, but I recommend using the Mercury Playground first.
π System Requirementsβ
Check the system requirements on the download page from Cycling'74. The requirements are recommended for running Max and Mercury on your computer properly. A dedicated Graphics Card (GPU) is also recommended, for running visuals of Mercury and the text-editor smoothly. If you don't have a good GPU you can also use the external text-editor package for Pulsar. Instructions for using that are in External Editors.
βοΈ Install Mercuryβ
-
Download and install Max for your Operating System at https://cycling74.com/downloads
-
Launch Max. It will create a
Max 9folder in your~/Documents. Create an empty folder namedProjectsinside~/Documents/Max 9/. The full path should look like this:<User>/Documents/Max 9/Projects(on Mac). -
Download the latest version of Mercury here. Unzip the entire folder in
~/Documents/Max 9/Projects.- Or Git-users can clone Mercury with
git clone http://github.com/tmhglnd/mercury.
- Or Git-users can clone Mercury with
-
Your filepath should look something like:
<User>/Documents/Max 9/Projects/mercury-v.x.x.x -
Optional: install the Pulsar editor and the mercury-pulsar package.
π Launch Mercury4Maxβ
Launch Mercury by double clicking mercury_ide.maxproj located in the folder mercury-v.x.x.x/mercury-ide.
- β³ Give it some time to load.
- Mac Users: You may need to give some permissions under Security & Privacy Preferences. Please be on the lookout for any messages popping up.
Once it's ready you will see two windows:
- The
_mercury_mainwindow - The
mercurywindow (still black).
The main window is used to quickly access the most important settings in Mercury, such as audio on/off. The mercury window is used to display the text-editor.
- π Turn the Audio on
- πΊ Turn the Rendering on (or use an external editor like Pulsar)
You are now ready to start coding your first sounds! πΆπ»πΆ
πΉ Play a first sound!β
After going to the website or following any of the installation steps you are now ready to make the first sound! In the code editor you can type the following code (if there is already some code there you can backspace it or click empty):
set tempo 110
new sample kick_house time(1/4)
new sample hat_808 time(1/8)
Now click play (browser), Menubar > File > Execute Code (Max8) or hit ctrl/alt + enter to evaluate the code. If all goes well you should hear the sound of a kick go 4 times, while the hihat sound goes 8 times (2x as fast).
If you experience any issues, please see the
What's next?β
You are now ready to play all you want! For example you can listen some random examples or follow the tutorials. You can read the Usage chapter for more info on how to navigate the environment and you can read the Reference for explanation of all the functions. For Max users I also recommended following the interactive tutorials in the MercuryPlayground before continuing in Max.