diff options
Diffstat (limited to 'apps/plugins/midi/sequencer.c')
-rw-r--r-- | apps/plugins/midi/sequencer.c | 31 |
1 files changed, 26 insertions, 5 deletions
diff --git a/apps/plugins/midi/sequencer.c b/apps/plugins/midi/sequencer.c index f7c6f30376..836866a5df 100644 --- a/apps/plugins/midi/sequencer.c +++ b/apps/plugins/midi/sequencer.c | |||
@@ -88,9 +88,30 @@ void setPW(int ch, int msb) | |||
88 | 88 | ||
89 | void pressNote(int ch, int note, int vol) | 89 | void pressNote(int ch, int note, int vol) |
90 | { | 90 | { |
91 | /* | ||
92 | if(ch == 0) return; | ||
93 | // if(ch == 1) return; | ||
94 | if(ch == 2) return; | ||
95 | if(ch == 3) return; | ||
96 | if(ch == 4) return; | ||
97 | if(ch == 5) return; | ||
98 | if(ch == 6) return; | ||
99 | if(ch == 7) return; | ||
100 | if(ch == 8) return; | ||
101 | if(ch == 9) return; | ||
102 | if(ch == 10) return; | ||
103 | if(ch == 11) return; | ||
104 | if(ch == 12) return; | ||
105 | if(ch == 13) return; | ||
106 | if(ch == 14) return; | ||
107 | if(ch == 15) return; | ||
108 | */ | ||
91 | int a=0; | 109 | int a=0; |
92 | for(a=0; a<MAX_VOICES; a++) | 110 | for(a=0; a<MAX_VOICES; a++) |
93 | { | 111 | { |
112 | if(voices[a].ch == ch && voices[a].note == note) | ||
113 | break; | ||
114 | |||
94 | if(voices[a].isUsed==0) | 115 | if(voices[a].isUsed==0) |
95 | break; | 116 | break; |
96 | } | 117 | } |
@@ -107,7 +128,7 @@ void pressNote(int ch, int note, int vol) | |||
107 | voices[a].vol=vol; | 128 | voices[a].vol=vol; |
108 | voices[a].cp=0; | 129 | voices[a].cp=0; |
109 | voices[a].state=STATE_ATTACK; | 130 | voices[a].state=STATE_ATTACK; |
110 | voices[a].pstate=STATE_ATTACK; | 131 | // voices[a].pstate=STATE_ATTACK; |
111 | voices[a].decay=255; | 132 | voices[a].decay=255; |
112 | 133 | ||
113 | 134 | ||
@@ -170,15 +191,12 @@ void releaseNote(int ch, int note) | |||
170 | { | 191 | { |
171 | if(voices[a].ch == ch && voices[a].note == note) | 192 | if(voices[a].ch == ch && voices[a].note == note) |
172 | { | 193 | { |
173 | //voices[a].isUsed=0; | ||
174 | if((voices[a].wf->mode & 28)) | 194 | if((voices[a].wf->mode & 28)) |
175 | { | 195 | { |
176 | voices[a].tmp=40; | 196 | // voices[a].tmp=40; |
177 | // voices[a].state = STATE_RELEASE; //Ramp down | 197 | // voices[a].state = STATE_RELEASE; //Ramp down |
178 | 198 | ||
179 | // voices[a].state = STATE_RAMPDOWN; //Ramp down | 199 | // voices[a].state = STATE_RAMPDOWN; //Ramp down |
180 | |||
181 | // voices[a].isUsed = 0; | ||
182 | setPoint(&voices[a], 3); | 200 | setPoint(&voices[a], 3); |
183 | } | 201 | } |
184 | } | 202 | } |
@@ -281,6 +299,9 @@ int tick(struct MIDIfile * mf) | |||
281 | { | 299 | { |
282 | tempo = (((short)e->evData[0])<<16)|(((short)e->evData[1])<<8)|(e->evData[2]); | 300 | tempo = (((short)e->evData[0])<<16)|(((short)e->evData[1])<<8)|(e->evData[2]); |
283 | printf("\nMeta-Event: Tempo Set = %d", tempo); | 301 | printf("\nMeta-Event: Tempo Set = %d", tempo); |
302 | bpm=mf->div*1000000/tempo; | ||
303 | numberOfSamples=SAMPLE_RATE/bpm; | ||
304 | |||
284 | } | 305 | } |
285 | } | 306 | } |
286 | tr->delta = 0; | 307 | tr->delta = 0; |