Jump to content
Sign in to follow this  
AM

how to number pitches

Recommended Posts

i would like to number a pitch sequence, so that every pitch has a number which is written in the score (above the pitch). how can i do that...? 

any idea?

 

thanx for help

a.

 

 

 

Share this post


Link to post
Share on other sites
Posted (edited)

i know, but i would like to code it and not to write it by hand 🙂

 

here is the solution:

 

;;; THE NUM-FUCTION for ARTICULATION

(defun gen-num (n &key (start 0))
  (loop for i from start to n
    append (list (compress (list 'num i)))))
  
;;;

(setf pitches (loop repeat 20 collect (rnd-pick '(c4 d4 e4 f4))))
(setf articulation (gen-num (length pitches)))

(make-omn :pitch pitches 
          :articulation articulation
          :length '(t)
          :span :pitch)

=> (t f4 num0 e4 num1 c4 num2 d4 num3 e4 num4 f4 num5 d4 num6 d4 num7 f4 num8 f4 num9 c4 num10 d4 num11 e4 num12 d4 num13 f4 num14 f4 num15 e4 num16 d4 num17 e4 num18 c4 num19)

 

@janusz: it works like that... but num0, num1... stops at num100, higher numbers seems not to be possible... but i would need about 1000 🙂

 

Edited by AM

Share this post


Link to post
Share on other sites
Posted (edited)

thanks, so i have to code an algorithm to write such a library (till 1000) - or do it by hand 😉

any idea to code such a format? - i don't know how to code/write such a format with single lists (and not lists in lists) inside a function...

 

thanx for help

andré

Edited by AM

Share this post


Link to post
Share on other sites

the solution/most simple idea to generate a lot of numbers in/for  add-text-attributes is: 

1) generate by follwing FUNCTION => generates you how many you want... perhaps 100

 

(defun gen-num (n &key (start 0))
  (loop for i from start to n
    collect (list (compress (list 'nr i)))))

(gen-num 100)

=> ((nr0) (nr1) (nr2) (nr3) (nr4) (nr5) (nr6) (nr7) (nr8) (nr9) (nr10) (nr11) (nr12) (nr13) (nr14) (nr15) (nr16) (nr17) (nr18) (nr19) (nr20) (nr21) (nr22) (nr23) (nr24) (nr25) (nr26) (nr27) (nr28) (nr29) (nr30) (nr31) (nr32) (nr33) (nr34) (nr35) (nr36) (nr37) (nr38) (nr39) (nr40) (nr41) (nr42) (nr43) (nr44) (nr45) (nr46) (nr47) (nr48) (nr49) (nr50) (nr51) (nr52) (nr53) (nr54) (nr55) (nr56) (nr57) (nr58) (nr59) (nr60) (nr61) (nr62) (nr63) (nr64) (nr65) (nr66) (nr67) (nr68) (nr69) (nr70) (nr71) (nr72) (nr73) (nr74) (nr75) (nr76) (nr77) (nr78) (nr79) (nr80) (nr81) (nr82) (nr83) (nr84) (nr85) (nr86) (nr87) (nr88) (nr89) (nr90) (nr91) (nr92) (nr93) (nr94) (nr95) (nr96) (nr97) (nr98) (nr99) (nr100))

 

2) then delete the ( )-outside in the editor, so you will have:

 

(nr0) (nr1) (nr2) (nr3) (nr4) (nr5) (nr6) (nr7) (nr8) (nr9) (nr10) (nr11) (nr12) (nr13) (nr14) (nr15) (nr16) (nr17) (nr18) (nr19) (nr20) (nr21) (nr22) (nr23) (nr24) (nr25) (nr26) (nr27) (nr28) (nr29) (nr30) (nr31) (nr32) (nr33) (nr34) (nr35) (nr36) (nr37) (nr38) (nr39) (nr40) (nr41) (nr42) (nr43) (nr44) (nr45) (nr46) (nr47) (nr48) (nr49) (nr50) (nr51) (nr52) (nr53) (nr54) (nr55) (nr56) (nr57) (nr58) (nr59) (nr60) (nr61) (nr62) (nr63) (nr64) (nr65) (nr66) (nr67) (nr68) (nr69) (nr70) (nr71) (nr72) (nr73) (nr74) (nr75) (nr76) (nr77) (nr78) (nr79) (nr80) (nr81) (nr82) (nr83) (nr84) (nr85) (nr86) (nr87) (nr88) (nr89) (nr90) (nr91) (nr92) (nr93) (nr94) (nr95) (nr96) (nr97) (nr98) (nr99) (nr100)

 

3) use command-F to replace/change (  to  '(

   you get a list like:

'(nr0 "0") '(nr1 "1") '(nr2 "2") '(nr3 "3") '(nr4 "4") '(nr5 "5") '(nr6 "6") '(nr7 "7") '(nr8 "8") '(nr9 "9") '(nr10 "10") '(nr11 "11") '(nr12 "12") '(nr13 "13") '(nr14 "14") '(nr15 "15") '(nr16 "16") '(nr17 "17") '(nr18 "18") '(nr19 "19") '(nr20 "20") '(nr21 "21") '(nr22 "22") '(nr23 "23") '(nr24 "24") '(nr25 "25") '(nr26 "26") '(nr27 "27") '(nr28 "28") '(nr29 "29") '(nr30 "30") '(nr31 "31") '(nr32 "32") '(nr33 "33") '(nr34 "34") '(nr35 "35") '(nr36 "36") '(nr37 "37") '(nr38 "38") '(nr39 "39") '(nr40 "40") '(nr41 "41") '(nr42 "42") '(nr43 "43") '(nr44 "44") '(nr45 "45") '(nr46 "46") '(nr47 "47") '(nr48 "48") '(nr49 "49") '(nr50 "50") '(nr51 "51") '(nr52 "52") '(nr53 "53") '(nr54 "54") '(nr55 "55") '(nr56 "56") '(nr57 "57") '(nr58 "58") '(nr59 "59") '(nr60 "60") '(nr61 "61") '(nr62 "62") '(nr63 "63") '(nr64 "64") '(nr65 "65") '(nr66 "66") '(nr67 "67") '(nr68 "68") '(nr69 "69") '(nr70 "70") '(nr71 "71") '(nr72 "72") '(nr73 "73") '(nr74 "74") '(nr75 "75") '(nr76 "76") '(nr77 "77") '(nr78 "78") '(nr79 "79") '(nr80 "80") '(nr81 "81") '(nr82 "82") '(nr83 "83") '(nr84 "84") '(nr85 "85") '(nr86 "86") '(nr87 "87") '(nr88 "88") '(nr89 "89") '(nr90 "90") '(nr91 "91") '(nr92 "92") '(nr93 "93") '(nr94 "94") '(nr95 "95") '(nr96 "96") '(nr97 "97") '(nr98 "98") '(nr99 "99") '(nr100 "100")

 

4) you could paste that inside 

(add-text-attributes

;; PASTE IT IN HERE

)

 

so it's done easily by hand ->  in that way i could number about 1500 pitches 🙂

(with FORMAT-function i have no idea to code it)

 

Share this post


Link to post
Share on other sites

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now
Sign in to follow this  

×