| version 1.1, 2003/10/16 17:58:13 | version 1.4, 2006/12/16 12:11:07 | 
| Line 25 | Line 25 | 
 |  |  | 
 | // ---- vibrate | // ---- vibrate | 
 |  |  | 
| static int vibrate_update(VOICE v) { | static int VERMOUTHCL vibrate_update(VOICE v) { | 
 |  |  | 
 | int             depth; | int             depth; | 
 | int             phase; | int             phase; | 
| Line 52  static int vibrate_update(VOICE v) { | Line 52  static int vibrate_update(VOICE v) { | 
 | return((int)(step * (float)(1 << FREQ_SHIFT))); | return((int)(step * (float)(1 << FREQ_SHIFT))); | 
 | } | } | 
 |  |  | 
| static SAMPLE resample_vibrate(VOICE v, SAMPLE dst, SAMPLE dstterm) { | static SAMPLE VERMOUTHCL resample_vibrate(VOICE v, SAMPLE dst, | 
|  | SAMPLE dstterm) { | 
 |  |  | 
 | SAMPLE  src; | SAMPLE  src; | 
 | SAMPLE  dstbreak; | SAMPLE  dstbreak; | 
| Line 109  static SAMPLE resample_vibrate(VOICE v, | Line 110  static SAMPLE resample_vibrate(VOICE v, | 
 | return(dst); | return(dst); | 
 | } | } | 
 |  |  | 
| static SAMPLE resample_vibloop(VOICE v, SAMPLE dst, SAMPLE dstterm) { | static SAMPLE VERMOUTHCL resample_vibloop(VOICE v, SAMPLE dst, | 
|  | SAMPLE dstterm) { | 
 |  |  | 
 | SAMPLE  src; | SAMPLE  src; | 
 | SAMPLE  dstbreak; | SAMPLE  dstbreak; | 
| Line 161  static SAMPLE resample_vibloop(VOICE v, | Line 163  static SAMPLE resample_vibloop(VOICE v, | 
 | return(dst); | return(dst); | 
 | } | } | 
 |  |  | 
| static SAMPLE resample_vibround(VOICE v, SAMPLE dst, SAMPLE dstterm) { | static SAMPLE VERMOUTHCL resample_vibround(VOICE v, SAMPLE dst, | 
|  | SAMPLE dstterm) { | 
 |  |  | 
 | SAMPLE  src; | SAMPLE  src; | 
 | SAMPLE  dstbreak; | SAMPLE  dstbreak; | 
| Line 269  rr_done: | Line 272  rr_done: | 
 |  |  | 
 | // ---- normal | // ---- normal | 
 |  |  | 
| static SAMPLE resample_normal(VOICE v, SAMPLE dst, SAMPLE dstterm) { | static SAMPLE VERMOUTHCL resample_normal(VOICE v, SAMPLE dst, SAMPLE dstterm) { | 
 |  |  | 
 | SAMPLE  src; | SAMPLE  src; | 
 | int             pos; | int             pos; | 
| Line 298  static SAMPLE resample_normal(VOICE v, S | Line 301  static SAMPLE resample_normal(VOICE v, S | 
 | return(dst); | return(dst); | 
 | } | } | 
 |  |  | 
| static SAMPLE resample_loop(VOICE v, SAMPLE dst, SAMPLE dstterm) { | static SAMPLE VERMOUTHCL resample_loop(VOICE v, SAMPLE dst, SAMPLE dstterm) { | 
 |  |  | 
 | SAMPLE  src; | SAMPLE  src; | 
 | int             pos; | int             pos; | 
| Line 321  static SAMPLE resample_loop(VOICE v, SAM | Line 324  static SAMPLE resample_loop(VOICE v, SAM | 
 | return(dst); | return(dst); | 
 | } | } | 
 |  |  | 
| static SAMPLE resample_round(VOICE v, SAMPLE dst, SAMPLE dstterm) { | static SAMPLE VERMOUTHCL resample_round(VOICE v, SAMPLE dst, SAMPLE dstterm) { | 
 |  |  | 
 | SAMPLE  src; | SAMPLE  src; | 
 | int             pos; | int             pos; | 
| Line 376  rr_done: | Line 379  rr_done: | 
 |  |  | 
 | // ---- | // ---- | 
 |  |  | 
| int envlope_setphase(VOICE v, int phase) { | int VERMOUTHCL envlope_setphase(VOICE v, int phase) { | 
 |  |  | 
 | do { | do { | 
 | if (phase >= 6) { | if (phase >= 6) { | 
| Line 402  int envlope_setphase(VOICE v, int phase) | Line 405  int envlope_setphase(VOICE v, int phase) | 
 | return(0); | return(0); | 
 | } | } | 
 |  |  | 
| void envelope_updates(VOICE v) { | void VERMOUTHCL envelope_updates(VOICE v) { | 
 |  |  | 
 | int             envl; | int             envl; | 
 | int             envr; | int             envr; | 
| Line 457  void envelope_updates(VOICE v) { | Line 460  void envelope_updates(VOICE v) { | 
 | } | } | 
 |  |  | 
 | #if defined(ENABLE_TREMOLO) | #if defined(ENABLE_TREMOLO) | 
| static void tremolo_update(VOICE v) { | static void VERMOUTHCL tremolo_update(VOICE v) { | 
 |  |  | 
 | int             depth; | int             depth; | 
 | int             cnt; | int             cnt; | 
 | int             vol; | int             vol; | 
 |  | int             pos; | 
 |  |  | 
 | depth = v->sample->tremolo_depth << 8; | depth = v->sample->tremolo_depth << 8; | 
 | if (v->tremolo.sweepstep) { | if (v->tremolo.sweepstep) { | 
| Line 476  static void tremolo_update(VOICE v) { | Line 480  static void tremolo_update(VOICE v) { | 
 | } | } | 
 | v->tremolo.count += v->tremolo.step; | v->tremolo.count += v->tremolo.step; | 
 | cnt = v->tremolo.count >> TRERATE_SHIFT; | cnt = v->tremolo.count >> TRERATE_SHIFT; | 
| vol = envsin12q[cnt & ((1 << (SINENT_BIT - 2)) - 1)]; | pos = cnt & ((1 << (SINENT_BIT - 2)) - 1); | 
 | if (cnt & (1 << (SINENT_BIT - 2))) { | if (cnt & (1 << (SINENT_BIT - 2))) { | 
| vol = (1 << 12) - vol; | pos ^= ((1 << (SINENT_BIT - 2)) - 1); | 
 | } | } | 
 |  | vol = envsin12q[pos]; | 
 | if (cnt & (1 << (SINENT_BIT - 1))) { | if (cnt & (1 << (SINENT_BIT - 1))) { | 
 | vol = 0 - vol; | vol = 0 - vol; | 
 | } | } | 
| Line 514  static int envelope_update(VOICE v) { | Line 519  static int envelope_update(VOICE v) { | 
 |  |  | 
 | // ---- release | // ---- release | 
 |  |  | 
| static void mixrel_normal(VOICE v, SINT32 *dst, SAMPLE src, SAMPLE srcterm) { | static void VERMOUTHCL mixrel_normal(VOICE v, SINT32 *dst, SAMPLE src, | 
|  | SAMPLE srcterm) { | 
 |  |  | 
 | int             samples; | int             samples; | 
 | SINT32  voll; | SINT32  voll; | 
| Line 548  static void mixrel_normal(VOICE v, SINT3 | Line 554  static void mixrel_normal(VOICE v, SINT3 | 
 | } while(src < srcterm); | } while(src < srcterm); | 
 | } | } | 
 |  |  | 
| static void mixrel_left(VOICE v, SINT32 *dst, SAMPLE src, SAMPLE srcterm) { | static void VERMOUTHCL mixrel_left(VOICE v, SINT32 *dst, SAMPLE src, | 
|  | SAMPLE srcterm) { | 
 |  |  | 
 | SINT32  vol; | SINT32  vol; | 
 | SINT32  rel; | SINT32  rel; | 
| Line 570  static void mixrel_left(VOICE v, SINT32 | Line 577  static void mixrel_left(VOICE v, SINT32 | 
 | } while(src < srcterm); | } while(src < srcterm); | 
 | } | } | 
 |  |  | 
| static void mixrel_right(VOICE v, SINT32 *dst, SAMPLE src, SAMPLE srcterm) { | static void VERMOUTHCL mixrel_right(VOICE v, SINT32 *dst, SAMPLE src, | 
|  | SAMPLE srcterm) { | 
 |  |  | 
 | mixrel_left(v, dst + 1, src, srcterm); | mixrel_left(v, dst + 1, src, srcterm); | 
 | } | } | 
 |  |  | 
| static void mixrel_centre(VOICE v, SINT32 *dst, SAMPLE src, SAMPLE srcterm) { | static void VERMOUTHCL mixrel_centre(VOICE v, SINT32 *dst, SAMPLE src, | 
|  | SAMPLE srcterm) { | 
 |  |  | 
 | SINT32  vol; | SINT32  vol; | 
 | SINT32  rel; | SINT32  rel; | 
| Line 603  static void mixrel_centre(VOICE v, SINT3 | Line 612  static void mixrel_centre(VOICE v, SINT3 | 
 |  |  | 
 | // ---- normal | // ---- normal | 
 |  |  | 
| static void mixnor_normal(VOICE v, SINT32 *dst, SAMPLE src, SAMPLE srcterm) { | static void VERMOUTHCL mixnor_normal(VOICE v, SINT32 *dst, SAMPLE src, | 
|  | SAMPLE srcterm) { | 
 |  |  | 
 | SINT32  voll; | SINT32  voll; | 
 | SINT32  volr; | SINT32  volr; | 
| Line 619  static void mixnor_normal(VOICE v, SINT3 | Line 629  static void mixnor_normal(VOICE v, SINT3 | 
 | } while(src < srcterm); | } while(src < srcterm); | 
 | } | } | 
 |  |  | 
| static void mixnor_left(VOICE v, SINT32 *dst, SAMPLE src, SAMPLE srcterm) { | static void VERMOUTHCL mixnor_left(VOICE v, SINT32 *dst, SAMPLE src, | 
|  | SAMPLE srcterm) { | 
 |  |  | 
 | SINT32  vol; | SINT32  vol; | 
 | _SAMPLE s; | _SAMPLE s; | 
| Line 632  static void mixnor_left(VOICE v, SINT32 | Line 643  static void mixnor_left(VOICE v, SINT32 | 
 | } while(src < srcterm); | } while(src < srcterm); | 
 | } | } | 
 |  |  | 
| static void mixnor_right(VOICE v, SINT32 *dst, SAMPLE src, SAMPLE srcterm) { | static void VERMOUTHCL mixnor_right(VOICE v, SINT32 *dst, SAMPLE src, | 
|  | SAMPLE srcterm) { | 
 |  |  | 
 | SINT32  vol; | SINT32  vol; | 
 | _SAMPLE s; | _SAMPLE s; | 
| Line 645  static void mixnor_right(VOICE v, SINT32 | Line 657  static void mixnor_right(VOICE v, SINT32 | 
 | } while(src < srcterm); | } while(src < srcterm); | 
 | } | } | 
 |  |  | 
| static void mixnor_centre(VOICE v, SINT32 *dst, SAMPLE src, SAMPLE srcterm) { | static void VERMOUTHCL mixnor_centre(VOICE v, SINT32 *dst, SAMPLE src, | 
|  | SAMPLE srcterm) { | 
 |  |  | 
 | SINT32  vol; | SINT32  vol; | 
 | _SAMPLE s; | _SAMPLE s; | 
| Line 664  static void mixnor_centre(VOICE v, SINT3 | Line 677  static void mixnor_centre(VOICE v, SINT3 | 
 |  |  | 
 | // ---- env | // ---- env | 
 |  |  | 
| static void mixenv_normal(VOICE v, SINT32 *dst, SAMPLE src, SAMPLE srcterm) { | static void VERMOUTHCL mixenv_normal(VOICE v, SINT32 *dst, SAMPLE src, | 
|  | SAMPLE srcterm) { | 
 |  |  | 
 | int             cnt; | int             cnt; | 
 | SINT32  voll; | SINT32  voll; | 
| Line 710  static void mixenv_normal(VOICE v, SINT3 | Line 724  static void mixenv_normal(VOICE v, SINT3 | 
 | } while(src < srcterm); | } while(src < srcterm); | 
 | } | } | 
 |  |  | 
| static void mixenv_left(VOICE v, SINT32 *dst, SAMPLE src, SAMPLE srcterm) { | static void VERMOUTHCL mixenv_left(VOICE v, SINT32 *dst, SAMPLE src, | 
|  | SAMPLE srcterm) { | 
 |  |  | 
 | int             cnt; | int             cnt; | 
 | SINT32  vol; | SINT32  vol; | 
| Line 751  static void mixenv_left(VOICE v, SINT32 | Line 766  static void mixenv_left(VOICE v, SINT32 | 
 | } while(src < srcterm); | } while(src < srcterm); | 
 | } | } | 
 |  |  | 
| static void mixenv_right(VOICE v, SINT32 *dst, SAMPLE src, SAMPLE srcterm) { | static void VERMOUTHCL mixenv_right(VOICE v, SINT32 *dst, SAMPLE src, | 
|  | SAMPLE srcterm) { | 
 |  |  | 
 | mixenv_left(v, dst + 1, src, srcterm); | mixenv_left(v, dst + 1, src, srcterm); | 
 | } | } | 
 |  |  | 
| static void mixenv_centre(VOICE v, SINT32 *dst, SAMPLE src, SAMPLE srcterm) { | static void VERMOUTHCL mixenv_centre(VOICE v, SINT32 *dst, SAMPLE src, | 
|  | SAMPLE srcterm) { | 
 |  |  | 
 | int             cnt; | int             cnt; | 
 | SINT32  vol; | SINT32  vol; | 
| Line 812  static const RESPROC resproc[] = { | Line 829  static const RESPROC resproc[] = { | 
 | #endif | #endif | 
 | }; | }; | 
 |  |  | 
| void voice_setphase(VOICE v, BYTE phase) { | void VERMOUTHCL voice_setphase(VOICE v, UINT8 phase) { | 
 |  |  | 
 | int             proc; | int             proc; | 
 | int             mode; | int             mode; | 
| Line 843  static const MIXPROC mixproc[] = { | Line 860  static const MIXPROC mixproc[] = { | 
 | mixenv_normal,  mixenv_left,    mixenv_right,   mixenv_centre, | mixenv_normal,  mixenv_left,    mixenv_right,   mixenv_centre, | 
 | mixrel_normal,  mixrel_left,    mixrel_right,   mixrel_centre}; | mixrel_normal,  mixrel_left,    mixrel_right,   mixrel_centre}; | 
 |  |  | 
| void voice_setmix(VOICE v) { | void VERMOUTHCL voice_setmix(VOICE v) { | 
 |  |  | 
 | int             proc; | int             proc; | 
 |  |  |