no antialiasing, plays midi notes
This commit is contained in:
parent
70b588f7f5
commit
8661286e79
@ -28,6 +28,19 @@ Sonnenlicht::Sonnenlicht() : Plugin(kParameterCount, 0, 0), fSampleRate(getSampl
|
||||
|
||||
void Sonnenlicht::run(const float**, float** outputs, uint32_t frames,
|
||||
const MidiEvent* midiEvents, uint32_t midiEventCount) {
|
||||
|
||||
if (midiEventCount > 0) {
|
||||
for (uint32_t i=0; i < midiEventCount; i++ ) {
|
||||
const uint8_t *data = midiEvents[i].data;
|
||||
const uint8_t status = data[0] & 0xf0;
|
||||
|
||||
|
||||
if (status == 0x90) {
|
||||
w = (261.6 * (powf(2, (data[1]-60)/12.0f)))/fSampleRate;
|
||||
printf("set w to %f\n", w);
|
||||
}
|
||||
}
|
||||
}
|
||||
for (uint32_t i = 0; i < frames; i++) {
|
||||
phase += w;
|
||||
if (phase > 1) phase -= 1;
|
||||
|
Loading…
Reference in New Issue
Block a user