6 changed files with 32 additions and 25 deletions
			
			
		| @ -1,15 +1,23 @@ | |||
| 
 | |||
| void playPattern(int *timer, int duration, int *step) { | |||
| void playPattern(int *timer, int duration) { | |||
|   *timer = *timer >= duration ? 0 : *timer+1; | |||
|   usleep(1000); | |||
| 
 | |||
|   if(*timer == 0) { | |||
|     drawRects(*step-1); | |||
|     drawRects(step-1); | |||
|     for(int i=0; i<matrix[0]; i++) { | |||
|       if(pattern[i][*step-1] == 1) { | |||
|       if(pattern[i][step-1] == 1) { | |||
|         Mix_PlayChannel(-1, samples[i], 0); | |||
|       } | |||
|     } | |||
|     *step = *step < matrix[1] ? *step+1 : 1; | |||
| 
 | |||
|     step = step < matrix[1] ? step+1 : 1; | |||
| 
 | |||
|     if(setErease && step == 1) { | |||
|       for(int i=0; i<matrix[1]; i++) { | |||
|         pattern[ereaseSample-1][i] = 0; | |||
|       } | |||
|       setErease = false; | |||
|     } | |||
|   } | |||
| } | |||
|  | |||
								
									Binary file not shown.
								
							
						
					
					Loading…
					
					
				
		Reference in new issue