bugDenemo - Bugs: bug #28435, Transposing script

 
 

bug #28435: Transposing script

Submitted by:  None
Submitted on:  Wed 30 Dec 2009 03:44:39 AM UTC  
 
Category: Feature requestSeverity: 3 - Normal
Item Group: NoneStatus: Fixed
Privacy: PublicAssigned to: None
Open/Closed: Closed

Add a New Comment(Rich Markup)
   

You are not logged in

Please log in, so followups can be emailed to you.

 

Wed 30 Dec 2009 02:40:56 PM UTC, comment #2:

I just tried this, and it worked, but I had to select a single staff at a time. That would be a single voice in fact. The script could be improved in this respect.
Be aware that there are also print transpositions, where your music is left intact, and only the print out is transposed.

Richard Shann <rshann>
Project Administrator
Wed 30 Dec 2009 04:17:19 AM UTC, comment #1:

Transposition does work. Use it like this:
Select what you want to transpose with the mouse. In the menu click on Edit->Transpose->Transpose Selection

Then in the dialog pretend that if the note "c'" appeared in the music what would it appear as once transposed. So if you are in the key of f major and you wanted to move to g major you would put it "d'". Chords can be transposed with it as well as monophonic lines.

Jeremiah Benham <jjbenham>
Project Administrator
Wed 30 Dec 2009 03:44:39 AM UTC, original submission:

Do the denemo transposition commands work? I couldn't figure them out if so. This script will only transpose monophonic lines. It makes a mess on chords--I guess that's why the DiatonicShift command is deprecated?? Not sure at the moment how to extend it to chords. If the denemo commands don't work I think this would work for now. I'm new to scheme so maybe the defines shouldn't be used.

Here's the xml from the command set:

<row>
<action>Transpose</action>
<scheme></scheme>
<menupath>/ObjectMenu/NotesRests</menupath>
<label>Transpose</label>
<tooltip>Transposes from the cursor to the end of the staff. Use only on single voices-no chords.</tooltip>
</row>

The script is attached and pasted here-Dan W.

<?xml version="1.0"?>
<Denemo>
<merge>
<title>A Denemo Keymap</title>
<author>DRW</author>
<map>
<row>
<action>Transpose</action>
<scheme>(define (transpose DiatonicInterval ChromaticInterval )
(let ((OldNote 0)(TargetNote 0) )
(set! OldNote (d-GetNoteAsMidi))
(set! TargetNote (+ OldNote ChromaticInterval) )
(d-DiatonicShift DiatonicInterval )
(if (&lt; (d-GetNoteAsMidi) TargetNote ) (d-Sharpen) )
(if (&lt; (d-GetNoteAsMidi) TargetNote ) (d-Sharpen) )
(if (&gt; (d-GetNoteAsMidi) TargetNote ) (d-Flatten) )
(if (&gt; (d-GetNoteAsMidi) TargetNote ) (d-Flatten) )
)
)

(define (TransposeAll DiatonicInterval ChromaticInterval )
; (transpose DiatonicInterval ChromaticInterval)
(do ((i #t (d-CursorRight) ))
( (equal? i #f) #f)
(if (equal? (d-GetType) "CHORD" )
(transpose DiatonicInterval ChromaticInterval )
)
)
)

(let
((X "") (IntervalStep "")(Modifier 0) (IntervalType "")(TypeString "") (IntervalDirection "Up" )(DiatonicInterval "-1")(ChromaticInterval -2)
(IntervalList '(("Second" "1" 2) ("Third" "2" 4)("Unison" "0" 0)("Fourth" "3" 5)("Fifth" "4" 7)("Sixth" "5" 9)("Seventh" "6" 11) ("Octave" "7" 12) ))
)
(set! IntervalStep (d-GetOption (string-append "Unison" stop "Second" stop "Third" stop "Fourth" stop "Fifth" stop "Sixth" stop "Seventh" stop "Octave" stop) ) )
(if (member IntervalStep '("Second" "Third" "Sixth" "Seventh" ) )
(set! TypeString (string-append "Major" stop "Minor" stop )) (set! TypeString (string-append "Perfect" stop) ) )

(set! TypeString (string-append TypeString "Augmented" stop ) )
(if (not (equal? IntervalStep "Unison" )) (set! TypeString (string-append TypeString "Diminished" stop) ))
(set! IntervalType (d-GetOption TypeString))
(set! IntervalDirection (d-GetOption (string-append "Up" stop "Down" stop)))
(set! X (assoc IntervalStep IntervalList ) )
(set! DiatonicInterval (car (cdr X)) )
(set! ChromaticInterval (car (cdr (cdr X))))
(if (equal? IntervalType "Augmented" ) (set! Modifier 1) )
(if (equal? IntervalType "Minor" ) (set! Modifier -1) )
(if (equal? IntervalType "Diminished") (set! Modifier ( if (member IntervalStep '("Second" "Third" "Sixth" "Seventh" ) ) -2 -1 ) ) )
(set! ChromaticInterval (+ ChromaticInterval Modifier) )
(if (equal? IntervalDirection "Down" )
(begin
(set! DiatonicInterval (string-append "-" DiatonicInterval ))
(set! ChromaticInterval ( * ChromaticInterval -1) )
)
)
(TransposeAll DiatonicInterval ChromaticInterval)
)</scheme>
<label>Transpose</label>
<tooltip>Transposes from the cursor to the end of the staff. Use only on single voices-no chords.</tooltip>
</row>
</map>
</merge>
</Denemo>

Anonymous

 

(Note: upload size limit is set to 16384 kB, after insertion of the required escape characters.)

Attach File(s):
   
   
Comment:
   

Attached Files
file #19392:  Transpose added by None (3KiB - application/octet-stream)

 

Depends on the following items: None found

Items that depend on this one: None found

 

Carbon-Copy List
  • -unavailable- added by steele (Updated the item)
  • -unavailable- added by rshann (Posted a comment)
  • -unavailable- added by jjbenham (Posted a comment)
  •  

    Do you think this task is very important?
    If so, you can click here to add your encouragement to it.
    This task has 0 encouragements so far.

    Only logged-in users can vote.

     

    Please enter the title of George Orwell's famous dystopian book (it's a date):

     

     

    Follow 3 latest changes.

    Date Changed By Updated Field Previous Value => Replaced By
    Sat 04 Dec 2010 01:00:02 PM UTCsteeleOpen/ClosedOpen=>Closed
    Wed 30 Dec 2009 02:40:56 PM UTCrshannStatusNone=>Fixed
    Wed 30 Dec 2009 03:44:40 AM UTCNoneAttached File-=>Added Transpose, #19392

    Back to the top


    Powered by Savane 3.1-cleanup1