[Fluxus] fluxa fixes

Kassen signal.automatique at gmail.com
Sat Nov 24 10:03:28 PST 2012


On Sat, Nov 24, 2012 at 02:44:45PM +0000, David Griffiths wrote:
> Hi Kassen,
> 
> Sorry for not getting back to you sooner, lets go through some of this...
> 

No problem; I enjoy the ansync. nature of email. We'd never get
something done if our productive bursts needed to line up.

> Thanks for this, I wasn't getting the warning so I think this is a
> 32/64bit issue, thanks for tracking it down (and fixing the other
> related bug)...

From what I gathered online this is a general problem these days,
affecting people across compilers and OS's.

> libsndfile still seems to be randomly crashing on some of my samples - I
> haven't looked into it properly yet, it could be that the async loading
> thread isn't working properly and libsndfile does more allocation that
> causes jack to fall over for me.

This is really weird. LibSndFile has been good for me and it's good
for our friends over at SC, CK, PD, etc, etc, etc too. Could it be
that your samples have some sort of issue? I stubbornly put it back
here, if you mail me one of your samples that cause issues (gmail
takes up to 10MB or so) I could test that on my end.

> This could be the problem, I haven't been testing seq properly since
> moving to temporal recursion. Let me do some tests and get back to you...

In your other mail you ask for a example. Here is a simple one that
still gives issues;

(seq (λ (time clock)
        (when (zmod clock 4) (play time (sample "TR909/kk.wav" 440)))
        (when (even? clock) (play time (* .5 (sample
"TR909/clht.wav" 440))))
        .1))

...that's intentionally "my first Fluxa" material. Because this one
does not allocate so many nodes it takes its time to start being
problematic. I don't think that one involves a lot of redacted stuff.
This is my regular test case, it needs a LOT of redacted stuff. Starts
giving trouble after half a minute or so;

(seq (λ (time clock)
    (when (zmod clock 4)
        (play time (distort                                                                                                                                                                                         
                     (sample "TR909/kk1.wav")
                     (adsr (if (zmod clock 8) 0.1 .2) .1 .2 .1))))
    (when (zmod (modulo clock 8) 3)
        (play time (*
                     (adsr .01 .1 (if (zsqu clock 32) .2 .4) .2)
                     (mooglp
                       (klip
                           (sine 100)
                           (lfo-revsaw (if (even? clock) .1 .25)))
                       (* (if (zmod clock 4) .5 .01) (lfo-revsaw .1))
                      (zsaw clock 44) ))))
    (when (zmod (modulo (+ clock 0) 16) 6)
        (play time (* .6
                    (adsr (if (not (zmod (modulo clock 8) 3)) .05 0)
.1 .6 (if (zmod (modulo clock 32) 3) .3 .6))
                    (scrub
                      "TR909/clht1.wav"
                      (lfo-revsaw (if (zmod clock 8) .3 .1))))))
    (when (zmod (modulo (+ clock 2) 16)  (if (zsqu (modulo clock 16)
12) 6 3))
        (play time (* 2.
                    (adsr 0 .1 .8 .4)
                    (echo
                        (kas-filter
                            (sample "TR909/rim.wav")
                            (* 150 (floor (xfade 8 32 (zsin clock (if
(zsqu clock 32) 32 16)))))
                            (zsin clock (if (zsqu clock 64) 12 8))
                            (if (odd? clock) 0.3 .9))
                        (xfade 0.1 0.0125 (zcos clock 12))
                        .3))))
    .1))

For this you would need my "zmod-inspired looping tricks" that should
be in the git repository anyway. Here they are for your entertainment.
These are tested and certified "fun";

;--------------------
;tools for convenient looping
(define (zsin clock loop-length)
  (cond
    ((not (number? clock)) (raise-type-error 'zsin "number" clock))
    ((not (number? loop-length)) (raise-type-error 'zsin "number"
loop-length))
    (else (let ((phase (/ clock loop-length)))
        (+ .5 (* .5 (sin (* 2 pi phase))))))))

(define (zcos clock loop-length)
 (cond
    ((not (number? clock)) (raise-type-error 'zcos "number" clock))
    ((not (number? loop-length)) (raise-type-error 'zcos "number"
loop-length))
    (else (let ((phase (/ clock loop-length)))
        ;(set! phase (- phase (floor phase)))
        (+ .5 (* .5 (cos (* 2 pi phase))))))))

(define (zrevsaw clock loop-length)
 (cond
    ((not (number? clock)) (raise-type-error 'zrevsaw "number" clock))
    ((not (number? loop-length)) (raise-type-error 'zrevsaw "number"
loop-length))
    (else (let ((phase (/ clock loop-length)))
        (- phase (floor phase))))))

(define (zsaw clock loop-length)
 (cond
    ((not (number? clock)) (raise-type-error 'zsaw "number" clock))
    ((not (number? loop-length)) (raise-type-error 'zsaw "number"
loop-length))
    (else (let ((phase (/ clock loop-length)))
        (- 1 (- phase (floor phase)))))))

(define (zsqu clock loop-length)
  (cond
    ((not (integer? clock)) (raise-type-error 'zsqu "integer" clock))
    ((not (integer? loop-length)) (raise-type-error 'zsqu "integer"
loop-length))
    (else (if (even? (quotient clock loop-length)) #t #f))))

;--------------------

I realise that that larger example might look a bit -erm- alien if you
are used to "Master" fluxa as opposed to my "homework".... :-)

Yours,
Kas.



More information about the Fluxus mailing list