Open Key

john.yull's Avatar

john.yull

25 Sep, 2015 01:12 AM

I love the simplicity of the stripped down Open Key notation. When I have time I just analyze the key of my new tracks with Beautunes and have it add the Open key to the beginning of comments field. Only problem is I need parentheses around the open key otherwise 2d will yield 2d and 12d in my smart search. Need the (2d). Otherwise, excellent work.

  1. Support Staff 1 Posted by hendrik on 25 Sep, 2015 06:11 AM

    hendrik's Avatar

    Hey John,

    customizing key rendering is trivial using a KeyTextRenderer. The Key class is documented here. And the Groovy code looks like this (also attached):

    import com.tagtraum.audiokern.key.Key
    import com.tagtraum.beatunes.KeyTextRenderer
    
    class BracedOpenKey implements KeyTextRenderer {
    
        /**
         * Create a textual representation for a Key object.
         *
         * @param key key
         * @return textual representation
         */
        def String toKeyString(Key key) {
            String openKeyCode = key.getOpenKeyCode()
            // create the final string
            return "($openKeyCode)"
        }
    
        /**
         * Create a tooltip representation for a key object.
         * This may also include html-tags.
         *
         * @param key key
         * @return tooltip representation
         */
        def String toToolTip(Key key) {
            toKeyString(key)
        }
    
        /**
         * Short name of this renderer. To be used in the user interface.
         *
         * @return name
         */
        def String getName() {
            "Braced OpenKey"
        }
    
    }
    

    Just install it as a plugin.

    Cheers,

    -hendrik

  2. 2 Posted by john.yull on 25 Sep, 2015 06:04 PM

    john.yull's Avatar

    Worked like a charm. Thanks

  3. Support Staff 3 Posted by hendrik on 25 Sep, 2015 06:05 PM

    hendrik's Avatar

    Great! :-)

  4. hendrik closed this discussion on 25 Sep, 2015 06:05 PM.

Comments are currently closed for this discussion. You can start a new one.

Keyboard shortcuts

Generic

? Show this help
ESC Blurs the current field

Comment Form

r Focus the comment reply box
^ + ↩ Submit the comment

You can use Command ⌘ instead of Control ^ on Mac