effects_internal.c
changeset 201 e55fb6b45559
parent 140 efa15d2a5403
child 241 503416fca921
     1.1 --- a/effects_internal.c	Mon Dec 16 04:50:16 2002 +0000
     1.2 +++ b/effects_internal.c	Fri Dec 27 15:13:37 2002 +0000
     1.3 @@ -67,8 +67,9 @@
     1.4          if (rc) {
     1.5              _Eff_volume_table = (void *) rc;
     1.6              for (volume = 0; volume < 256; volume++) {
     1.7 -                for (sample = 0; sample < 256; sample ++) {
     1.8 -                    *rc = (Uint8)(((float) sample) * ((float) volume / 255.0));
     1.9 +                for (sample = -128; sample < 128; sample ++) {
    1.10 +                    *rc = (Uint8)(((float) sample) * ((float) volume / 255.0)) 
    1.11 +                        + 128;
    1.12                      rc++;
    1.13                  }
    1.14              }
    1.15 @@ -83,7 +84,7 @@
    1.16   *
    1.17   * Each column of the table is a possible sample, while each row of the
    1.18   *  table is a volume. Volume is a Uint8, where 0 is silence and 255 is full
    1.19 - *  volume. So _Eff_volume_table[128][mysample] would be the value of
    1.20 + *  volume. So _Eff_volume_table[128][mysample+128] would be the value of
    1.21   *  mysample, at half volume.
    1.22   */
    1.23  void *_Eff_build_volume_table_s8(void)
    1.24 @@ -97,7 +98,7 @@
    1.25          if (rc) {
    1.26              _Eff_volume_table = (void *) rc;
    1.27              for (volume = 0; volume < 256; volume++) {
    1.28 -                for (sample = 0; sample < 256; sample ++) {
    1.29 +                for (sample = -128; sample < 128; sample ++) {
    1.30                      *rc = (Sint8)(((float) sample) * ((float) volume / 255.0));
    1.31                      rc++;
    1.32                  }