Claudio Davi

GrainOS · GuidePortuguês

Getting started

This is the first part of the GrainOS guide. It is for a complete beginner. By the end you will have switched GrainOS on, heard it play, found your way around the screen, changed the volume and switched it off again.

You do not need to know any code. Every technical word is explained the first time it shows up.

The guide:

  1. Getting started (this page)
  2. Your first jam in TECHNO
  3. CHORD mode
  4. How-tos
  5. Advanced
  6. Reference

What GrainOS is

GrainOS is a small music instrument that lives on an SD card. You put the card in a Miyoo Mini Plus (a pocket game console), switch it on, and instead of games you get a music machine. It starts playing by itself.

There are two modes:

  • TECHNO is a groove machine. A beat, a bass and chords play on their own. You steer them: more energy, less energy, a different chord, a brighter sound, a stutter, a build-up and a drop. This is the mode GrainOS starts in.
  • CHORD is an instrument you play by hand. You hold a button and a chord sounds. Let go and it fades. You can colour the chords, add a soft beat and record a short loop on top.

GrainOS also runs on a PC and in a web browser (see Trying it on the PC or the web below). It is the same music engine and the same screen everywhere.

Two things to know early:

  • Nothing you play is saved. Every time you switch on, you start the same default jam. Only five menu settings are remembered: volume, latency, brightness, dim and mode. (The web version remembers nothing.)
  • GrainOS never touches the console’s own memory. The stock system is still there. Swap the card back and you have your games again.

What you need

  • A Miyoo Mini Plus.
  • An SD card that has GrainOS on it. If you have not made one yet, follow the card guide. It shows how to build and copy the card.
  • Headphones or a speaker. Turn the console volume down before you switch on.
  • A few minutes. The very first start runs a check that takes 1 to 2 minutes.

You can also try everything on a PC with a keyboard, or in a web browser, with no console at all.


First boot

  1. Switch the console off.
  2. Put the GrainOS card in the SD slot for games.
  3. Put your headphones in and turn the volume down.
  4. Switch on.

What you will see and hear

TimeWhat happens
0 to 5 secondsThe Miyoo start-up chime. The screen is black.
about 5 to 10 secondsThe screen lights up and says SELFTEST. Lines appear one by one.
about 1 minute (up to 2 is normal)The bottom line says “measuring… do not press anything yet”.
the last 30 secondsThe bottom line says “AUDIO TEST” with a counter. Now tap a few buttons.
thenA big result: SELFTEST PASS, WARN or FAIL.

What the self-test is

The self-test is a check-up. It looks at three things:

  • Is there enough memory, and is the screen fast enough?
  • Can the sound engine keep up, even in a busy groove?
  • Does the audio run smoothly, and how late does the console notice a button press?

That is why it asks you to tap buttons during the audio test. Do not hold MENU while you tap.

It also writes a text report to the card (report-1.txt, then report-2.txt and so on) and a log (grainos.log). If something ever goes wrong, those files are what you send back.

What the result means

  • PASS: all good.
  • WARN: it works, but one number was on the high side. This is normal on a first run. Carry on.
  • FAIL: a real problem was found. You can still carry on. Keep the report files.

The result screen reads A or START = start the jam. Press A or START.

The jam starts at once, and a groove is already playing. It is in the key of D, at 120 BPM. (BPM means “beats per minute”, the tempo.) The genre is DUB.

Good to know

  • The self-test runs by itself only on the first start of a new card. After that the card boots straight into the jam.
  • To run it again, open the menu and choose Device, then Run self-test (see The menu). Or delete the file grainos/first_boot_done on the card.
  • If a start ever gets stuck, GrainOS has safety nets. After two stuck starts in a row it switches to safe audio settings by itself (mono sound and a bigger buffer). That is on purpose, not a fault. The details are in 05-advanced and the card guide.

The screen

Here is the main screen, called the PLAY page, in TECHNO mode with the groove running.

The TECHNO PLAY page: header at the top, a step strip, energy stairs, part lights, a haze strip, four control rows and a footer.

Read it from top to bottom.

1. The header

The top rows tell you where you are.

  • Key and set, for example “D DUB”. The key is the home note of the music. The set is the family of chords you are playing from.
  • The mode, TECHNO or CHORD, in small letters.
  • BAR n. A bar is one measure: four beats. This counts the bars since you pressed play.
  • Eight small dots with “n/8”. Music here moves in phrases of 8 bars. The dots show which bar of the phrase you are in.
  • The tempo, for example “120 BPM”.
  • Below that, the big chord name, for example “Dm9”.
  • A row of badges (little labels): PLAY or STOPPED, and short notices such as THROW, FREEZE, STUTTER or BUILD when you use those moves. You will meet them in the next parts.

2. The step strip

This is the row of 16 boxes. Together they are one bar. Each box is a step, one sixteenth of the bar. The numbers 1 to 4 mark the beats. The step that is playing right now is lit.

Inside each box there are little marks. They show which instruments hit on that step (kick, snare or clap, hats, extra percussion, rim, chords and bass).

3. Energy, parts and haze

  • The energy stairs show how busy the groove is, from 0 to 7. More lit steps means more instruments are playing. You will use this a lot.
  • The part lights. A part is one instrument, for example the kick drum or the hats. There are 11 lights and each one flashes when its part plays.
  • The haze strip shows the last 8 seconds of sound as a wave. Haze is a soft cloud of tiny pieces of sound cut from that wave and played again. A line on the strip shows where the pieces are taken from.

4. Tabs and four control rows

Under the haze strip is a row of tabs. Each tab is a page, and the lit one is the page you are on. TECHNO has 13 pages:

PLAY, CHORDS, PARTS, KICK, HATS, CHORD, ARP, BASS, PAD, HAZE, FX, SONG, GROOVE

(The CHORD page here is the sound of the chord stabs. It is not the same as CHORD mode.)

Under the tabs are four rows. Each row is one control with a name, a bar and a value. For example, on the PLAY page the rows are FILTER, ENERGY, DJ FILTER and REV ALL.

The four rows are tied to the direction buttons:

PressChanges row
LEFT / RIGHTrow 1
UP / DOWNrow 2
hold L2, then LEFT / RIGHTrow 3
hold L2, then UP / DOWNrow 4

L2 is the “shift” button. Rows 3 and 4 light up while you hold it. Here is the ARP page with L2 held. Rows 3 and 4 (GATE and DRIFT) are lit.

The ARP page with L2 held: the third and fourth rows, GATE and DRIFT, are lit in yellow.

If you hold a direction, the value keeps moving. Stepped controls (a list of choices) step along. Smooth controls (a level, a filter) start slowly and speed up the longer you hold. Let go to stop.

At the bottom are a few lines of hints. They list the buttons that work on the page you are on. The very last grey line shows “MENU menu” and DSP n%. DSP is how hard the processor is working to make the sound. If it gets close to 100 %, the sound may crackle.

The hints always use the button names of the machine you are on. On the Miyoo you see “L2+START”. On a PC the same hint reads “Shift+Enter”. If you are ever unsure, open the Help screen (see below). It always shows the right names for the page you are on.


Buttons at a glance

Throughout this guide, buttons are written with the Miyoo name first, then the PC and web key in brackets, like this: R2 (PC: 2).

The key letters on a keyboard are not the same letters as the Miyoo buttons. The Miyoo A button is the key Z on a PC, and the Miyoo Y button is the key A. This is easy to mix up, so keep the table close.

Miyoo buttonPC / web key
UP, DOWN, LEFT, RIGHTarrow keys
AZ (or Space)
BX
XS
YA
L1Q
R1W
L2Shift (or 1)
R22
SELECTBackspace
STARTEnter
MENUEsc
VOL+ / VOL-= and -

On the Miyoo, the d-pad is on the left. A is on the right of the four face buttons, B at the bottom, X at the top and Y on the left. L1 and R1 are on the top edge, L2 and R2 are the shoulder triggers. SELECT, START and MENU run along the bottom. VOL+ and VOL- are on the side.

The buttons that always work

These do the same thing on every page, in both modes (SELECT has one exception, in the last row).

ButtonWhat it does
L1 / R1 (PC: Q / W)Go to the previous or next page. It wraps around.
MENU (PC: Esc), tapOpen or close the menu.
MENU (PC: Esc), hold 1 secondPower off (on the PC: quit).
VOL+ / VOL- (PC: = / -)Master volume up or down, 5 % at a time.
L2 (PC: Shift)The “shift” button. Hold it with another button for that button’s second job.
L2 + L1 / R1Change the genre (TECHNO) or the chord set (CHORD).
START (PC: Enter)Play and stop (TECHNO), or beat on and off (CHORD).
SELECT (PC: Backspace)Next chord style. In TECHNO on the PARTS page it switches the selected part on or off instead.

Everything else depends on the mode and the page. 02-first-jam-techno and 03-chord-mode walk you through them, and 06-reference lists them all.


The menu

Tap MENU (PC: Esc) to open the menu. The music keeps playing underneath.

The Miyoo menu in TECHNO mode: rows from Resume down to Help.

Moving around

ButtonIn the menu
UP / DOWNMove between rows. It wraps around.
LEFT / RIGHTChange the value of a row. Hold to repeat.
A (PC: Z)Choose the row. On a value row it steps the value up by one.
B (PC: X)Go back. From the top level it closes the menu.
MENUClose the menu.

While the menu is open, your button presses go to the menu and not to the music. Nothing gets stuck: if you were holding a button when you opened the menu, letting go still works.

The rows

This is the Miyoo menu in TECHNO mode, top to bottom. The screen shows 11 rows at a time, so you scroll with DOWN to see the rest.

RowWhat it does
ResumeClose the menu.
New jamStart over with the defaults. It asks first (A = yes, B = no). It happens on the next bar line, and your volume stays.
Surprise meA fresh, safe random setup: a new key, chord set, tempo and so on. It asks first. TECHNO only.
Roll grooveMake a small variation of the drum pattern on the next bar line. TECHNO only.
Undo rollGo back one roll, on the next bar line. TECHNO only.
ModeLEFT / RIGHT to switch between TECHNO and CHORD.
VolumeLEFT / RIGHT in 5 % steps.
LatencySAFE, NORMAL or LOW. See below. Miyoo only.
Brightness1 to 10. Miyoo only.
Dim when idleOFF, 30 s or 2 min. Miyoo only.
SamplesOnly shows up if you put WAV files on the card. Picks the sound source for the haze.
HelpOpens the Help screen for the page you were on.
DeviceBattery, DSP load, build, self-test and safe mode. Miyoo only.
Power offAsks first, then switches the console off. Miyoo only.

In CHORD mode the menu is shorter. It has no Surprise me, Roll groove or Undo roll.

The Miyoo menu while in CHORD mode: no Surprise me, Roll groove or Undo roll rows.

A few of these need more words.

Mode. Switching mode fades the sound out for about half a second, changes in silence, and fades back in. Each mode remembers its own settings for the session. Go to CHORD and back, and TECHNO is as you left it. The mode you leave on is also what you get at the next power-on.

Latency. Latency is the small delay between pressing a button and hearing the result. A smaller delay feels tighter but is more likely to crackle.

  • SAFE: biggest buffer (60 ms). Safest sound.
  • NORMAL: the default (25 ms).
  • LOW: smallest buffer (12 ms). Tightest feel, most risk of crackle.

A change applies after a restart. The menu says so in red.

Brightness. The screen backlight, 1 to 10. It shows ”—” until you touch it.

Dim when idle. After 30 seconds or 2 minutes with no button press, the screen dims. The first press only wakes it and is not passed to the music.

Samples. The row appears only when GrainOS found WAV files on the card at start-up. Pick LIVE (the sound the engine makes itself) or one of your files to feed the haze. 04-how-to shows how to load samples.

The Help screen

Choose Help and you get a short manual for the page you were on. It lists the page’s four rows and the buttons that work there, with the right button names for your machine. LEFT / RIGHT shows the other pages. B goes back.

The Help screen for the PLAY page: the four rows, then the buttons that work there.

The Device screen (Miyoo only)

The Device screen: battery, DSP load, build, run self-test, safe mode.

LineMeaning
BatteryCharge in percent. A question mark if it is unknown.
DSP loadHow busy the sound engine is, in percent.
BuildThe version of GrainOS on the card.
Run self-testPress A to run the check-up again. When it is done you go back to the jam.
Safe modeON or OFF. Changes after a restart. Use ON if the sound keeps crackling or the console will not start.

Volume

Use VOL+ and VOL- (PC: = and -) at any time. Each press moves the volume 5 %. It works even while the menu is open. You can also set it in the menu under Volume.

Notes:

  • The default is 70 %.
  • GrainOS saves your volume a moment after you stop moving it, so the next start uses it.
  • This is the GrainOS master level. The console also has its own hardware volume, which GrainOS sets once at start-up. Use the VOL buttons and you do not need to think about it.

Powering off

There are two ways.

Hold MENU for 1 second. You can do this at any time, in any mode. A yellow bar fills along the bottom of the screen, the sound fades out, the screen says “POWERING OFF…”, and a moment later the console switches off. It closes the SD card properly first.

Or use the menu. Open it, go to Power off and press A. It asks first. A means yes, B means no.

Please always switch off this way. Do not pull the card out, or hold the power button, while the console is on. If the console is frozen and nothing else works, hold its physical power button for about 10 seconds.

If a crash happens, GrainOS restarts itself up to three times. If it keeps failing, it powers the console off so you are not stuck.


Trying it on the PC or the web

You do not need the console to learn GrainOS. The keys are the PC column in the table above.

On a PC

You build and start it from a terminal in the project folder:

make proto    # build it once
make run      # play

It needs the SDL2 runtime library installed. A window opens and the groove starts.

Differences from the Miyoo:

  • The menu has Quit instead of Power off. There are no Latency, Brightness, Dim when idle or Device rows.
  • Esc taps open the menu. Holding Esc for 1 second quits.
  • Settings are saved in the folder you started it from.
  • Samples go in a samples folder next to where you start it.
  • The screen prints PC key names, for example “Shift+Enter”.

On the web

Open claudiodavi.com/grainos/. Nothing happens until you click Start. Use headphones.

  • The keys are the same as on the PC. Click the player first so it has focus. The keyboard only works while the player is selected.
  • A gamepad works too, if your browser sees it as a standard gamepad.
  • If you see on-screen buttons, they are the Miyoo buttons.
  • The web version has no samples, no Latency, Brightness, Dim, Device, Power off or Quit rows.
  • Esc only opens and closes the menu. Holding it does nothing.
  • Nothing is saved. Reload the page and you are back to the defaults.
  • On an iPhone, the silent switch mutes web audio.

Everything about TECHNO and CHORD is the same as on the console, including the loop recorder.


Quick recap

  • Switch on, wait for the self-test on the first start, press A or START.
  • The groove plays by itself. Look at the header, the step strip, the energy stairs and the four rows.
  • L1 / R1 change page. L2 is the shift button for the second pair of rows.
  • Tap MENU for the menu. Hold MENU for 1 second to power off.
  • VOL+ / VOL- change the volume.
  • Nothing you play is saved. The menu settings are.

Next: your first jam

Now you know your way around. Next, you will actually play. Go to 2. Your first jam in TECHNO. You will change the energy and the filter, pick chords, throw an echo and build up to a drop.