# [chuck-users] function for creating 8 bit waveforms from expressions

Michael Heuer heuermh at gmail.com
Sun Dec 29 00:00:22 EST 2013

```Hello Ronni,

Might you have a link to the paper you are referring to?  Something is
lost to me in the specification of the algorithm.

I am reminded of this

http://countercomplex.blogspot.com/2011/10/algorithmic-symphonies-from-one-line-of.html

http://countercomplex.blogspot.com/2011/10/some-deep-analysis-of-one-line-music.html

Cheers,

michael

On Fri, Dec 27, 2013 at 1:46 AM, Ronni Montoya <ronni.montoya at gmail.com> wrote:
> Hi list, i been reading a paper that talks about an approach for
> generating sound that uses functions to directly shape waveforms. The
> function receives "expresions" as argument and it generates different
> kind of 8 bit waveforms from the expressions.
>
> An expression can look like this:
>
> f(t) = t * ( t >> 8 * ( t >>15 | t >> 8) & 20 | ( t >>19) * 5 >> t | t >> 3))
>
>
>
> The paper describes the algorithm in this way:
>
>
> algorithm 1 :
> Construction of an 8-bit waveform of 8000Hz  sample rate:
>
> The function has 2 inputs :
>
> Input 1) a functional expresion f(t)
> Input  2 ) time durations in seconds (d)
> Output: the waveform of an audio signal with seconds duration
>
>
> for t = 1 to d8000 do
>      if f(t) ==NaN then
>          q(t)  <-- 0
>       else
>          q(t) <-- mod(f(t)), 256)
>      end if
>      s(t) <-- 2 q(t)/255 - 1
> end for
>
>
> If its possible to implement this approach for generating sound in chuck??
>
>
>
>
> cheers
>
>
> R.
> _______________________________________________
> chuck-users mailing list
> chuck-users at lists.cs.princeton.edu
> https://lists.cs.princeton.edu/mailman/listinfo/chuck-users
```