~ubuntu-branches/debian/stretch/bristol/stretch

« back to all changes in this revision

Viewing changes to bristol/blo.c

  • Committer: Package Import Robot
  • Author(s): Alessio Treglia
  • Date: 2011-11-14 06:15:01 UTC
  • mfrom: (1.2.6) (6.1.12 sid)
  • Revision ID: package-import@ubuntu.com-20111114061501-fralw11sxtl7n929
Tags: 0.60.9-1
* New upstream bugfix release.
* Depends on libjack-dev only.
* Refresh patches.

Show diffs side-by-side

added added

removed removed

Lines of Context:
1
1
 
2
2
/*
3
3
 *  Diverse Bristol audio routines.
4
 
 *  Copyright (c) by Nick Copeland <nickycopeland@hotmail.com> 1996,2010
 
4
 *  Copyright (c) by Nick Copeland <nickycopeland@hotmail.com> 1996,2011
5
5
 *
6
6
 *
7
7
 *   This program is free software; you can redistribute it and/or modify
61
61
        blo.samplerate = samplerate;
62
62
        blo.fraction = fraction * 1024;
63
63
 
64
 
printf("generate bandlimited waveforms(%i, %2.0f, %i, %1.2f, %1.2f, %i)\n",
65
 
harmonics, gn, cutin, cutoff, fraction, samplerate);
 
64
        printf("generate bandlimited waveforms(%i, %2.0f, %i, %1.2f, %1.2f, %i)\n",
 
65
                harmonics, gn, cutin, cutoff, fraction, samplerate);
66
66
 
67
67
        if (harmonics == 0) {
68
68
                blo.flags &= ~BRISTOL_BLO;
192
192
{
193
193
        if ((~blo.flags & BRISTOL_BLO) || (blo.harmonics == 0))
194
194
                return(0);
195
 
        return(step*blo.harmonics > blo.fraction);
 
195
        return((step*blo.harmonics) > blo.fraction);
196
196
}
197
197
 
198
198
/*
213
213
        if ((~blo.flags & BRISTOL_BLO) || (blo.harmonics == 0))
214
214
                return;
215
215
 
216
 
        /*printf("generateBLOwaveformF(%i, %i, %i)\n",key, blo.cutin, harmonics); */
 
216
//printf("generateBLOwaveformF(%i, %p, %i)\n", blo.cutin, dst, harmonics);
217
217
 
218
218
        switch (wf) {
219
219
                case BLO_PULSE:
221
221
                        for (j = 1; j <= harmonics; j++)
222
222
                        {
223
223
                                k = 0; gain = 1 / ((float) j);
224
 
                                if ((step * j) > blo.fraction) return;
 
224
                                if ((step * j) > blo.fraction) break;
225
225
 
226
226
                                if (j & 0x01)
227
227
                                {
276
276
                        for (j = 1; j <= harmonics; j++)
277
277
                        {
278
278
                                k = 0; gain = 1 / ((float) j);
279
 
                                if ((step * j) > blo.fraction) return;
 
279
                                if ((step * ((float) j)) > blo.fraction) break;
280
280
 
281
281
                                if (j & 0x01)
282
282
                                {
356
356
        }
357
357
}
358
358
 
 
359
/*
 
360
 * No longer used
 
361
 */
359
362
void
360
363
generateBLOwaveformZ(int key, float *dst, float gn, int wf)
361
364
{