Skip to content

Instantly share code, notes, and snippets.

@Jire
Created May 14, 2012 16:01
Show Gist options
  • Save Jire/2694734 to your computer and use it in GitHub Desktop.
Save Jire/2694734 to your computer and use it in GitHub Desktop.
Baudio V2 Prototype, uses 1 character (2 bytes) per "note" :), 100 bytes / 50 notes
public class Main {
private static final int instrument = 14;
private static final int delay = 15;
private static final int note = 200;
public static void main(String[] args) {
int box = ((instrument & 0xF) << 12) | ((delay & 0xF) << 8) | (note & 0xFF);
int u_instrument = (box >> 12) & 0xF;
int u_delay = (box >> 8) & 0xF;
int u_note = (box & 0xFF);
System.out.println("Box: " + ((char) (box & 0xFFF)) + ", Instrument: " + u_instrument + ", Delay: " + u_delay + ", Note: " + u_note);
}
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment