zynaddsubfx

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

commit a4d431e32d937825048fb6a0b2a29c0fa40fe5d2
parent 119169949485d04143258d1f45c4431282d9625e
Author: paulnasca <paulnasca>
Date:   Sat, 28 Feb 2004 13:08:58 +0000

*** empty log message ***

Diffstat:
MChangeLog | 2+-
Msrc/Effects/Chorus.C | 2+-
Msrc/Effects/EffectMgr.C | 2+-
Msrc/Effects/Reverb.C | 2+-
Msrc/Input/WINMidiIn.C | 1-
Msrc/Makefile | 2+-
Msrc/Misc/Bank.C | 3---
Msrc/Misc/Config.C | 2+-
Msrc/Misc/Dump.C | 2+-
Msrc/Misc/Part.C | 4++--
Msrc/Params/FilterParams.C | 4++--
Msrc/Synth/OscilGen.C | 5++---
Msrc/UI/EnvelopeUI.fl | 7+++----
Msrc/UI/FilterUI.fl | 2+-
Msrc/UI/MasterUI.fl | 4++--
Msrc/UI/PartUI.fl | 2+-
Msrc/main.C | 37++++++++++++++++++-------------------
17 files changed, 38 insertions(+), 45 deletions(-)

diff --git a/ChangeLog b/ChangeLog @@ -545,6 +545,6 @@ 24 Feb 2004 - Continuat la Bank 25 Feb 2004 - La Bank - inceput sa scriu partea ca sa arate instrumentele din banca 26 Feb 2004 - Continuat la Bank -27 Feb 2004 - Corectate erori la snprintf ( nu dadeam parametru "%s" inainte de string si daca acel string continea ceva %, era periculos) +27 Feb 2004 - Corectate erori la snprintf ( nu dadeam parametru "%s" inainte de string si daca acel string continea ceva %, era periculos) si alte erori diff --git a/src/Effects/Chorus.C b/src/Effects/Chorus.C @@ -58,7 +58,7 @@ REALTYPE Chorus::getdelay(REALTYPE xlfo){ //check if it is too big delay(caused bu errornous setdelay() and setdepth() if ((result+0.5)>=maxdelay) { - fprintf(stderr,"WARNING: Chorus.C::getdelay(..) too big delay (see setdelay and setdepth funcs.)\n"); + fprintf(stderr,"%s","WARNING: Chorus.C::getdelay(..) too big delay (see setdelay and setdepth funcs.)\n"); result=maxdelay-1.0; }; return(result); diff --git a/src/Effects/EffectMgr.C b/src/Effects/EffectMgr.C @@ -192,7 +192,7 @@ void EffectMgr::saveloadbuf(Buffer *buf){ unsigned char npar,p,n,tmp; #ifdef DEBUG_BUFFER - fprintf(stderr,"\n( EffectPparameters) \n"); + fprintf(stderr,"%s","\n( EffectPparameters) \n"); #endif tmp=0xfe; diff --git a/src/Effects/Reverb.C b/src/Effects/Reverb.C @@ -108,7 +108,7 @@ void Reverb::cleanup(){ */ void Reverb::processmono(int ch,REALTYPE *output){ int i,j; - REALTYPE out,fbout,tmp; + REALTYPE fbout,tmp; //TODO: implement the high part from lohidamp for (j=REV_COMBS*ch;j<REV_COMBS*(ch+1);j++){ diff --git a/src/Input/WINMidiIn.C b/src/Input/WINMidiIn.C @@ -61,7 +61,6 @@ void CALLBACK WinMidiInProc(HMIDIIN hMidiIn,UINT wMsg,DWORD dwInstance, break; case(0xe)://pitch wheel tmp=par1+par2*(long int) 128; - printf("%d\n",tmp); winmaster->SetController(cmdchan,C_pitchwheel,tmp); break; default:break; diff --git a/src/Makefile b/src/Makefile @@ -3,7 +3,7 @@ include Makefile.inc ifneq ($(MAKECMDGOALS),debug) CXXFLAGS= -O6 else - CXXFLAGS= -O0 -ggdb + CXXFLAGS= -O0 -ggdb -Wall -Wpointer-arith -Wstrict-prototypes endif CXXFLAGS += -DOS_$(OS_PORT) -D$(MIDIIN)MIDIIN -D$(AUDIOOUT)AUDIOOUT -DFFTW_VERSION_$(FFTW_VERSION) -DASM_F2I_$(ASM_F2I) `fltk-config --cflags` diff --git a/src/Misc/Bank.C b/src/Misc/Bank.C @@ -112,9 +112,6 @@ int Bank::loadbank(const char *bankdirname){ printf("%s/\n",bankdirname); struct dirent *fn; - char *remainfiles[BANK_SIZE]; - memset(remainfiles,0,sizeof(remainfiles)); - int remainfilek=0; while(fn=readdir(dir)){ if (fn->d_type!=DT_REG) continue;//this is not a regular file diff --git a/src/Misc/Config.C b/src/Misc/Config.C @@ -196,7 +196,7 @@ void Config::readConfig(char *filename){ void Config::saveConfig(char *filename){ FILE *file=fopen(filename,"w"); if (file==NULL) return; - fprintf(file,"#ZynAddSubFX configuration file\n"); + fprintf(file,"%s","#ZynAddSubFX configuration file\n"); fprintf(file,"SAMPLE_RATE = %d\n",cfg.SampleRate); fprintf(file,"SOUND_BUFFER_SIZE = %d\n",cfg.SoundBufferSize); fprintf(file,"OSCIL_SIZE = %d\n",cfg.OscilSize); diff --git a/src/Misc/Dump.C b/src/Misc/Dump.C @@ -50,7 +50,7 @@ void Dump::startnow(){ else file=fopen(config.cfg.DumpFile,"w"); if (file==NULL) return; - if (config.cfg.DumpAppend!=0) fprintf(file,"#************************************\n"); + if (config.cfg.DumpAppend!=0) fprintf(file,"%s","#************************************\n"); time_t tm=time(NULL); diff --git a/src/Misc/Part.C b/src/Misc/Part.C @@ -196,7 +196,7 @@ void Part::NoteOn(unsigned char note,unsigned char velocity,int masterkeyshift){ if (pos==-1){ //test - fprintf(stderr,"NOTES TOO MANY (> POLIPHONY) - (Part.C::NoteOn(..))\n"); + fprintf(stderr,"%s","NOTES TOO MANY (> POLIPHONY) - (Part.C::NoteOn(..))\n"); } else { if (Pnoteon!=0){ //start the note @@ -620,7 +620,7 @@ void Part::swapcopyitem(int item1, int item2, int mode){ void Part::saveloadbufkititem(Buffer *buf,unsigned char item,int saveitem0){ unsigned char npar,n,tmp; - int fmon,min,fmexton;//fmon is 0 if there is no need to save the FM parameters +// int fmon,min,fmexton;//fmon is 0 if there is no need to save the FM parameters #ifdef DEBUG_BUFFER fprintf(stderr,"\n\n( Part paramete kit item %d) \n",item); diff --git a/src/Params/FilterParams.C b/src/Params/FilterParams.C @@ -120,9 +120,9 @@ REALTYPE FilterParams::getfreqpos(REALTYPE freq){ * Get the freq. response of the formant filter */ void FilterParams::formantfilterH(int nvowel,int nfreqs,REALTYPE *freqs){ - REALTYPE c[3],d[3],curfreq=1000.0; + REALTYPE c[3],d[3]; REALTYPE filter_freq,filter_q,filter_amp; - REALTYPE omega,sn,cs,alpha,beta; + REALTYPE omega,sn,cs,alpha; for (int i=0;i<nfreqs;i++) freqs[i]=0.0; diff --git a/src/Synth/OscilGen.C b/src/Synth/OscilGen.C @@ -304,8 +304,7 @@ void OscilGen::changebasefunction(){ */ void OscilGen::waveshape(){ int i; - REALTYPE tmp; - + oldwaveshapingfunction=Pwaveshapingfunction; oldwaveshaping=Pwaveshaping; if (Pwaveshapingfunction==0) return; @@ -882,7 +881,7 @@ void OscilGen::add2XML(XMLwrapper *xml){ REALTYPE xs=basefuncFFTfreqs[OSCIL_SIZE-i]/max; if ((fabs(xs)>0.00001)&&(fabs(xs)>0.00001)){ xml->beginbranch("BF_HARMONIC",i); - xml->addparreal("cos",xs); + xml->addparreal("cos",xc); xml->addparreal("sin",xs); xml->endbranch(); }; diff --git a/src/UI/EnvelopeUI.fl b/src/UI/EnvelopeUI.fl @@ -70,8 +70,7 @@ return((int) ((1.0-env->Penvval[n]/127.0)*ly));} {} } Function {getnearest(int x,int y)} {return_type int } { - code {int lx=w()-10; -int ly=h()-10; + code { x-=5;y-=5; int nearestpoint=0; @@ -144,8 +143,8 @@ if (currentpoint<=0){ time=env->getdt(currentpoint); }; char tmpstr[20]; -if (time<1000.0) snprintf((char *)&tmpstr,20,"%.1fms\\0",time); - else snprintf((char *)&tmpstr,20,"%.2fs\\0",time/1000.0); +if (time<1000.0) snprintf((char *)&tmpstr,20,"%.1fms",time); + else snprintf((char *)&tmpstr,20,"%.2fs",time/1000.0); fl_draw(tmpstr,ox+lx-20,oy+ly-10,20,10,FL_ALIGN_RIGHT,NULL,0);} {} } Function {handle(int event)} {return_type int diff --git a/src/UI/FilterUI.fl b/src/UI/FilterUI.fl @@ -64,7 +64,7 @@ if ((freqx>0.0)&&(freqx<1.0)) Function {draw()} {open } { code {int maxdB=30; -int ox=x(),oy=y(),lx=w(),ly=h(),i,ix,iy,oiy; +int ox=x(),oy=y(),lx=w(),ly=h(),i,oiy; REALTYPE freqx; fl_color(FL_BLACK); diff --git a/src/UI/MasterUI.fl b/src/UI/MasterUI.fl @@ -121,11 +121,11 @@ fl_font(FL_HELVETICA|FL_BOLD,10); fl_color(255,255,255); char tmpstr[10]; if ((maxdbl>MIN_DB-20)){ - snprintf((char *)&tmpstr,10,"%ddB\\0",(int)maxdbr); + snprintf((char *)&tmpstr,10,"%ddB",(int)maxdbr); fl_draw(tmpstr,ox+VULENX+1,oy+1,lx-VULENX-1,VULENY,FL_ALIGN_RIGHT,NULL,0); }; if ((maxdbr>MIN_DB-20)){ - snprintf((char *)&tmpstr,10,"%ddB\\0",(int)maxdbl); + snprintf((char *)&tmpstr,10,"%ddB",(int)maxdbl); fl_draw(tmpstr,ox+VULENX+1,oy+ly/2+1,lx-VULENX-1,VULENY,FL_ALIGN_RIGHT,NULL,0); };} {} } diff --git a/src/UI/PartUI.fl b/src/UI/PartUI.fl @@ -151,7 +151,7 @@ maxkcounter->do_callback();} Fl_Button labelbutton { label {Bass Drum} callback {const char *tmp=fl_input("Kit item name:",(const char *)part->kit[n].Pname); -if (tmp!=NULL) snprintf((char *)part->kit[n].Pname,PART_MAX_NAME_LEN,tmp);} +if (tmp!=NULL) snprintf((char *)part->kit[n].Pname,PART_MAX_NAME_LEN,"%s",tmp);} xywh {90 0 130 15} box THIN_DOWN_BOX down_box FLAT_BOX labelfont 1 labelsize 11 align 20 code0 {o->label((char *)part->kit[n].Pname);} } diff --git a/src/main.C b/src/main.C @@ -283,12 +283,12 @@ void exitprogram(){ #ifndef VSTAUDIOOUT int main(int argc, char *argv[]){ int loadfile=0,noui=0; - fprintf(stderr,"\nZynAddSubFX - Copyright (c) 2002-2003 Nasca Octavian Paul\n"); - fprintf(stderr,"This program is free software (GNU GPL v.2) and \n it comes with ABSOLUTELY NO WARRANTY.\n\n"); + fprintf(stderr,"%s","\nZynAddSubFX - Copyright (c) 2002-2003 Nasca Octavian Paul\n"); + fprintf(stderr,"%s","This program is free software (GNU GPL v.2) and \n it comes with ABSOLUTELY NO WARRANTY.\n\n"); #ifdef OS_LINUX - if (argc==1) fprintf(stderr,"Try 'zynaddsubfx --help' for command-line options.\n"); + if (argc==1) fprintf(stderr,"%s","Try 'zynaddsubfx --help' for command-line options.\n"); #else - if (argc==1) fprintf(stderr,"Try 'zynaddsubfx -h' for command-line options.\n"); + if (argc==1) fprintf(stderr,"%s","Try 'zynaddsubfx -h' for command-line options.\n"); #endif /* Get the settings from the Config*/ SAMPLE_RATE=config.cfg.SampleRate; @@ -362,34 +362,33 @@ int main(int argc, char *argv[]){ OSCIL_SIZE=tmp; if (OSCIL_SIZE<MAX_AD_HARMONICS*2) OSCIL_SIZE=MAX_AD_HARMONICS*2; OSCIL_SIZE=(int) pow(2,ceil(log (OSCIL_SIZE-1.0)/log(2.0))); - if (tmp!=OSCIL_SIZE) fprintf(stderr,"\nOSCIL_SIZE is wrong (must me 2^n) or too small. Adjusting to %d.\n",OSCIL_SIZE); + if (tmp!=OSCIL_SIZE) fprintf(stderr,"%s","\nOSCIL_SIZE is wrong (must me 2^n) or too small. Adjusting to %d.\n",OSCIL_SIZE); break; case 'S':swaplr=1; break; case 'D':dump.startnow(); break; - case '?':fprintf(stderr,"ERROR:Bad option or parameter.\n\n"); + case '?':fprintf(stderr,"%s","ERROR:Bad option or parameter.\n\n"); exitwithhelp=1; break; }; }; if (exitwithhelp!=0) { - fprintf(stderr,"Usage: zynaddsubfx [OPTION]\n\n"); - fprintf(stderr," -h , --help \t\t\t\t display command-line help and exit\n"); - fprintf(stderr," -l file, --load=FILE\t\t\t loads a .mas-zyn file\n"); - fprintf(stderr," -r SR, --sample-rate=SR\t\t set the sample rate SR\n"); - fprintf(stderr," -b BS, --buffer-size=SR\t\t set the buffer size (granularity)\n"); - fprintf(stderr," -o OS, --oscil-size=OS\t\t set the ADsynth oscil. size\n"); - fprintf(stderr," -S , --swap\t\t\t\t swap Left <--> Right\n"); - fprintf(stderr," -D , --dump\t\t\t\t Dumps midi note ON/OFF commands\n"); - fprintf(stderr," -U , --no-gui\t\t\t\t Run ZynAddSubFX without user interface\n"); - + fprintf(stderr,"%s","Usage: zynaddsubfx [OPTION]\n\n"); + fprintf(stderr,"%s"," -h , --help \t\t\t\t display command-line help and exit\n"); + fprintf(stderr,"%s"," -l file, --load=FILE\t\t\t loads a .mas-zyn file\n"); + fprintf(stderr,"%s"," -r SR, --sample-rate=SR\t\t set the sample rate SR\n"); + fprintf(stderr,"%s"," -b BS, --buffer-size=SR\t\t set the buffer size (granularity)\n"); + fprintf(stderr,"%s"," -o OS, --oscil-size=OS\t\t set the ADsynth oscil. size\n"); + fprintf(stderr,"%s"," -S , --swap\t\t\t\t swap Left <--> Right\n"); + fprintf(stderr,"%s"," -D , --dump\t\t\t\t Dumps midi note ON/OFF commands\n"); + fprintf(stderr,"%s"," -U , --no-gui\t\t\t\t Run ZynAddSubFX without user interface\n"); #ifdef OS_WINDOWS - fprintf(stderr,"\nWARNING: On Windows systems, only short comandline parameters works.\n"); - fprintf(stderr," eg. instead '--buffer-size=512' use '-b 512'\n"); + fprintf(stderr,"%s","\nWARNING: On Windows systems, only short comandline parameters works.\n"); + fprintf(stderr,"%s"," eg. instead '--buffer-size=512' use '-b 512'\n"); #endif - fprintf(stderr,"\n\n"); + fprintf(stderr,"%s","\n\n"); return(0); };