Created
May 14, 2012 16:07
-
-
Save Jire/2694782 to your computer and use it in GitHub Desktop.
Baudio V2 generation of fields, 100 notes = 100 characters, VERY small for 100 notes (standard 100 notes in WAV = over 300KB)
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 { | |
public static void main(String[] args) { | |
StringBuilder total = new StringBuilder(); | |
for (int i = 0; i < 100; i++) { | |
int instrument = i & 0xF; | |
int delay = i & 0xF; | |
int note = i; | |
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); | |
total.append((char) (box & 0xFFF)); | |
} | |
System.out.println("Track: " + total.toString()); | |
} | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment