mask by length value

7 views
Skip to first unread message

ole

unread,
Sep 14, 2013, 11:27:29 AM9/14/13
to symbolic...@googlegroups.com
Hi,

I have a list like this:

(1/20 1/20 1/20 1/20 1/20 1/12 1/12 1/12 1/16 1/16 1/16 1/16 1/8 1/8 1/8 1/8)

and want an additional list like this:

(1/20 1/20 1/20 1/20 1/20 -1/12 -1/12 -1/12 1/16 1/16 1/16 1/16 -1/8 -1/8 -1/8 -1/8)

every value which is greater than 1/16 changed into a rest

I've done that before, but can not remember how..?

But then I'am running into the next problem: how can I make the new length list with rests in it
have in sync with the (old) symbol list (so that the same symbols are mapped to the same rhythms- only some of them are "muted")?


Example:

(a b c d)
(1/4 1/4 1/4 1/4)

changed into
(a b c d)
(1/4 -1/4 1/4 1/4)

this does not work, nor does (a = c d) (so symbol-swallow seems not appropriate here..)
what I need is (a c d) instead, is there a way to tell SCOM that if the length value is negative the associated symbol should be swallowed instead of pushed into the next non-negative slot?

I'd like to have the symbols and length values glued together from a very early point on and then processing them in sync..how can I do that?

thanks,

ole





ole

unread,
Sep 14, 2013, 5:31:34 PM9/14/13
to symbolic...@googlegroups.com
to answer my own question again:

I solved it like this:

(setq symb '(s c h o e n e r w i t z u n b e d e u t e n d e r s c h e i n t))

(setq rhy '(1/20 1/20 1/20 1/20 1/20 1/12 1/12 1/12 1/16 1/16 1/16 1/16 1/8 1/8 1/8 1/8 1/16 1/16 1/16 1/16 1/12 1/12 1/12 1/8 1/8 1/28 1/28 1/28 1/28 1/28 1/28 1/28))

(defun gross (z)
(if (> 1/12 z) z (* z -1)))

(setq rhy1 (mapcar 'gross rhy))
(setq symb1 (symbol-swallow rhy1 symb))
;and now built the new voice with the old length list (rhy) and the new symbol list..

But it seems a bit cumbersome to me, maybe the function should be a lamda function? Also it would be nice to have the length value in the function also as a variable, but I don't know how to handle that with mapcar..

greetz

ole
> --
> You received this message because you are subscribed to the Google Groups "Symbolic Composer" group.
> To unsubscribe from this group and stop receiving emails from it, send an email to symboliccompos...@googlegroups.com.
> To post to this group, send email to symbolic...@googlegroups.com.
> Visit this group at http://groups.google.com/group/symboliccomposer.
> For more options, visit https://groups.google.com/groups/opt_out.

pstone imap

unread,
Sep 14, 2013, 7:01:29 PM9/14/13
to symbolic...@googlegroups.com
this way

(defun restify> (val lengths)
  (mapcar #'(lambda (x)
              (if (>= (get-ratio x) (get-ratio val))
                (- (get-ratio x))
                x))
          lengths))

(restify> '1/12
          '(1/20 1/20 1/20 1/20 1/20 1/12 1/12 1/12 1/16 1/16 1/16 1/16 1/8 1/8 1/8 1/8))
--> (1/20 1/20 1/20 1/20 1/20 -1/12 -1/12 -1/12 1/16 1/16 1/16 1/16 -1/8 -1/8 -1/8 -1/8)

change >= test to <= and you get restify<

this does not work, nor does (a = c d) (so symbol-swallow seems not appropriate here..)
what I need is (a c d) instead, is there a way to tell SCOM that if the length value is negative the associated symbol should be swallowed instead of pushed into the next non-negative slot?

how about deleting the rest

(delete '= (symbol-swallow '(1/4 -1/4 1/4 1/4) '(a b c d)))
--> (a c d)

I'd like to have the symbols and length values glued together from a very early point on and then processing them in sync..how can I do that?

motives do that, but you need to define your own sync methods that do what you want them to do, it's much more practical to keep sections and stuff short and sync them in the head-space, and then just chain sections together

Peter

Reply all
Reply to author
Forward
0 new messages