erka Posted August 14, 2015 Share Posted August 14, 2015 Hi, Just got the license and start getting into Opusmodus and lisp. The first task I try is to set the whole midirange to a tonality . I tried to write a function but somehow i only get part of the expected result. '(c0 d0 e0 f0) ; plays with Cmd-1 (setf pat1 (flatten(pitch-transpose-repeat '(c0 c1 c2 c3 c4 c5 c6 c7) (expand-chord-name '(major) :type :pitch)))) ;;(c1 d1 e1 f1 g1 a0 b0 c1 d1 e1 f1 g1 a1 b1 c2 d2 e2 f2 g2 a2 b2 c3 d3 e3 f3 g3 a3 b3 c4 d4 e4 f4 g4 a4 b4 c5 d5 e5 f5 g5 a5 b5 c6 d6 e6 f6 g6 a6 b6 c7 d7 e7 f7 g7 a7 b7 (defun gen-c0-scale ( shift chord_name &optional (ambituslist '(c0 b7)) ) (ambitus-remove ambituslist (pitch-transpose shift (flatten(pitch-transpose-repeat '(c0 c1 c2 c3 c4 c5 c6 c7) (expand-chord-name chord_name :type :pitch)))))) (setf pat2 (gen-c0-scale 0 '(major) )) ;;(c1 d1 e1 f1 g1 a0 b0 c1 d1 e1 f1 g1 a1 b1 c2 d2 e2 f2 g2 a2 b2 c3 d3 e3 f3 g3 a3 b3 c4 d4 e4 f4 g4 a4 b4 c5 d5 e5 f5 g5 a5 b5 c6 d6 e6 f6 g6 a6 b6 c7 d7 e7 f7 g7 a7 b7) (setf pat2 (gen-c0-scale 0 '(minor) )) ;;(c1 d1 eb1 f1 g1 gs1 bb0 c1 d1 eb1 f1 g1 gs1 bb1 c2 d2 eb2 f2 g2 gs2 bb2 c3 d3 eb3 f3 g3 gs3 bb3 c4 d4 eb4 f4 g4 gs4 bb4 c5 d5 eb5 f5 g5 gs5 bb5 c6 d6 eb6 f6 g6 gs6 bb6 c7 d7 eb7 f7 g7 gs7 bb7) (setf pat3 (gen-c0-scale 0 '(major) '(c1 b7) )) ;;(c1 d1 e1 f1 g1 c1 d1 e1 f1 g1 a1 b1 c2 d2 e2 f2 g2 a2 b2 c3 d3 e3 f3 g3 a3 b3 c4 d4 e4 f4 g4 a4 b4 c5 d5 e5 f5 g5 a5 b5 c6 d6 e6 f6 g6 a6 b6 c7 d7 e7 f7 g7 a7 b7) I wonder why pat1 starts with c1 and jumps to a0 . I guess there is a much better way to do that, that gives the expected result. Quote Link to comment Share on other sites More sharing options...
opmo Posted August 14, 2015 Share Posted August 14, 2015 (edited) Hi Rolf,You are not getting the expected result because the default ambitus in transposition functions is set to 'piano.Try this:(setf pat1 (flatten (pitch-transpose-start '(c0 c1 c2 c3 c4 c5 c6 c7) (gen-repeat 8 (expand-chord-name '(major) :type :pitch)) :ambitus '(c0 c8)))) and this:(defun gen-c0-scale (shift chord_name &optional (ambituslist '(c0 b7))) (ambitus-remove ambituslist (pitch-transpose shift (pitch-transpose-start '(c0 c1 c2 c3 c4 c5 c6 c7) (gen-repeat 8 (expand-chord-name chord_name :type :pitch)) :ambitus '(c0 c8)) :ambitus '(c0 c8)))) (gen-c0-scale 0 '(major)) => ((c0 d0 e0 f0 g0 a0 b0) (c1 d1 e1 f1 g1 a1 b1) (c2 d2 e2 f2 g2 a2 b2) (c3 d3 e3 f3 g3 a3 b3) (c4 d4 e4 f4 g4 a4 b4) (c5 d5 e5 f5 g5 a5 b5) (c6 d6 e6 f6 g6 a6 b6) (c7 d7 e7 f7 g7 a7 b7))Go to the 'System Function' library and check the TONALITY-MAP and TONALITY-SERIES functions. Edited August 14, 2015 by Janusz Podrazik Quote Link to comment Share on other sites More sharing options...
erka Posted August 16, 2015 Author Share Posted August 16, 2015 Thank you Janusz, I checked the TONALITY-MAP. Some parameter i didn't understand, but that is for the future. I tried: (filter-repeat 1 (tonality-map '(major :ambitus '(a0 c8)) (integer-to-pitch (gen-integer -39 48)))) => expected result (filter-repeat 1 (tonality-map '(major :ambitus '(c0 c8)) (integer-to-pitch (gen-integer -48 48)))) => returns notes starting with a0 here the :ambitus didn't do the trick. Is there a reason for not having the whole midi-range as default ambits? Is there a global-variable to set the default-ambitus? I will try ways, which helps me to get some experience with lisp- and opusmodus Quote Link to comment Share on other sites More sharing options...
opmo Posted August 16, 2015 Share Posted August 16, 2015 The ambitus span of the tonality is (-38 48) now, I will extend the span to (-48 48.) Results now: (filter-repeat 2 (tonality-map '(major :ambitus '(a0 c8)) (integer-to-pitch (gen-integer -39 48)))) => (a0 b0 c1 d1 e1 f1 g1 a1 b1 c2 d2 e2 f2 g2 a2 b2 c3 d3 e3 f3 g3 a3 b3 c4 d4 e4 f4 g4 a4 b4 c5 d5 e5 f5 g5 a5 b5 c6 d6 e6 f6 g6 a6 b6 c7 d7 e7 f7 g7 a7 b7 c8) (filter-repeat 1 (tonality-map '(major :ambitus '(c0 c8)) (integer-to-pitch (gen-integer -48 48)))) => (c0 d0 e0 f0 g0 a0 b0 c1 d1 e1 f1 g1 a1 b1 c2 d2 e2 f2 g2 a2 b2 c3 d3 e3 f3 g3 a3 b3 c4 d4 e4 f4 g4 a4 b4 c5 d5 e5 f5 g5 a5 b5 c6 d6 e6 f6 g6 a6 b6 c7 d7 e7 f7 g7 a7 b7 c8) Quote Link to comment Share on other sites More sharing options...
erka Posted August 18, 2015 Author Share Posted August 18, 2015 I just found out that I had my midi-range wrong (0-127) -> (-60 67). (midi-to-hertz '(0 48 60 127)) (pitch-to-hertz '(c-1 c0 c1 c4 c8 c9 g9)) (pitch-to-integer '(c-1 c0 c1 c4 c8 c9 g9)) All work with the whole range. (integer-to-pitch '(-60 -48 -36 0 48 60 67)) => (c-1 c0 c1 c4 c8 c9 g8) shifts above c9. (integer-to-pitch (gen-integer -60 67)) => (c-1 ........bb8 b8 c9 cs8 d8 eb8 e8 f8 fs8 g8) PITCH-TO-INTEGER works, INTEGER-TO-PITCH does not for the midi-(0-127). Maybe you could also expand INTEGER-TO-PITCH and TONALITY-MAP to (c-1 g9). I understand that when you compose for piano etc you don't need this range. As you have a MIDI-TO-HERTZ, why not those: defun midi-to-integer (midinrlist) (mapcar #'(lambda (x) (- x 60)) midinrlist)) (midi-to-integer '( 0 60 90 127)) (defun midi-to-pitch (midinrlist) (integer-to-pitch (mapcar #'(lambda (x) (- x 60)) midinrlist))) (midi-to-pitch '( 0 60 90 127)) Quote Link to comment Share on other sites More sharing options...
opmo Posted August 18, 2015 Share Posted August 18, 2015 In the real world the c-1 g9 range make not much sense :-) Quote Link to comment Share on other sites More sharing options...
Stephane Boussuge Posted August 18, 2015 Share Posted August 18, 2015 Be careful ! Don't try to define MIDI-TO-PITCH and MIDI-TO-INTEGER functions as you made in your post because you'll broke opusmodus midi-player because this functions are already defined into the internal system. SB. Quote Link to comment Share on other sites More sharing options...
opmo Posted August 18, 2015 Share Posted August 18, 2015 Thank you Stephane to point this out. Quote Link to comment Share on other sites More sharing options...
erka Posted August 18, 2015 Author Share Posted August 18, 2015 Thanks Stephane. Good to know. I agree Janusz, (c-1 g9) don't make sense in the real world. But they might in the midi-world. When you connect to ableton or Logic or else and have rigs with split keyboard or samples assigned. I plan to use opusmodus with my DAWs . That is even more confusing they have a range from C-2 to G8, all of them. MAX6, too. I just see that some functions work with the whole range and some don't. Is it possible that functions have different default ambitus? But I guess I should concentrate on other functions and just keep in the 'piano range for now. Thanks for the update. Quote Link to comment Share on other sites More sharing options...
opmo Posted August 18, 2015 Share Posted August 18, 2015 If a function has ambitus keyword, then the default is set to 'piano. You always can extend the ambitus. In the next update I will extend the tonality span to cover the entire midi range. erka and Stephane Boussuge 2 Quote Link to comment Share on other sites More sharing options...
erka Posted August 19, 2015 Author Share Posted August 19, 2015 Thanks Janusz. About the midi-functions. Is it the name of the function or what would ruin the midi engine? Couldn't the concept of packages be used to protect data and functions that are essential for the system from user manipulation? How can I know what functions are internal defined and shouldn't be altered ? (fboundp 'midi-to-pitch) I guess. If it is only the name I would just prefix all functions i define. Okay. Yes. I know. I should first get into all the defined functions and understand them and then build new ones. Quote Link to comment Share on other sites More sharing options...
opmo Posted August 19, 2015 Share Posted August 19, 2015 FBOUNDP is good way to see if true or nil.or you could use:(describe 'gen-weight) Quote Link to comment Share on other sites More sharing options...
erka Posted August 19, 2015 Author Share Posted August 19, 2015 the output is: Arglist: (Pizza Spagetti Chocolate Beer Burger Weißwurst &rest fat-objects ) Thanks. I also found when the function exists there is a auto-complete in the status-bar of the composer. I will have a look for that and use prefix for own functions. These (gen-weight and the twelve-tone-functions) are the kind of function I will have to look at. I bought Nigel Morgan's e-book "Parametric compositions". Very good. A little hard for me, the non academic theory trained. So I have to repeat reading while learning. Today I should get Dominik Sedivy's "Serial composition and Tonality" Stephane Boussuge 1 Quote Link to comment Share on other sites More sharing options...
opmo Posted August 19, 2015 Share Posted August 19, 2015 Dominik Sedivy's "Serial composition and Tonality" book is great indeed. 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.