Skip to content

trouble with saw_c #17

@dsp1986

Description

@dsp1986

while following the guides, to get to know the environment I came accross the need of a saw_c unit generator. I couldn't find it anywhere, so I took it as an exercise to write my own. I came up with:

(bind-func saw_c
  (lambda (phase)
    (lambda (amp freq:SAMPLE)
      (let ((incr (/ freq 44100.0)))
	(set! phase (% (+ phase incr) 1.0))
	(* amp (- (* 2 phase) 1))))))

however, on compilation I get a type error:

Type Error conflicting i64 with float in (+ phase incr)

I don't understand why extempore thinks phase should be an i64?
Up to this point all examples in philosphy and the guide have worked.

Any ideas?

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions