Created
May 14, 2012 16:01
-
-
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
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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