Jump to content

Context Sensitive (uppercase) Substitute Map -


Recommended Posts

Dear All, 

 

I´m creating some permutations and I´d like to assign a text under each note to make clear the use of certain intervals.

substitute-map '(T 2M 3M 4J 5J 6M 7M) '(c3 d3 e3 f3 g3 a3 b3) '(c3 d3 e3 f3 g3 c3 c3 c3 g3 c3 c3 d3))

But in the evaluation, I get this:

(t 2m 3m 4j 5j t t t 5j t t 2m)

With lowercase letters, I get 2m , 3m and 5J instead of 2M, 3M and 5J (uppercase names of intervals).

 

Since I want it for pedagogical reasons, can it be generated with the corresponding UPPERCASE letters ?

 

Thanks in advance.

 

All the best,

Julio

 

 

Link to comment
Share on other sites

  • 2 months later...

Common Lisp does usually not distinguish between lower and upper case in its symbols. Standard Common Lisp compilers always return symbols with only upper case therefore by default, but Opusmodus seemingly does internally some trickery to change that to always lower case. 

 

It is possible with Common Lisp to specify symbols that distinguish between cases by wrapping the symbol names within bars (|) like so. 

 

? '|TesT|
|TesT|

? '(|TesT|)
(|TesT|)

 

Unfortunately, this does not to work fully in Opusmodus for all cases, possibly because of the internal symbol trickery that Opusmodus does.

 

? '|3M|
3m

 

This symbol does not require the bars in standard Common Lisp, because it only contains upper cases. However, the mentioned Opusmodus magic then turns this case down, so therefore this uppercase preservation does not work here. 😶

 

Summary: if you wrap your symbols in bars and use only symbols that contain both upper can lower case letters or only lowercase letters, the distinction works...

Link to comment
Share on other sites

Join the conversation

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

Guest
Reply to this topic...

×   Pasted as rich text.   Paste as plain text instead

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

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

×
×
  • Create New...

Important Information

Terms of Use Privacy Policy