Skip to content

Instantly share code, notes, and snippets.

View akohlsmith's full-sized avatar

Andrew Kohlsmith akohlsmith

View GitHub Profile
#include <stdio.h>
#include <stdint.h>
#define NOTE(tone, dur) ((((((uint8_t)(dur)) & 0x07)<<5) | (((uint8_t)(tone)) & 0x1F)))
#define GET_TONE(note) ((note) & 0x1F)
#define GET_DURATION(note) (((note)>>5) & 0x07)
#define END_MARKER 0XFF
#define READ_BIT(byte, bit) ((byte & (1 << bit)) >> bit)
enum {