Tracker
Posted: Tue Aug 12, 2014 5:10 pm
Today I've been starting to work on the tracker. Java is new to me so I don't progress really fast, yet I already have something working. It's still in early development so all it can do for now is composing and encoding patterns. I did that first as it allows you to make sound effects for your Games.
To understand how the sound library works you can read the Sound wiki page.
Copy and paste the generated code to the beginning of your Arduino Sketch.
To play a pattern named myPattern, use the following at any point of your program.
Code Example
This example plays myPattern when the button A is pressed
Download
GitHub repo
Download ZIP
TODO
* save and open
* instruments, tracks
* audio playback
To understand how the sound library works you can read the Sound wiki page.
Copy and paste the generated code to the beginning of your Arduino Sketch.
To play a pattern named myPattern, use the following at any point of your program.
- Code: Select all
gb.sound.playPattern(myPattern, 0);
Code Example
This example plays myPattern when the button A is pressed
- Code: Select all
#include <SPI.h>
#include <Gamebuino.h>
Gamebuino gb;
const uint16_t myPattern[] PROGMEM = {0x0005,0x3089,0x208,0x238,0x7849,0x1468,0x0000};
void setup(){
gb.begin();
gb.titleScreen(F("playPattern Example"));
}
void loop(){
if(gb.update()){
gb.display.println(F("Press \25 to play");
if(gb.buttons.pressed(BTN_A)){
gb.sound.playPattern(myPattern, 0);
}
if(gb.buttons.pressed(BTN_C)){
gb.titleScreen(F("playPattern Example"));
}
}
}
Download
GitHub repo
Download ZIP
TODO
* save and open
* instruments, tracks
* audio playback