Browse Source

function to get current cursor pitch, and a variant to get it as ly base note

master
Nils 2 years ago
parent
commit
80f8153e4f
  1. 13
      engine/api.py

13
engine/api.py

@ -932,6 +932,19 @@ def _setBlockData(block, newData):
#Cursor
def getCursorPitch():
keysig = session.data.currentTrack().state.keySignature()
return pitchmath.toScale(session.data.cursor.pitchindex, keysig)
def getCursorSimpleLyNote():
"""Return the note on the the cursor pitch position as simple lilypond note, without octave.
This is mainly intended for occasional GUI information display, such as in sub menus"""
pitch = getCursorPitch()
lyNote = pitchmath.pitch2ly[pitch].strip("'").strip(",").lower()
return lyNote
def left():
"""move the currently active tracks cursor one position to the left.
Can be directly used by a user interface"""

Loading…
Cancel
Save