[Fluxus] scala.scm, rev. 3

Joel Matthys joel at matthysmusic.com
Wed Dec 21 10:53:49 PST 2011


OK, here's rev 3. Now with optional microtonal support. This can be
disabled with (set-scala-microtonal #f).

Should accept fractional/float values anytime now.

Joel

On Wed, 2011-12-21 at 17:14 +0100, Kassen wrote:

> On 21/12/2011, Joel Matthys <joel at matthysmusic.com> wrote:
> 
> > I think most people who want to do microtonal stuff will want to do it
> > with equal temperament, and that's already implemented. Scala files
> > aren't really suitable for microtonal because it's possible to define
> > vastly different interval sizes from one note to the next, so I think
> > anyone who tries it should be happy with what they get. The "purist"
> > approach would be your "brutal" method, (floor ) the keynum, but I think
> > a little interpolation would be nice.
> >
> 
> I agree. More strongly even; when we do want to be in a tuning and
> want to round floats we will most likely want to do that relative to
> some scale, not to the tuning itself.
> That way we could -for example- turn a scaled (sin (time)) in to a
> sort of melody.
> 
> Here is a part of a toolset I'm working on;
> 
> 
> 
> (define major (list 0 2 4 5 7 9 11))
> (define minor (list 0 2 3 5 7 9 11))
> (define acoustic (list 0 2 4 6 7 9 10))
> (define whole (list 0 2 4 6 8 10))
> 
> ;gets the nth note of a given scale
> (define (in-scale myscale note)
>     (let* ( (note (inexact->exact (round note)))
>             (l (length myscale))
>             (r (remainder note l)))
>         (+
>             (* (quotient note l) 12)
>             (if (negative? r)
>                 (- (list-ref myscale (+ l r)) 12)
>                 (list-ref myscale r)))))
> 
> ;rounds to the nearest note that is in the given scale
> (define (to-scale myscale x)
>     (let*  ((myscale (append myscale '(12)))
>             (ret 0)
>             (over (quotient (inexact->exact (round x)) 12))
>             (over (if (negative? x) (- over 1) over))
>             (x (- x (* 12 over))))
>         (for ((n (in-range 0 (length myscale))))
>             (when (<
>                     (abs (- (list-ref myscale n) x))
>                     (abs (- ret x)))
>                 (set! ret (list-ref myscale n))))
>         (+ ret (* over 12))))
> 
> 
> Might be interesting/fun/helpful. I'll publish the whole thing once
> I'm at least sure of it all myself and we can see whether others like
> it and perhaps push it in.
> 
> Yours,
> Kas.
> 


-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.pawfal.org/pipermail/fluxus-pawfal.org/attachments/20111221/df973c21/attachment.html>
-------------- next part --------------
A non-text attachment was scrubbed...
Name: scala.scm
Type: text/x-scheme
Size: 12717 bytes
Desc: not available
URL: <http://lists.pawfal.org/pipermail/fluxus-pawfal.org/attachments/20111221/df973c21/attachment-0003.bin>


More information about the Fluxus mailing list