Skip to content

Commit

Permalink
∫˚
Browse files Browse the repository at this point in the history
  • Loading branch information
Volvox committed May 12, 2012
1 parent baf9346 commit e6b2ae8
Show file tree
Hide file tree
Showing 2 changed files with 41 additions and 8 deletions.
13 changes: 7 additions & 6 deletions src/Sequencer.java
Expand Up @@ -29,7 +29,6 @@ public static void main(String args[]){
new Sequencer().buildGUI();
}


//================================================================================ boring GUI stuff
public void buildGUI(){
theFrame = new JFrame("Cordialatron");
Expand Down Expand Up @@ -130,16 +129,18 @@ public void xyloTuner() {



/*for all 8 beats of this note, send to method will compile and play the entire array
needs to loop through list and set key = index */
/*for all 8 beats of this note, compile the entire array
** needs to loop through list and set key = index */

SongData noteBeats = new SongData(noteList, key);
//TODO: melody.Play() method
//TODO: song looping?
melody.makeTrack(noteList);

} //close outer loop
}

//TODO: melody.Play() method — need to figure out how to set .start() actionListener
//TODO: song looping?

}

//================================================================================ ActionListeners
public class StartListener implements ActionListener {
Expand Down
36 changes: 34 additions & 2 deletions src/SongData.java
Expand Up @@ -4,8 +4,8 @@ public class SongData {
boolean play = false;

//================================================================================ fields
private int _maxRows; // Number of rows. Set in constructor.
private final int _maxCols = 8; // Number of columns. Only 8 notes on xylophone
private int _maxRows = 8; // Number of rows. Set in constructor.
private final int _maxCols = 8; // Number of columns. Only 8 notes on xylophone

//notes
private int c;
Expand Down Expand Up @@ -96,6 +96,38 @@ public int noteOn(int x, int y, int[][] currentGrid) {






int row = 0;
//TODO: Make sure this is in the right place

//================================================================================ makeTrack
public void makeTrack(int[] notesList){
//makes each row a different note to compile an entire track
int i;

int[][] noteGrid = new int[8][8];
for(i = 0; i < notesList.length; i++){

// fill with note data for every beat
noteGrid[row][i] = notesList[i];
row+=1;
}
rollTune(noteGrid);
}

//================================================================================ rollTune
public void rollTune(int[][] noteGrid){
int r,c;

for(r = 0; r < noteGrid.length; r++){
for(c = 0; c < noteGrid[r].length; c++){
//trigger or rest solenoid at [r][c]
}

}
}
//================================================================================ getters&setters
public int getF() {
return F;
Expand Down

0 comments on commit e6b2ae8

Please sign in to comment.