Csound Csound-dev Csound-tekno Search About

Re: [Csnd] trig functions

Date2013-08-02 17:32
From"Partev Barr Sarkissian"
SubjectRe: [Csnd] trig functions
try a1 being between 0 to 90,
itwopi = 3.14/b, where b: is a whole number integer not equal to zero, or use 22/7 for pi instead 3.14.
and use a sum instead of a product,
multiply the results by some amplitude.


A*(sin (a1+((22/7)/b)), where b=
a whole number integer not equal to zero.

... just a thought,
straight out of a trig book.

-pbs

=========================================================

--- j_hearon@hotmail.com wrote:

From: James Hearon <j_hearon@hotmail.com>
To: "csound@lists.bath.ac.uk" <csound@lists.bath.ac.uk>
Subject: [Csnd] trig functions
Date: Fri, 2 Aug 2013 16:10:58 +0000

Hi,
I'm having a devil of time trying to get trig functions to create audio output with their characteristic waveshapes.

There was an approach called the "hand-coded" sin, Ex.

sr    =    44100
kr    =    4410
ksmps    =    10
nchnls    =    1
0dbfs  = 1
 
 instr 1
itwopi = 3.14
a1 phasor 440
a2 = sin(itwopi*a1)
out a2

Also by substitution using other trig functions in addition to the sin functions.  But I cannot seem to get this work again and have tried changing command flags, k-rate, num of channels, pi value etc.  but nothing seems to yield a true sine.  The negative portion of the wave shape is linear (looks like a V) instead of exponential (U).

I tried a simple lfo opcode and that works fine, but I'm stumped on what may have happened to "hand-coded".  I'm using a libcsound64, but I've tried it on 32-bit machine also using libcsound.

I'm not sure what may have changed. 

Any help or clues appreciated.

Regards,
Jim Hearon

 

Netscape.  Just the Net You Need.