TRY ONLINE ↗
BYTEBED
Bytebed

Embedded Bytebeats

Bytebed is a bytebeat virtual machine designed for embedded microcontrollers like the M5Stack Cardputer. It compiles bytebeat to bytecode and evaluates bytebeat functions on the fly.

Dual syntax

The engine supports the classic C-style and stack-based notation for playing the bytebeat. All single expressions follow the common notation. Infix and postfix syntax be mirrored between standard C-like and stack-based notation (using TAB key).

INFIX (C-style) t * (t >> 8 | t >> 11) a = 3, b = 6; t >> a | t >> b f = (n) => {n*t}; f(1)
POSTFIX (Stack-based) t t 8 >> t 11 >> | * 3 a = 6 b = t a >> t b >> | (n) { n t * } f = 1 f

Floatbeat support

Bytebeat aims to support around 80% of the commonly used Javascript syntax, with some opionated exceptions. Since bytebed is a dual syntax (infix & postfix) language, some tradeoffs exists. Users are encouraged to use map and reduce by not supporting while and for loops. Only arrow functions and ternary clauses are supported. Arrays are cyclic by design and characters return base62 values directly (0-Z).

Cardputer support

Bytebeat bytecode virtual machine support running complex bytebeat & floatbeat functions live with the M5Stack cardputers. Bytebed is targeted for M5Stack ESP32 cardputers only (at least for now) for easy & fun experience. Support playing bytebeat live with our friends by syncing with multiple cardputers using ESP-NOW protocol. Also works as a programmable MIDI synth using USB-MIDI.

How to use?

Install from M5Burner or Compile the source and flash to cardputer using platform.io

Dont have cardputer?

If you are eager to try, you can also run the bytebed compiler emulator in the browser.