- Install pre-packaged toolchain
apt install avr-libc binutils-avr gcc-avr
- Download and unpack gcc (e.g. https://mirror.sunred.org/archlinux/extra/os/x86_64/avr-gcc-14.1.0-1-x86_64.pkg.tar.zst)
- Build gcc
cd gcc-14.1.0 mkdir objdir
cd objdir
env/ |
apt install avr-libc binutils-avr gcc-avr
cd gcc-14.1.0
mkdir objdir
cd objdir
// An attempt at implementing [heapless vectors](https://docs.rs/heapless/latest/heapless/struct.Vec.html) | |
// in C | |
typedef struct { | |
size_t length; | |
const size_t size; | |
const size_t capacity; | |
uint8_t contents[0]; | |
} vec_t; |
Async/Await
in Rustimport("stdfaust.lib"); | |
pulse(ms, d) = ba.pulsen((ma.SR * d) / 1000.0, (ma.SR * ms) / 1000.0); | |
metro(ms) = ba.pulse((ma.SR * ms) / 1000); | |
phs(f) = +(1)~_ :%(44100/f): /(44100/f): -(0.5); | |
bpm = 60; | |
fourth_time = ba.tempo(bpm); | |
fourth_note = ba.pulse(1 * fourth_time); | |
half_note = ba.pulse(2 * fourth_time); |