variables

12 views
Skip to first unread message

Ole Schmidt

unread,
Oct 10, 2012, 2:40:45 PM10/10/12
to symbolic...@googlegroups.com
Hi,

I've made the following construction:

(setq beatlength '(1/8))

(defun restlength (x ) (* -1 (* x beatlength)))

(setq rhy2 (beatlength (restlength 13) beatlength (restlength 14) beatlength))

;what I want is this result:
;-->(1/8 -13/8 1/8 -7/4 1/8)

what is wrong (maybe simple)?

thanks

ole

pstone imap

unread,
Oct 10, 2012, 6:31:14 PM10/10/12
to symbolic...@googlegroups.com
(setq beatlength '1/8) ;<--

(defun restlength (x)
(* -1 (* x beatlength)))

or you can negate just with -

(defun restlength (x)
(- (* x beatlength)))

(setq rhy2 (list beatlength (restlength 13) beatlength (restlength 14) beatlength))
--> (1/8 -13/8 1/8 -7/4 1/8)

Peter
and if you are going to use beatlength 1/8..
(* -1 (* x (get-ratio beatlength)))
and if you want to use length as argument then (restlength (get-ratio '2/1…))
> --
> You received this message because you are subscribed to the Google Groups "Symbolic Composer" group.
> To post to this group, send email to symbolic...@googlegroups.com.
> To unsubscribe from this group, send email to symboliccompos...@googlegroups.com.
> For more options, visit this group at http://groups.google.com/group/symboliccomposer?hl=en.
>

Reply all
Reply to author
Forward
0 new messages