Skip to content

Commit

Permalink
Fix jwdj#117 playback not working in some cases with selection
Browse files Browse the repository at this point in the history
  • Loading branch information
aupfred committed Feb 24, 2025
1 parent ae39869 commit 89e857a
Show file tree
Hide file tree
Showing 2 changed files with 7 additions and 2 deletions.
1 change: 1 addition & 0 deletions CHANGES
Original file line number Diff line number Diff line change
Expand Up @@ -643,3 +643,4 @@ different panes. Tie/untie option added for notes. Broken rhythm
- Enable Midi playback for Mac based on Apple DLS Synthetiser thanks to mplay library (aupfred)
- Fix Musicscore gets blank when clicking on the musicpanel (aupfred)
- Updated about page and abc reference (aupfred)
- Fix playing issue on selection when no extra header lines to be created by EasyABC (aupfred)
8 changes: 6 additions & 2 deletions easy_abc.py
Original file line number Diff line number Diff line change
Expand Up @@ -1195,7 +1195,8 @@ def process_abc_for_midi(abc_code, header, cache_dir, settings, tempo_multiplier
#### create the abc_header which will be placed in front of the processed abc file
# extra_lines is a list of all the MIDI commands to be put in abcheader

extra_lines = []
#FAU: enforce at least one extra_lines to avoid to introduce a blank line
extra_lines = ['%']

# build default list of midi_program
# this is needed in case no instrument per voices where defined or in case option "separate defaults per voice" is not checked
Expand Down Expand Up @@ -4342,7 +4343,10 @@ def GetAbcToPlay(self):

# for some strange reason the MIDI sequence seems to be cut-off in the end if the last note is short
# adding a silent extra note seems to fix this
text = text + os.linesep + '%%MIDI control 7 0' + os.linesep + 'A2'
#text = text + os.linesep + '%%MIDI control 7 0' + os.linesep + 'A2'
#FAU: the introduction of the previous line leads to have no sound at all on
# selection. using embedded instruction doesn' work either Thus remove it
text = text.rstrip()# + '[I:MIDI control 7 0]' + os.linesep + 'A2'

return (tune, text)
return (tune, self.editor.GetTextRange(position, end_position))
Expand Down

0 comments on commit 89e857a

Please sign in to comment.