extemporelang / extemporelang.github.io

Extempore docs website
MIT License
71 stars 26 forks source link

I can't compile organ_fx. #23

Closed cyblue9 closed 5 years ago

cyblue9 commented 5 years ago

@benswift

In /guides/making-an-instrument, when below code is compiled

(bind-func organ_fx 100000
  (let ((flanl (flanger_c 1.0 0.0 0.6 1.0))
        (flanr (flanger_c 1.0 0.0 0.6 1.0))
        (treml (osc_c 0.0))
        (tremr (osc_c 0.0))
        (trem_amp 0.1)
        (wet 0.5)
        (fb 0.5)
        (trem_freq .0))
    (lambda (in:SAMPLE time:i64 chan:i64 dat:SAMPLE*)
      (cond ((= chan 0)
             (* (flanl in wet fb)
                (+ 1.0 (treml trem_amp trem_freq))))
            ((= chan 1)
             (* (flanr in wet fb)
                (+ 1.0 (tremr trem_amp (* 1.1 trem_freq)))))
            (else 0.0)))))

following error is displayed.

(flanger_c##20 1.000000 0.000000 0.600000 1.000000)

Because, flanger_c function argument is wrong. (https://github.com/digego/extempore/blob/c59748ccf8bcb97e5013bc8c1b394c70e48fa1cd/libs/core/audio_dsp.xtm#L1987)

I don't understand flanger_c and organ_fx functions, I can't fix this bug. Can you fix this bug?

cyblue9 commented 5 years ago

Thank you!