summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorWerner Schweer <ws.seh.de>2006-10-28 10:43:44 +0000
committerWerner Schweer <ws.seh.de>2006-10-28 10:43:44 +0000
commit5c26071d0bbb15844737121dbfe1b54bea882eba (patch)
treecaa2e9af7c30a9f11c4d725ccf97c9c2f4e5bd3d
parent7294b9163f52a019297aa44f12991d8aa914c5bc (diff)
updates
-rw-r--r--muse/synti/zynaddsubfx/Misc/Master.C13
-rw-r--r--muse/synti/zynaddsubfx/Misc/Part.C41
2 files changed, 27 insertions, 27 deletions
diff --git a/muse/synti/zynaddsubfx/Misc/Master.C b/muse/synti/zynaddsubfx/Misc/Master.C
index 87142c09..8b68d560 100644
--- a/muse/synti/zynaddsubfx/Misc/Master.C
+++ b/muse/synti/zynaddsubfx/Misc/Master.C
@@ -49,16 +49,13 @@ Master::Master(){
fakepeakpart[npart]=0;
};
- for (int i=0;i<SOUND_BUFFER_SIZE;i++) {
- audiooutl[i]=0.0;
- audiooutr[i]=0.0;
- };
+ memset(audiooutl, 0, sizeof(REALTYPE) * SOUND_BUFFER_SIZE);
+ memset(audiooutr, 0, sizeof(REALTYPE) * SOUND_BUFFER_SIZE);
for (int npart=0;npart<NUM_MIDI_PARTS;npart++)
part[npart]=new Part(&microtonal,fft,&mutex);
-
//Insertion Effects init
for (int nefx=0;nefx<NUM_INS_EFX;nefx++)
insefx[nefx]=new EffectMgr(1,&mutex);
@@ -291,10 +288,8 @@ void Master::AudioOut(REALTYPE* outl, REALTYPE* outr)
if (sysefx[nefx]->geteffect()==0) continue;//the effect is disabled
//Clean up the samples used by the system effects
- for (i=0;i<SOUND_BUFFER_SIZE;i++) {
- tmpmixl[i]=0.0;
- tmpmixr[i]=0.0;
- };
+ memset(tmpmixl, 0, sizeof(REALTYPE) * SOUND_BUFFER_SIZE);
+ memset(tmpmixr, 0, sizeof(REALTYPE) * SOUND_BUFFER_SIZE);
//Mix the channels according to the part settings about System Effect
for (npart=0;npart<NUM_MIDI_PARTS;npart++){
diff --git a/muse/synti/zynaddsubfx/Misc/Part.C b/muse/synti/zynaddsubfx/Misc/Part.C
index 54d542c7..a40ea031 100644
--- a/muse/synti/zynaddsubfx/Misc/Part.C
+++ b/muse/synti/zynaddsubfx/Misc/Part.C
@@ -137,19 +137,17 @@ void Part::defaultsinstrument(){
*/
void Part::cleanup(){
for (int k=0;k<POLIPHONY;k++) KillNotePos(k);
- for (int i=0;i<SOUND_BUFFER_SIZE;i++){
- partoutl[i]=denormalkillbuf[i];
- partoutr[i]=denormalkillbuf[i];
- tmpoutl[i]=0.0;
- tmpoutr[i]=0.0;
- };
+
+ memcpy(partoutl, denormalkillbuf, sizeof(REALTYPE) * SOUND_BUFFER_SIZE);
+ memcpy(partoutr, denormalkillbuf, sizeof(REALTYPE) * SOUND_BUFFER_SIZE);
+ memset(tmpoutl, 0, sizeof(REALTYPE) * SOUND_BUFFER_SIZE);
+ memset(tmpoutr, 0, sizeof(REALTYPE) * SOUND_BUFFER_SIZE);
+
ctl.resetall();
for (int nefx=0;nefx<NUM_PART_EFX;nefx++) partefx[nefx]->cleanup();
for (int n=0;n<NUM_PART_EFX+1;n++) {
- for (int i=0;i<SOUND_BUFFER_SIZE;i++){
- partfxinputl[n][i]=denormalkillbuf[i];
- partfxinputr[n][i]=denormalkillbuf[i];
- };
+ memcpy(partfxinputl[n], denormalkillbuf, sizeof(REALTYPE) * SOUND_BUFFER_SIZE);
+ memcpy(partfxinputr[n], denormalkillbuf, sizeof(REALTYPE) * SOUND_BUFFER_SIZE);
};
};
@@ -479,14 +477,12 @@ void Part::AllNotesOff(){
* Compute Part samples and store them in the partoutl[] and partoutr[]
*/
void Part::ComputePartSmps(){
- int i,k;
+ int i, k;
int noteplay;//0 if there is nothing activated
for (int nefx=0;nefx<NUM_PART_EFX+1;nefx++){
- for (i=0;i<SOUND_BUFFER_SIZE;i++){
- partfxinputl[nefx][i]=0.0;
- partfxinputr[nefx][i]=0.0;
+ memset(partfxinputl[nefx], 0, sizeof(REALTYPE) * SOUND_BUFFER_SIZE);
+ memset(partfxinputr[nefx], 0, sizeof(REALTYPE) * SOUND_BUFFER_SIZE);
};
- };
for (k=0;k<POLIPHONY;k++){
if (partnote[k].status==KEY_OFF) continue;
@@ -505,7 +501,10 @@ void Part::ComputePartSmps(){
if (adnote!=NULL) {
noteplay++;
if (adnote->ready!=0) adnote->noteout(&tmpoutl[0],&tmpoutr[0]);
- else for (i=0;i<SOUND_BUFFER_SIZE;i++){tmpoutl[i]=0.0;tmpoutr[i]=0.0;};
+ else {
+ memset(tmpoutl, 0, sizeof(REALTYPE) * SOUND_BUFFER_SIZE);
+ memset(tmpoutr, 0, sizeof(REALTYPE) * SOUND_BUFFER_SIZE);
+ }
if (adnote->finished()!=0){
delete (adnote);
partnote[k].kititem[item].adnote=NULL;
@@ -519,7 +518,10 @@ void Part::ComputePartSmps(){
if (subnote!=NULL) {
noteplay++;
if (subnote->ready!=0) subnote->noteout(&tmpoutl[0],&tmpoutr[0]);
- else for (i=0;i<SOUND_BUFFER_SIZE;i++){tmpoutl[i]=0.0;tmpoutr[i]=0.0;};
+ else {
+ memset(tmpoutl, 0, sizeof(REALTYPE) * SOUND_BUFFER_SIZE);
+ memset(tmpoutr, 0, sizeof(REALTYPE) * SOUND_BUFFER_SIZE);
+ }
for (i=0;i<SOUND_BUFFER_SIZE;i++){//add the SUBnote to part(mix)
partfxinputl[sendcurrenttofx][i]+=tmpoutl[i];
@@ -534,7 +536,10 @@ void Part::ComputePartSmps(){
if (padnote!=NULL) {
noteplay++;
if (padnote->ready!=0) padnote->noteout(&tmpoutl[0],&tmpoutr[0]);
- else for (i=0;i<SOUND_BUFFER_SIZE;i++){tmpoutl[i]=0.0;tmpoutr[i]=0.0;};
+ else {
+ memset(tmpoutl, 0, sizeof(REALTYPE) * SOUND_BUFFER_SIZE);
+ memset(tmpoutr, 0, sizeof(REALTYPE) * SOUND_BUFFER_SIZE);
+ }
if (padnote->finished()!=0){
delete (padnote);
partnote[k].kititem[item].padnote=NULL;