Jump to content
Sign in to follow this  
Stoney

integer-to-pitch bug?

Recommended Posts

I just discovered that (from the doc for integer-to-pitch)

(integer-to-pitch '((-2 -1) 0 (1 2)))
=> (bb3b3 c4 cs4d4)

but

(integer-to-pitch '((-2 -1) (0 2) (1 2)))
=> ((bb3 b3) (c4 d4) (cs4 d4))

 

Unless at least one element is not a sublist, it fails to make chords. This seems inconsistent, and probably a bug.

This is in Opusmodus Version 1.3.24962

Share this post


Link to post
Share on other sites

No bug, there is a way to get the result you are looking for. If your list are lists only and you expect to get chords only then place the lists in additional list:

(integer-to-pitch '(((-2 -1) (0 2) (1 2))))
=> ((bb3b3 c4d4 cs4d4))

 

Share this post


Link to post
Share on other sites

That's good to know, and is simpler than my current workaround (add a 0 to the front of the list, then drop the leading c4 from the result).

 

Do you consider the inconsistency of the integer-to-pitch results a bug?

Share this post


Link to post
Share on other sites

> Do you consider the inconsistency of the integer-to-pitch results a bug?

 
I cannot speak for Janusz, but for me the format of the result makes sense. If there are individual values in the integer pitch list it is assume that the overall result is considered flat and hence sublists are chords. If everything is nested, then sublists are considered bars and the nesting is preserved.
 
Best,
Torsten
 

Share this post


Link to post
Share on other sites

Torsten, that makes sense. Thanks for the clarification!

Share this post


Link to post
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.

Sign in to follow this  

×
×
  • Create New...