# 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 on other sites

`(q c4 num0 cs4 num1 d4 num2)`

or create you own articulations, do check the docs.

##### Share on other sites

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 on other sites

create you﻿ own text articulations﻿:

```(add-text-attributes
'(nr0 "0")
'(nr1 "1")
)```

##### Share on other sites

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 on other sites

• 2 months later...

this is the simple solution...

```(defun add-numbers-to-text-attributes (a b)
(loop for i from a to b
append (add-text-attributes (list (compress (list 'nr i)) (write-to-string i)))))

=> (nr12 nr13 nr14 nr15 nr16 nr17 nr18 nr19 nr20 nr21 nr22 nr23)```

## Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

×   Pasted as rich text.   Paste as plain text instead

Only 75 emoji are allowed.

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

×
×
• #### Browser

• Video Gallery

• Lessons