zynaddsubfx

ZynAddSubFX open source synthesizer
Log | Files | Refs | Submodules | LICENSE

commit d64ef063be5c1206aa508011b2ed151254cf1f59
parent f1f96e56352448e0fb05f7b9a2c0d4957b4a8fad
Author: fundamental <[email protected]>
Date:   Thu,  9 Jun 2016 13:40:17 -0400

OscilGen: Add Workaround For Waveform View

Changing the phase of an oscillator forces an
update of the waveform view

Diffstat:
Msrc/Synth/OscilGen.cpp | 17++++++++++++++---
1 file changed, 14 insertions(+), 3 deletions(-)

diff --git a/src/Synth/OscilGen.cpp b/src/Synth/OscilGen.cpp @@ -91,9 +91,20 @@ const rtosc::Ports OscilGen::non_realtime_ports = { while(*mm && !isdigit(*mm)) ++mm; unsigned char &phase = ((OscilGen*)d.obj)->Phphase[atoi(mm)]; if(!rtosc_narguments(m)) - d.reply(d.loc, "c", phase); - else + d.reply(d.loc, "i", phase); + else { phase = rtosc_argument(m,0).i; + //XXX hack hack + char *repath = strdup(d.loc); + char *edit = rindex(repath, '/')+1; + strcpy(edit, "prepare"); + OscilGen &o = *((OscilGen*)d.obj); + fft_t *data = new fft_t[o.synth.oscilsize / 2]; + o.prepare(data); + // fprintf(stderr, "sending '%p' of fft data\n", data); + d.chain(repath, "b", sizeof(fft_t*), &data); + o.pendingfreqs = data; + } }}, //TODO update to rArray and test {"magnitude#128::c:i", rProp(parameter) rLinear(0,127) rDoc("Sets harmonic magnitude"), @@ -103,7 +114,7 @@ const rtosc::Ports OscilGen::non_realtime_ports = { while(*mm && !isdigit(*mm)) ++mm; unsigned char &mag = ((OscilGen*)d.obj)->Phmag[atoi(mm)]; if(!rtosc_narguments(m)) - d.reply(d.loc, "c", mag); + d.reply(d.loc, "i", mag); else { mag = rtosc_argument(m,0).i; //printf("setting magnitude\n\n");