[Top][All Lists]
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
Re: square might be out of tune
From: |
ben |
Subject: |
Re: square might be out of tune |
Date: |
Tue Mar 6 19:51:02 2001 |
User-agent: |
Mutt/1.2.5i |
I've attached that sawtooth oscillator, which is just a quick
modification of squaregen.c. However, that fix doesn't work with it -
it causes the pitch to stay the same no matter where the slider is..
The fix does work with squaregen.c, though. I'm stumped.
On Tue, Mar 06, 2001 at 07:29:45PM -0500, David O'Toole wrote:
> Thank you for pointing out this problem; I will fix it. Oh, I hope not
> too many generators are bases on squaregen... it was written very early
> on in the project's like (until recently it still had emacs-style
> indentation IIRC) and it isn't very exciting. Perhaps I should rewrite
> it and make it better? When I write the sampleplayer machine (I will add
> the wave table extension to the API very soon) I'll try to make that one
> a better example from the start.
>
> > I was looking at squaregen.c to try to make a sawtooth generator, and I
> > think line 164 which says
> >
> > if (phase >= 1.0) phase = 0.0;
> >
> > should be changed to
> >
> > if (phase >= 1.0) phase -= 1.0;
> >
> > In the first one, the position in the wave is always set back to 0
> > without taking into account how far it may have gone past 1; setting
> > phase to ((current position) - 1) compensates for that, I think. I know
> > it's just an example generator, but it should be fixed since other
> > generators will be based on it..
> >
> > ben
> >
> > _______________________________________________
> > Octal-dev mailing list
> > address@hidden
> > http://mail.gnu.org/mailman/listinfo/octal-dev
> >
>
>
>
> --
> @@@ david o'toole
> @@@ address@hidden
> @@@ www.gnu.org/software/octal
>
>
> _______________________________________________
> Octal-dev mailing list
> address@hidden
> http://mail.gnu.org/mailman/listinfo/octal-dev
sawgen.c
Description: Text document