zynaddsubfx

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

commit 396c91934a82a233bd69de81c1bdb31ce97b3ed4
parent 1cd9b968631e6e19201f7b3a2440440bca4d32e5
Author: paulnasca <paulnasca>
Date:   Thu, 17 Feb 2005 16:33:36 +0000

*** empty log message ***

Diffstat:
MChangeLog | 2+-
Msrc/Input/ALSAMidiIn.C | 4+++-
Msrc/Params/PADnoteParameters.C | 2+-
Msrc/Synth/PADnote.C | 16++++++++--------
4 files changed, 13 insertions(+), 11 deletions(-)

diff --git a/ChangeLog b/ChangeLog @@ -761,7 +761,7 @@ 12 Feb 2005 - Controllerul prestabilit la Virtual Keyboard este Filter Cutoff in loc de BandWidth - Modificate cateva preseturi la DynamicFilter - Adaugata posibilitatea de a mari sau micsora cu un parametru detune-ul vocilor de la ADnote - +17 Feb 2005 - Corectate cateva erori la PADsynth care faceau ca sa se citeasca date din zone de memorie nealocata \ No newline at end of file diff --git a/src/Input/ALSAMidiIn.C b/src/Input/ALSAMidiIn.C @@ -30,6 +30,8 @@ ALSAMidiIn::ALSAMidiIn(){ inputok=0; char portname[50]; sprintf(portname,"ZynAddSubFX"); + + midi_handle=NULL; if (snd_seq_open(&midi_handle,"default",SND_SEQ_OPEN_INPUT,0)!=0) return; @@ -52,7 +54,7 @@ ALSAMidiIn::~ALSAMidiIn(){ * Get the midi command,channel and parameters */ void ALSAMidiIn::getmidicmd(MidiCmdType &cmdtype,unsigned char &cmdchan,int *cmdparams){ - snd_seq_event_t *midievent; + snd_seq_event_t *midievent=NULL; cmdtype=MidiNull; if (inputok==0){ diff --git a/src/Params/PADnoteParameters.C b/src/Params/PADnoteParameters.C @@ -480,7 +480,7 @@ void PADnoteParameters::applyparameters(bool lockmutex){ if (Pmode==0) generatespectrum_bandwidthMode(spectrum,spectrumsize,basefreq*basefreqadjust,profile,profilesize,bwadjust); else generatespectrum_otherModes(spectrum,spectrumsize,basefreq*basefreqadjust,profile,profilesize,bwadjust); - const int extra_samples=3;//the last samples contains the first samples (used for linear/cubic interpolation) + const int extra_samples=5;//the last samples contains the first samples (used for linear/cubic interpolation) newsample.smp=new REALTYPE[samplesize+extra_samples]; newsample.smp[0]=0.0; diff --git a/src/Synth/PADnote.C b/src/Synth/PADnote.C @@ -234,19 +234,19 @@ int PADnote::Compute_Cubic(REALTYPE *outl,REALTYPE *outr,int freqhi,REALTYPE fre //left - xm1=smps[poshi_l - 1]; - x0=smps[poshi_l + 0]; - x1=smps[poshi_l + 1]; - x2=smps[poshi_l + 2]; + xm1=smps[poshi_l]; + x0=smps[poshi_l + 1]; + x1=smps[poshi_l + 2]; + x2=smps[poshi_l + 3]; a = (3.0 * (x0-x1) - xm1 + x2)*0.5; b = 2.0*x1 + xm1 - (5.0*x0 + x2)*0.5; c = (x1 - xm1)*0.5; outl[i] = (((a * poslo) + b) * poslo + c) * poslo + x0; //right - xm1=smps[poshi_r - 1]; - x0=smps[poshi_r + 0]; - x1=smps[poshi_r + 1]; - x2=smps[poshi_r + 2]; + xm1=smps[poshi_r]; + x0=smps[poshi_r + 1]; + x1=smps[poshi_r + 2]; + x2=smps[poshi_r + 3]; a = (3.0 * (x0-x1) - xm1 + x2)*0.5; b = 2.0*x1 + xm1 - (5.0*x0 + x2)*0.5; c = (x1 - xm1)*0.5;