Browse Source

select pattern

develop^2
Carmine De Rosa 5 years ago
parent
commit
5f5cc13efb
  1. 4
      C/inputs.cpp
  2. 3
      C/main.cpp
  3. 3
      C/players.cpp
  4. BIN
      C/sonquencer
  5. 22
      README.md

4
C/inputs.cpp

@ -20,6 +20,10 @@ void inputActions(SDL_Event e) {
case SDLK_e: case SDLK_e:
setErease = true; setErease = true;
break; break;
case SDLK_o:
selectPattern = true;
break;
default: default:
break; break;
} }

3
C/main.cpp

@ -20,11 +20,12 @@ int pattern[PATTERN_ROWS][PATTERN_COLS];
int matrix[] = {PATTERN_ROWS, PATTERN_COLS}; int matrix[] = {PATTERN_ROWS, PATTERN_COLS};
bool play = false; bool play = false;
bool setErease = false; bool setErease = false;
bool selectPattern = false;
int step = 0; int step = 0;
#include "draw.cpp" #include "draw.cpp"
#include "players.cpp"
#include "loaders.cpp" #include "loaders.cpp"
#include "players.cpp"
#include "inputs.cpp" #include "inputs.cpp"
#include "actions.cpp" #include "actions.cpp"

3
C/players.cpp

@ -20,6 +20,9 @@ void setSample(int sample, int step) {
pattern[sample-1][i] = 0; pattern[sample-1][i] = 0;
} }
setErease = false; setErease = false;
} else if(selectPattern) {
loadPattern(sample);
selectPattern = false;
} else { } else {
pattern[sample-1][step-1] = 1; pattern[sample-1][step-1] = 1;
for(int i=0; i<matrix[0]; i++) { for(int i=0; i<matrix[0]; i++) {

BIN
C/sonquencer

Binary file not shown.

22
README.md

@ -2,15 +2,15 @@
#### Keys (C version) #### Keys (C version)
| Key | | |
| ---- | ------------- | ---------------------------------------- |
| 1 | Play sample 1 | Set the sample when sequencer is playing |
| 2 | Play sample 2 | Set the sample when sequencer is playing |
| 3 | Play sample 3 | Set the sample when sequencer is playing |
| 4 | Play sample 4 | Set the sample when sequencer is playing |
| P | Play/Stop | Play/Stop Sequencer |
| | | |
| | | |
| | | |
| | | |
| Key | Key + | Action | Description |
| ------- | ------- | ------------- | ---------------------------------------- |
| 1,2,3,4 | | Play sample n | Set the sample when sequencer is playing |
| P | | Play/Stop | Play/Stop Sequencer |
| E | 1,2,3,4 | Erease | Erease the sample line |
| | | | |
| | | | |
| | | | |
| | | | |
| | | | |
| | | | |

Loading…
Cancel
Save