JulioHerrlein Posted December 30, 2022 Share Posted December 30, 2022 Dear Friends , I have this question regarding Get-Beats Function. All the best ! Julio ;;; THIS WORKS ! (setf omn-forum '((h b4 s d5 mf ord g5 ord c5 ord e. a5 ord s b5 ord e5 ord fs5 ord d5 ord e g5 f stacc c5 stacc a5 stacc - b5 stacc q e5 mf ord)(h bb4 s d5 mf ord gb5 ord c5 ord e. ab5 ord s b5 ord e5 ord fs5 ord d5 ord e g5 f stacc c5 stacc a5 stacc - b5 stacc q eb5 mf ord)) (get-beats '( (1 1 (1 2 4 7 5 8 6 3)) (1 2 (1 2 4 4 4 7 6 3))) omn-forum) ;;; But THIS WON´T WORK - Why ? (setf bts (rnd-unique 8 '(4 7 5 8 3 6 1 2))) (get-beats '( (list 1 1 bts) (1 2 (1 2 4 4 4 7 6 3))) omn-forum) Quote Link to comment Share on other sites More sharing options...
opmo Posted December 30, 2022 Share Posted December 30, 2022 (get-beats (list (list 1 1 bts) '(1 2 (1 2 4 4 4 7 6 3))) omn-forum) JulioHerrlein 1 Quote Link to comment Share on other sites More sharing options...
JulioHerrlein Posted December 30, 2022 Author Share Posted December 30, 2022 Thanks a lot ! Happy 2023 ! Julio Quote Link to comment Share on other sites More sharing options...
JulioHerrlein Posted January 2 Author Share Posted January 2 Dear friends, Is there a way to use the rnd-beat-order function but specifying a list of beats ? The get-beats is the way in this case ? Or there is such a function like beat-order ? or maybe a space for determining the order inside the rnd-beat-order function ? In negative case, I´ll use the get-beats for doing this. All the best ! Julio Quote Link to comment Share on other sites More sharing options...
JulioHerrlein Posted January 2 Author Share Posted January 2 Dear friends, A LISP question... ;;; Dear Friends, ; LISP question for using with get-beats ;;; voice and bar list ((1 1) (1 2) (1 3) (1 4) (1 5)) ;;; beats ((1 2) (1 2 3 4 5 6 7 8) (1 2) (1 2 3 4 5 6 7 8) (1 2)) ;;; matrix result (matrix-transpose '(((1 1) (1 2) (1 3) (1 4) (1 5)) ((1 2) (1 2 3 4 5 6 7 8) (1 2) (1 2 3 4 5 6 7 8) (1 2)))) ;;; desired result to use in gen-beats ((1 1 (1 2)) (1 2 (1 2 3 4 5 6 7 8)) (1 3 (1 2)) (1 4 (1 2 3 4 5 6 7 8)) (1 5 (1 2))) ;;; how can I achieve the last result in LISP ? That kind of list, like (x x ( y z)) kind of list ? ;;; Best ! Summarizing... How to transform this (((1 1) (1)) ((1 2) (1 3 5 7)) ((1 3) (1)) ((1 4) (1 3 5 7))) into this ((1 1 (1)) ((1 2 (1 3 5 7)) ((1 3 (1)) ((1 4 (1 3 5 7)) How is the name of this type of list ? Best ! Quote Link to comment Share on other sites More sharing options...
JulioHerrlein Posted January 2 Author Share Posted January 2 This is a suggestion for a function like get-bars-beats to be used in conjunction with get-beats ;;;This is an idea to get all the bars and beats from an OMN expression to be used/edited with GEN-BEATS (progn (setf omn-idea (gen-repeat 5 '((q b4 p<f tie+long) (q b4 s d5 mf ord g5 ord c5 ord e. a5 ord s b5 ord e5 ord fs5 ord d5 ord e g5 stacc c5 stacc a5 stacc - b5 stacc q e5 ord) (q gb4 p<f tie+long) (q gb4 s fs5 mf ord cs5 ord gs5 ord e. f5 ord s eb5 ord bb5 ord c5 ord fs5 ord e cs5 stacc gs5 stacc f5 stacc - eb5 stacc q bb5 ord) (q as4 p<f tie+long)))) (setf all-bars (cdr (gen-divide 2 (flatten (matrix-transpose (list (gen-divide 1 (gen-repeat (get-count (get-count omn-idea)) '(1))) (gen-divide 1 (gen-integer (get-count (get-count omn-idea)))))))))) (setf beats-zerobase (loop for i in (find-everyother 3 (flatten (get-time-signature (gen-divide 1 (get-span omn-idea))))) collect (gen-integer i))) (setf all-beats (gen-divide (get-count beats-zerobase) (loop for i in (flatten beats-zerobase) collect (+ 1 i)))) (setf all-bars-n-beats (matrix-transpose (list all-bars all-beats))) ) The result is this (((1 1) (1 2)) ((1 2) (1 2 3 4 5 6 7 8)) ((1 3) (1 2)) ((1 4) (1 2 3 4 5 6 7 8)) ((1 5) (1 2)) ((1 6) (1 2 3 4 5 6 7 8)) ((1 7) (1 2)) ((1 (1 2 3 4 5 6 7 8)) ((1 9) (1 2)) ((1 10) (1 2 3 4 5 6 7 8)) ((1 11) (1 2)) ((1 12) (1 2 3 4 5 6 7 8)) ((1 13) (1 2)) ((1 14) (1 2 3 4 5 6 7 8)) ((1 15) (1 2)) ((1 16) (1 2 3 4 5 6 7 8)) ((1 17) (1 2)) ((1 18) (1 2 3 4 5 6 7 8)) ((1 19) (1 2)) ((1 20) (1 2 3 4 5 6 7 8)) ((1 21) (1 2))) Not yet appropriate to use in GET-BEATS, but close... All this could be made inside one function, to extract, bars and beats in the form of GET-BEATS function. Best, Julio Quote Link to comment Share on other sites More sharing options...
opmo Posted January 3 Share Posted January 3 (defparameter b-val (matrix-transpose '(((1 1) (1 2) (1 3) (1 4) (1 5)) ((1 2) (1 2 3 4 5 6 7 8) (1 2) (1 2 3 4 5 6 7 8) (1 2))))) (loop for i in b-val for j = (first i) collect (list (first j) (second j) (second i))) => ((1 1 (1 2)) (1 2 (1 2 3 4 5 6 7 8)) (1 3 (1 2)) (1 4 (1 2 3 4 5 6 7 8)) (1 5 (1 2))) JulioHerrlein 1 Quote Link to comment Share on other sites More sharing options...
JulioHerrlein Posted January 3 Author Share Posted January 3 Thanks a lot, Janusz ! (get-bars-beats) would be useful and easier ! Best ! Julio Quote Link to comment Share on other sites More sharing options...
Recommended Posts
Join the conversation
You can post now and register later. If you have an account, sign in now to post with your account.