GithubHelp home page GithubHelp logo

Fails to run on Python 3.11 about easyabc HOT 31 OPEN

topchyan avatar topchyan commented on August 22, 2024
Fails to run on Python 3.11

from easyabc.

Comments (31)

revad avatar revad commented on August 22, 2024 1

There's one change to re in Py11 which looks like it might relate to the long regex starting on line 8 of abc_search.py and seems to match the error:
https://docs.python.org/3.11/library/re.html
https://github.com/jwdj/EasyABC/blob/master/abc_search.py

I wonder if it's those ?(m) entries in two of the lines?

from easyabc.

mmehl avatar mmehl commented on August 22, 2024 1

problem with zoom slider (see ) shows ticks, which is not really needed /useful.

remove command wx_slider_set_tick_freq(self.zoom_slider, 10)

diff --git a/easy_abc.py b/easy_abc.py
index cc662e8..112e3f0 100644
--- a/easy_abc.py
+++ b/easy_abc.py
@@ -4807,9 +4807,8 @@ class MainFrame(wx.Frame):
 
         self.toolbar.AddSeparator()
 
-        self.zoom_slider = self.add_slider_to_toolbar(_('Zoom'), False, value=1000, minValue=500, maxValue=3000, size=(130, -1), style=wx.SL_HORIZONTAL)
+        self.zoom_slider = self.add_slider_to_toolbar(_('Zoom'), False, value=1000, minValue=500, maxValue=3000, size=(130, -1))
 
-        wx_slider_set_tick_freq(self.zoom_slider, 10)
         self.Bind(wx.EVT_SLIDER, self.OnZoomSlider, self.zoom_slider)
         self.zoom_slider.Bind(wx.EVT_LEFT_DOWN, self.OnZoomSliderClick)

from easyabc.

topchyan avatar topchyan commented on August 22, 2024

scipy/scipy#16988

from easyabc.

topchyan avatar topchyan commented on August 22, 2024

Definitely a bug in Python 3.11

python/cpython#98740

Wonder if this code could be simplified and/or re-written in a way to avoid this bug going forward.

from easyabc.

revad avatar revad commented on August 22, 2024

I don't have Python 3.11 but I have Python 3.10:

Python 3.10.13 (main, Sep 05 2023, 11:46:10) [GCC] on linux
Type "help", "copyright", "credits" or "license" for more information.

import re
remove_non_notes = re.compile(r'(?xm)' + '|'.join([
... r'%%beginps(.|\s)+?%%endps', # remove embedded postscript
... r'%%begintext(.|\s)+?%%endtext', # remove text
... r'[\w:.?]', # remove embedded fields
... r'(?m)^\w:.
?$', # remove normal fields
... r'(?m)%.$', # remove comments
... r'[\w:.
?]', # remove embedded fields
... r'\"', # remove escaped " characters
... r'".?"', # remove strings
... r'\"', # remove escaped quote characters
... r'{.
?}', # remove grace notes
... r'!.+?!', # remove ornaments like eg. !pralltriller!
... r'+.+?+', # remove ornaments like eg. +pralltriller+
... r'{.*?}', # remove grace notes
... ]))
:1: DeprecationWarning: Flags not at the start of the expression '(?xm)\%\%beginps(.|\' (truncated) but at position 78
:1: DeprecationWarning: Flags not at the start of the expression '(?xm)\%\%beginps(.|\' (truncated) but at position 91

Try removing those two ?(m) in the middle.
Would the initial ?(m) not apply to the entire expression, in which case they're redundant?

from easyabc.

bomm avatar bomm commented on August 22, 2024

Assuming that the initial (?xm) will apply to all sub-expressions, removing the later (?m) would not change the behavior.
Open questions: Was the behavior always the same or was it possible to set flags for sub-expressions in older Python versions? Or would the intention of the expression require different flags for sub-expressions?

from easyabc.

topchyan avatar topchyan commented on August 22, 2024

Try removing those two ?(m) in the middle. Would the initial ?(m) not apply to the entire expression, in which case they're redundant?

I tried just that and ended up with a lot more errors on other places (easy_abc.py line 8772 OnInit event is now at fault. Anyway, probably something maintainer should take a look at.

from easyabc.

revad avatar revad commented on August 22, 2024

This was seen on Windows:
https://sourceforge.net/p/easyabc/tickets/54
See Lars' error log

from easyabc.

mmehl avatar mmehl commented on August 22, 2024

I made two changes to adapt the code for python 3.11.6 on ubuntu:

  1. Removed (?m) in middle of regex:
diff --git a/abc_search.py b/abc_search.py
index 70c3756..4c6487c 100644
--- a/abc_search.py
+++ b/abc_search.py
@@ -9,8 +9,8 @@ remove_non_notes = re.compile(r'(?xm)' + '|'.join([
                r'\%\%beginps(.|\s)+?\%\%endps',  # remove embedded postscript
                r'\%\%begintext(.|\s)+?\%\%endtext',   # remove text
                r'\[\w:.*?\]',    # remove embedded fields
-               r'(?m)^\w:.*?$',  # remove normal fields
-               r'(?m)%.*$',      # remove comments
+               r'^\w:.*?$',  # remove normal fields
+               r'%.*$',      # remove comments
                r'\[\w:.*?\]',    # remove embedded fields
                r'\\"',           # remove escaped " characters
                r'".*?"',         # remove strings
  1. removed "U" in io.open:
diff --git a/tune_elements.py b/tune_elements.py
index c8aef80..1221833 100644
--- a/tune_elements.py
+++ b/tune_elements.py
@@ -1081,7 +1081,7 @@ class AbcStructure(object):
     @staticmethod
     def get_sections(cwd):
         # [1.3.6.2 [JWDJ] bugfix This fixes 'str>ng' in Fields and Command Reference
-        reference_content = io.open(os.path.join(cwd, 'reference.txt'), 'rU', encoding='latin-1').read()
+        reference_content = io.open(os.path.join(cwd, 'reference.txt'), 'r', encoding='latin-1').read()
         if AbcStructure.replace_regexes is None:
             AbcStructure.replace_regexes = [
                 (re.compile(r'\bh((?:bass/chord|length|logical|string|int|fl-?\n?oat\s?|command|str|text|vol|h|n|char|clef|bass|chord)\d*\s?(?: (?:string|int|float)\d*?)*)i\b'), r'<\1>'),  # enclose types with < and >

from easyabc.

topchyan avatar topchyan commented on August 22, 2024

I tried it on MX Linux (Debian) using your suggestions and though the program opened, the ABC settings tab looked really weird: only 2 tabs were visible okay, others had all controls mashed together (I couldn't take a picture, tried it on a live USB just to see how it would work). I launched it form the terminal and saw a lot of errors pointing to rcsizer.py

from easyabc.

mmehl avatar mmehl commented on August 22, 2024

About rcsizer.py there is a hint to migrate to wx.GridBagSizer:
https://discuss.wxpython.org/t/facing-an-error-in-wx-library-file-rcsizer-py/36685

from easyabc.

revad avatar revad commented on August 22, 2024

I get the mis-sized settings window in python 3.10 on SuSE. I haven't bothered to diagnose it - I just make them bigger to use them, and they work OK. I have more important problems to solve!

@mmehl - is it using fluidsynth? (#79)? What version of wxPython?

from easyabc.

mmehl avatar mmehl commented on August 22, 2024

here is the change to replace rcsizer with GridBagSizer:

  • remove import wx.lib.rcsizer as rcs
  • replace rcs.RowColSizer() with wx.GridBagSizer()
  • replace row=r, col=c with pos=(r, c)
  • replace colspan=x with span=(0,x)
diff --git a/easy_abc.py b/easy_abc.py
index d0fe505..cc662e8 100644
--- a/easy_abc.py
+++ b/easy_abc.py
@@ -92,7 +92,6 @@ from wx.lib.scrolledpanel import ScrolledPanel
 import wx.html
 import wx.stc as stc
 import wx.lib.agw.aui as aui
-import wx.lib.rcsizer as rcs
 # import wx.lib.filebrowsebutton as filebrowse # 1.3.6.3 [JWdJ] 2015-04-22
 import wx.lib.platebtn as platebtn
 import wx.lib.mixins.listctrl as listmix
@@ -1924,7 +1923,7 @@ class IncipitsFrame(wx.Dialog):
         wx.Dialog.__init__(self, parent, wx.ID_ANY, _('Generate incipits file...'), wx.DefaultPosition, wx.Size(530, 260))
         self.SetBackgroundColour(dialog_background_colour)
         border = control_margin
-        sizer = box1 = rcs.RowColSizer()
+        sizer = box1 = wx.GridBagSizer()
         lb1 = wx.StaticText(self, wx.ID_ANY, _('Number of bars to extract:'))
         lb2 = wx.StaticText(self, wx.ID_ANY, _('Maximum number of repeats to extract:'))
         lb3 = wx.StaticText(self, wx.ID_ANY, _('Maximum number of titles/subtitles to extract:'))
@@ -1940,17 +1939,17 @@ class IncipitsFrame(wx.Dialog):
         for c in [self.edNumBars, self.edNumRepeats, self.edNumTitles, self.edNumRows, self.edSortFields]:
             c.SetValue(c.GetValue()) # this seems to be needed on OSX
 
-        sizer.Add(lb1,                  row=0, col=0, flag=wx.ALL | wx.ALIGN_CENTER_VERTICAL, border=border)
-        sizer.Add(self.edNumBars,       row=0, col=1, flag=wx.EXPAND | wx.ALL | wx.ALIGN_CENTER_VERTICAL, border=border)
-        sizer.Add(lb2,                  row=1, col=0, flag=wx.ALL | wx.ALIGN_CENTER_VERTICAL, border=border)
-        sizer.Add(self.edNumRepeats,    row=1, col=1, flag=wx.EXPAND | wx.ALL | wx.ALIGN_CENTER_VERTICAL, border=border)
-        sizer.Add(lb3,                  row=2, col=0, flag=wx.ALL | wx.ALIGN_CENTER_VERTICAL, border=border)
-        sizer.Add(self.edNumTitles,     row=2, col=1, flag=wx.EXPAND | wx.ALL | wx.ALIGN_CENTER_VERTICAL, border=border)
-        sizer.Add(lb4,                  row=3, col=0, flag=wx.ALL | wx.ALIGN_CENTER_VERTICAL, border=border)
-        sizer.Add(self.edSortFields,    row=3, col=1, flag=wx.EXPAND | wx.ALL | wx.ALIGN_CENTER_VERTICAL, border=border)
-        sizer.Add(self.chkTwoColumns,   row=4, col=1, flag=wx.EXPAND | wx.ALL | wx.ALIGN_CENTER_VERTICAL, border=border)
-        sizer.Add(lb5,                  row=5, col=0, flag=wx.ALL | wx.ALIGN_CENTER_VERTICAL, border=border)
-        sizer.Add(self.edNumRows,       row=5, col=1, flag=wx.EXPAND | wx.ALL | wx.ALIGN_CENTER_VERTICAL, border=border)
+        sizer.Add(lb1,                  pos=(0,0), flag=wx.ALL | wx.ALIGN_CENTER_VERTICAL, border=border)
+        sizer.Add(self.edNumBars,       pos=(0,1), flag=wx.EXPAND | wx.ALL | wx.ALIGN_CENTER_VERTICAL, border=border)
+        sizer.Add(lb2,                  pos=(1,0), flag=wx.ALL | wx.ALIGN_CENTER_VERTICAL, border=border)
+        sizer.Add(self.edNumRepeats,    pos=(1,1), flag=wx.EXPAND | wx.ALL | wx.ALIGN_CENTER_VERTICAL, border=border)
+        sizer.Add(lb3,                  pos=(2,0), flag=wx.ALL | wx.ALIGN_CENTER_VERTICAL, border=border)
+        sizer.Add(self.edNumTitles,     pos=(2,1), flag=wx.EXPAND | wx.ALL | wx.ALIGN_CENTER_VERTICAL, border=border)
+        sizer.Add(lb4,                  pos=(3,0), flag=wx.ALL | wx.ALIGN_CENTER_VERTICAL, border=border)
+        sizer.Add(self.edSortFields,    pos=(3,1), flag=wx.EXPAND | wx.ALL | wx.ALIGN_CENTER_VERTICAL, border=border)
+        sizer.Add(self.chkTwoColumns,   pos=(4,1), flag=wx.EXPAND | wx.ALL | wx.ALIGN_CENTER_VERTICAL, border=border)
+        sizer.Add(lb5,                  pos=(5,0), flag=wx.ALL | wx.ALIGN_CENTER_VERTICAL, border=border)
+        sizer.Add(self.edNumRows,       pos=(5,1), flag=wx.EXPAND | wx.ALL | wx.ALIGN_CENTER_VERTICAL, border=border)
 
         # ok, cancel buttons
         self.ok = wx.Button(self, wx.ID_ANY, _('&Ok'))
@@ -2076,9 +2075,9 @@ class AbcFileSettingsFrame(wx.Panel):
         else:
             self.exe_file_mask = '*'
 
-        sizer = rcs.RowColSizer()
+        sizer = wx.GridBagSizer()
         if wx.Platform == "__WXMAC__":
-            sizer.Add(wx.StaticText(self, wx.ID_ANY, _('File paths to required executables') + ':'), row=0, col=0, colspan=2, flag=wx.ALL, border=border)
+            sizer.Add(wx.StaticText(self, wx.ID_ANY, _('File paths to required executables') + ':'), pos=(0,0), span=(0,2), flag=wx.ALL, border=border)
             r = 1
         else:
             r = 0
@@ -2110,9 +2109,9 @@ class AbcFileSettingsFrame(wx.Panel):
             browse_button = wx.Button(self, wx.ID_ANY, _('Browse...'))
             self.browsebutton_to_control[browse_button] = control
             self.browsebutton_to_wildcard[browse_button] = entry.wildcard
-            sizer.Add(wx.StaticText(self, wx.ID_ANY, entry.display_name), row=r, col=0, flag=wx.ALL | wx.ALIGN_CENTER_VERTICAL, border=border)
-            sizer.Add(control, row=r, col=1, flag=wx.ALL | wx.EXPAND | wx.ALIGN_CENTER_VERTICAL, border=border)
-            sizer.Add(browse_button, row=r, col=2, flag=wx.ALL | wx.ALIGN_CENTER_VERTICAL, border=border)
+            sizer.Add(wx.StaticText(self, wx.ID_ANY, entry.display_name), pos=(r,0), flag=wx.ALL | wx.ALIGN_CENTER_VERTICAL, border=border)
+            sizer.Add(control, pos=(r,1), flag=wx.ALL | wx.EXPAND | wx.ALIGN_CENTER_VERTICAL, border=border)
+            sizer.Add(browse_button, pos=(r,2), flag=wx.ALL | wx.ALIGN_CENTER_VERTICAL, border=border)
 
             browse_button.Bind(wx.EVT_BUTTON, self.OnBrowse, browse_button)
 
@@ -2132,10 +2131,10 @@ class AbcFileSettingsFrame(wx.Panel):
         extraplayerparam = wx.StaticText(self, wx.ID_ANY, _("Extra MIDI player parameters"))
         self.extras = wx.TextCtrl(self, wx.ID_ANY, size=(200, 22))
 
-        midiplayer_params_sizer = rcs.RowColSizer()
-        midiplayer_params_sizer.Add(self.chkIncludeHeader, row=0, col=0, colspan=2, flag=wx.ALL, border=border)
-        midiplayer_params_sizer.Add(extraplayerparam, row=1, col=0, flag=wx.ALL | wx.ALIGN_CENTER_VERTICAL, border=border)
-        midiplayer_params_sizer.Add(self.extras, row=1, col=1, flag=wx.ALL | wx.ALIGN_CENTER_VERTICAL, border=border)
+        midiplayer_params_sizer = wx.GridBagSizer()
+        midiplayer_params_sizer.Add(self.chkIncludeHeader, pos=(0,0), span=(0,2), flag=wx.ALL, border=border)
+        midiplayer_params_sizer.Add(extraplayerparam, pos=(1,0), flag=wx.ALL | wx.ALIGN_CENTER_VERTICAL, border=border)
+        midiplayer_params_sizer.Add(self.extras, pos=(1,1), flag=wx.ALL | wx.ALIGN_CENTER_VERTICAL, border=border)
 
         self.restore_settings = wx.Button(self, wx.ID_ANY, _('Restore settings')) # 1.3.6.3 [JWDJ] 2015-04-25 renamed
         check_toolTip = _('Restore default file paths to abcm2ps, abc2midi, abc2abc, ghostscript when blank')
@@ -2272,7 +2271,7 @@ class MyChordPlayPage (wx.Panel):
         self.SetBackgroundColour(dialog_background_colour) # 1.3.6.3 [JWDJ] 2014-04-28 same background for all tabs
         gridsizer = wx.FlexGridSizer(20, 4, 2, 2)
         # midi_box to set default instrument for playback
-        midi_box = rcs.RowColSizer()
+        midi_box = wx.GridBagSizer()
         border = control_margin
         self.settings = settings
 
@@ -2319,38 +2318,38 @@ class MyChordPlayPage (wx.Panel):
         gchordchoices = ['default', 'f', 'fzfz', 'gi', 'gihi', 'f4c2', 'ghihgh', 'g2hg2h']
         self.SetGchordChoices(gchordchoices)
 
-        midi_box.Add(wx.StaticText(self, wx.ID_ANY, _('Instrument for playback') + ': '), row=0, col=0, flag=wx.ALL | wx.ALIGN_CENTER_VERTICAL, border=border)
-        midi_box.Add(self.sliderVol, row=0, col=2, flag=wx.ALL | wx.EXPAND | wx.ALIGN_CENTER_VERTICAL, border=border)
-        midi_box.Add(self.Voltxt, row=0, col=3, flag=wx.ALL| wx.EXPAND | wx.ALIGN_CENTER_VERTICAL, border=border)
-        midi_box.Add(self.cmbMidiProgram, row=0, col=1, flag=wx.ALL | wx.EXPAND | wx.ALIGN_CENTER_VERTICAL, border=border)
-        midi_box.Add(wx.StaticText(self, wx.ID_ANY, _("Instrument for chord's playback") + ': '), row=1, col=0, flag=wx.ALL | wx.ALIGN_CENTER_VERTICAL, border=border)
-        midi_box.Add(self.cmbMidiChordProgram, row=1, col=1, flag=wx.ALL | wx.EXPAND | wx.ALIGN_CENTER_VERTICAL, border=border)
-        midi_box.Add(self.sliderChordVol, row=1, col=2, flag=wx.ALL| wx.EXPAND | wx.ALIGN_CENTER_VERTICAL, border=border)
-        midi_box.Add(self.ChordVoltxt, row=1, col=3, flag=wx.ALL| wx.EXPAND | wx.ALIGN_CENTER_VERTICAL, border=border)
-        midi_box.Add(wx.StaticText(self, wx.ID_ANY, _("Instrument for bass chord's playback") + ': '), row=2, col=0, flag=wx.ALL | wx.ALIGN_CENTER_VERTICAL, border=border)
-        midi_box.Add(self.cmbMidiBassProgram, row=2, col=1, flag=wx.ALL | wx.EXPAND | wx.ALIGN_CENTER_VERTICAL, border=border)
-        midi_box.Add(self.sliderBassVol, row=2, col=2, flag=wx.ALL| wx.EXPAND | wx.ALIGN_CENTER_VERTICAL, border=border)
-        midi_box.Add(self.BassVoltxt, row=2, col=3, flag=wx.ALL| wx.EXPAND | wx.ALIGN_CENTER_VERTICAL, border=border)
+        midi_box.Add(wx.StaticText(self, wx.ID_ANY, _('Instrument for playback') + ': '), pos=(0,0), flag=wx.ALL | wx.ALIGN_CENTER_VERTICAL, border=border)
+        midi_box.Add(self.sliderVol, pos=(0,2), flag=wx.ALL | wx.EXPAND | wx.ALIGN_CENTER_VERTICAL, border=border)
+        midi_box.Add(self.Voltxt, pos=(0,3), flag=wx.ALL| wx.EXPAND | wx.ALIGN_CENTER_VERTICAL, border=border)
+        midi_box.Add(self.cmbMidiProgram, pos=(0,1), flag=wx.ALL | wx.EXPAND | wx.ALIGN_CENTER_VERTICAL, border=border)
+        midi_box.Add(wx.StaticText(self, wx.ID_ANY, _("Instrument for chord's playback") + ': '), pos=(1,0), flag=wx.ALL | wx.ALIGN_CENTER_VERTICAL, border=border)
+        midi_box.Add(self.cmbMidiChordProgram, pos=(1,1), flag=wx.ALL | wx.EXPAND | wx.ALIGN_CENTER_VERTICAL, border=border)
+        midi_box.Add(self.sliderChordVol, pos=(1,2), flag=wx.ALL| wx.EXPAND | wx.ALIGN_CENTER_VERTICAL, border=border)
+        midi_box.Add(self.ChordVoltxt, pos=(1,3), flag=wx.ALL| wx.EXPAND | wx.ALIGN_CENTER_VERTICAL, border=border)
+        midi_box.Add(wx.StaticText(self, wx.ID_ANY, _("Instrument for bass chord's playback") + ': '), pos=(2,0), flag=wx.ALL | wx.ALIGN_CENTER_VERTICAL, border=border)
+        midi_box.Add(self.cmbMidiBassProgram, pos=(2,1), flag=wx.ALL | wx.EXPAND | wx.ALIGN_CENTER_VERTICAL, border=border)
+        midi_box.Add(self.sliderBassVol, pos=(2,2), flag=wx.ALL| wx.EXPAND | wx.ALIGN_CENTER_VERTICAL, border=border)
+        midi_box.Add(self.BassVoltxt, pos=(2,3), flag=wx.ALL| wx.EXPAND | wx.ALIGN_CENTER_VERTICAL, border=border)
 
         # 1.3.6.4 [SS] 2015-06-10
-        midi_box.Add(wx.StaticText(self, wx.ID_ANY, _("Default Tempo") + ': '), row=3, col=0, flag=wx.ALL | wx.ALIGN_CENTER_VERTICAL, border=border)
-        midi_box.Add(self.sliderbeatsperminute, row=3, col=1, flag=wx.ALL | wx.EXPAND | wx.ALIGN_CENTER_VERTICAL, border=border)
-        midi_box.Add(self.beatsperminutetxt, row=3, col=2, flag=wx.ALL | wx.EXPAND | wx.ALIGN_CENTER_VERTICAL, border=border)
-        midi_box.Add(wx.StaticText(self, wx.ID_ANY, _("Transposition") + ': '), row=4, col=0, flag=wx.ALL | wx.ALIGN_CENTER_VERTICAL, border=border)
-        midi_box.Add(self.slidertranspose, row=4, col=1, flag=wx.ALL | wx.EXPAND | wx.ALIGN_CENTER_VERTICAL, border=border)
-        midi_box.Add(self.transposetxt, row=4, col=2, flag=wx.ALL | wx.EXPAND | wx.ALIGN_CENTER_VERTICAL, border=border)
-        midi_box.Add(wx.StaticText(self, wx.ID_ANY, _("Tuning") + ': '), row=5, col=0, flag=wx.ALL | wx.ALIGN_CENTER_VERTICAL, border=border)
-        midi_box.Add(self.slidertuning, row=5, col=1, flag=wx.ALL | wx.EXPAND | wx.ALIGN_CENTER_VERTICAL, border=border)
-        midi_box.Add(self.tuningtxt, row=5, col=2, flag=wx.ALL | wx.EXPAND | wx.ALIGN_CENTER_VERTICAL, border=border)
-
-        midi_box.Add(self.chkPlayChords, row=6, col=0, flag=wx.ALL | wx.EXPAND, border=border)
-        midi_box.Add(self.nodynamics, row=6, col=1, flag=wx.ALL | wx.EXPAND | wx.ALIGN_CENTER_VERTICAL, border=border)
-        midi_box.Add(self.nofermatas, row=7, col=0, flag=wx.ALL | wx.EXPAND | wx.ALIGN_CENTER_VERTICAL, border=border)
-        midi_box.Add(self.nograce, row=7, col=1, flag=wx.ALL | wx.EXPAND | wx.ALIGN_CENTER_VERTICAL, border=border)
-        midi_box.Add(self.barfly, row=8, col=0, flag=wx.ALL | wx.EXPAND | wx.ALIGN_CENTER_VERTICAL, border=border)
-        midi_box.Add(self.midi_intro, row=8, col=1, flag=wx.ALL | wx.EXPAND | wx.ALIGN_CENTER_VERTICAL, border=border)
-        midi_box.Add(gchordtxt, row=9, col=0, flag=wx.ALL | wx.ALIGN_CENTER_VERTICAL, border=border)
-        midi_box.Add(self.gchordcombo, row=9, col=1, flag=wx.ALL | wx.EXPAND | wx.ALIGN_CENTER_VERTICAL, border=border)
+        midi_box.Add(wx.StaticText(self, wx.ID_ANY, _("Default Tempo") + ': '), pos=(3,0), flag=wx.ALL | wx.ALIGN_CENTER_VERTICAL, border=border)
+        midi_box.Add(self.sliderbeatsperminute, pos=(3,1), flag=wx.ALL | wx.EXPAND | wx.ALIGN_CENTER_VERTICAL, border=border)
+        midi_box.Add(self.beatsperminutetxt, pos=(3,2), flag=wx.ALL | wx.EXPAND | wx.ALIGN_CENTER_VERTICAL, border=border)
+        midi_box.Add(wx.StaticText(self, wx.ID_ANY, _("Transposition") + ': '), pos=(4,0), flag=wx.ALL | wx.ALIGN_CENTER_VERTICAL, border=border)
+        midi_box.Add(self.slidertranspose, pos=(4,1), flag=wx.ALL | wx.EXPAND | wx.ALIGN_CENTER_VERTICAL, border=border)
+        midi_box.Add(self.transposetxt, pos=(4,2), flag=wx.ALL | wx.EXPAND | wx.ALIGN_CENTER_VERTICAL, border=border)
+        midi_box.Add(wx.StaticText(self, wx.ID_ANY, _("Tuning") + ': '), pos=(5,0), flag=wx.ALL | wx.ALIGN_CENTER_VERTICAL, border=border)
+        midi_box.Add(self.slidertuning, pos=(5,1), flag=wx.ALL | wx.EXPAND | wx.ALIGN_CENTER_VERTICAL, border=border)
+        midi_box.Add(self.tuningtxt, pos=(5,2), flag=wx.ALL | wx.EXPAND | wx.ALIGN_CENTER_VERTICAL, border=border)
+
+        midi_box.Add(self.chkPlayChords, pos=(6,0), flag=wx.ALL | wx.EXPAND, border=border)
+        midi_box.Add(self.nodynamics, pos=(6,1), flag=wx.ALL | wx.EXPAND | wx.ALIGN_CENTER_VERTICAL, border=border)
+        midi_box.Add(self.nofermatas, pos=(7,0), flag=wx.ALL | wx.EXPAND | wx.ALIGN_CENTER_VERTICAL, border=border)
+        midi_box.Add(self.nograce, pos=(7,1), flag=wx.ALL | wx.EXPAND | wx.ALIGN_CENTER_VERTICAL, border=border)
+        midi_box.Add(self.barfly, pos=(8,0), flag=wx.ALL | wx.EXPAND | wx.ALIGN_CENTER_VERTICAL, border=border)
+        midi_box.Add(self.midi_intro, pos=(8,1), flag=wx.ALL | wx.EXPAND | wx.ALIGN_CENTER_VERTICAL, border=border)
+        midi_box.Add(gchordtxt, pos=(9,0), flag=wx.ALL | wx.ALIGN_CENTER_VERTICAL, border=border)
+        midi_box.Add(self.gchordcombo, pos=(9,1), flag=wx.ALL | wx.EXPAND | wx.ALIGN_CENTER_VERTICAL, border=border)
 
         self.chkPlayChords.SetValue(self.settings.get('play_chords', False))
         self.slidertranspose.SetValue(self.settings.get('transposition', 0))
@@ -2542,10 +2541,10 @@ class MyVoicePage(wx.Panel):
         separate_defaults_per_voice = settings.get('separate_defaults_per_voice', False)
         self.chkPerVoice.Value = separate_defaults_per_voice
         self.chkPerVoice.Bind(wx.EVT_CHECKBOX, self.OnToggleDefaultsPerVoice)
-        midi_box = rcs.RowColSizer()
-        midi_box.Add(wx.StaticText(self, wx.ID_ANY, _('Default instrument:')), row=0, col=1, flag=wx.ALL | wx.ALIGN_CENTER_VERTICAL, border=border)
-        midi_box.Add(wx.StaticText(self, wx.ID_ANY, _('Main Volume:')), row=0, col=3, colspan=2, flag=wx.ALL | wx.ALIGN_CENTER_VERTICAL, border=border)
-        midi_box.Add(wx.StaticText(self, wx.ID_ANY, _('L/R Balance:')), row=0, col=6, colspan=2, flag=wx.ALL | wx.ALIGN_CENTER_VERTICAL, border=border)
+        midi_box = wx.GridBagSizer()
+        midi_box.Add(wx.StaticText(self, wx.ID_ANY, _('Default instrument:')), pos=(0,1), flag=wx.ALL | wx.ALIGN_CENTER_VERTICAL, border=border)
+        midi_box.Add(wx.StaticText(self, wx.ID_ANY, _('Main Volume:')), pos=(0,3), span=(0,2), flag=wx.ALL | wx.ALIGN_CENTER_VERTICAL, border=border)
+        midi_box.Add(wx.StaticText(self, wx.ID_ANY, _('L/R Balance:')), pos=(0,6), span=(0,2), flag=wx.ALL | wx.ALIGN_CENTER_VERTICAL, border=border)
 
         # For each of the 16th voice, instrument, volume and balance can be set separately
         if PY3:
@@ -2578,18 +2577,18 @@ class MyVoicePage(wx.Panel):
                                                                 wx.ST_NO_AUTORESIZE, size=(30, 20))
             self.textValueMidiControlPanCh_list[channel] = panText
 
-            midi_box.Add(wx.StaticText(self, wx.ID_ANY, _('Voice n.%d: ') % channel), row=channel, col=0,
+            midi_box.Add(wx.StaticText(self, wx.ID_ANY, _('Voice n.%d: ') % channel), pos=(channel,0),
                          flag=wx.ALIGN_CENTER_VERTICAL, border=border)
-            midi_box.Add(cmbMidiProgram, row=channel, col=1, flag=wx.ALIGN_CENTER_VERTICAL | wx.EXPAND)
+            midi_box.Add(cmbMidiProgram, pos=(channel,1), flag=wx.ALIGN_CENTER_VERTICAL | wx.EXPAND)
             #3rd column (col=2) is unused on purpose to leave some space (maybe replaced with some other spacer option later on)
-            midi_box.Add(volumeSlider, row=channel, col=3,
+            midi_box.Add(volumeSlider, pos=(channel,3),
                          flag=wx.ALIGN_CENTER_VERTICAL | wx.ALIGN_CENTER_HORIZONTAL)
-            midi_box.Add(volumeText, row=channel, col=4,
+            midi_box.Add(volumeText, pos=(channel,4),
                          flag=wx.ALIGN_CENTER_VERTICAL | wx.ALIGN_CENTER_HORIZONTAL)
             #6th column (col=5) is unused on purpose to leave some space (maybe replaced with some other spacer option later on)
-            midi_box.Add(panSlider, row=channel, col=6,
+            midi_box.Add(panSlider, pos=(channel,6),
                          flag=wx.ALIGN_CENTER_VERTICAL | wx.ALIGN_CENTER_HORIZONTAL)
-            midi_box.Add(panText, row=channel, col=7,
+            midi_box.Add(panText, pos=(channel,7),
                          flag=wx.ALIGN_CENTER_VERTICAL | wx.ALIGN_CENTER_HORIZONTAL)
             #Some properties are added to the slider to be able to update the associated text field with value when slider is moved
             volumeSlider.currentchannel=channel
@@ -3133,7 +3132,7 @@ class ColorSettingsFrame(wx.Panel):
         self.SetBackgroundColour(dialog_background_colour)
         border = control_margin
 
-        grid_sizer = rcs.RowColSizer()
+        grid_sizer = wx.GridBagSizer()
 
         note_highlight_color = self.settings.get('note_highlight_color', default_note_highlight_color)
         note_highlight_color_label = wx.StaticText(self, wx.ID_ANY, _("Note highlight color"))
@@ -3145,8 +3144,8 @@ class ColorSettingsFrame(wx.Panel):
             b = int(note_highlight_color[5:7], 16)
             self.note_highlight_color_picker = wx.ColourPickerCtrl(self, wx.ID_ANY, wx.Colour(r, g, b))
 
-        grid_sizer.Add(note_highlight_color_label, row=0, col=0, flag=wx.ALL | wx.ALIGN_CENTER_VERTICAL, border=border)
-        grid_sizer.Add(self.note_highlight_color_picker, row=0, col=1, flag=wx.ALL | wx.ALIGN_CENTER_VERTICAL, border=border)
+        grid_sizer.Add(note_highlight_color_label, pos=(0,0), flag=wx.ALL | wx.ALIGN_CENTER_VERTICAL, border=border)
+        grid_sizer.Add(self.note_highlight_color_picker, pos=(0,1), flag=wx.ALL | wx.ALIGN_CENTER_VERTICAL, border=border)
 
         note_highlight_color_tooltip = _('Color of selected note or currently playing note')
         self.note_highlight_color_picker.SetToolTip(wx.ToolTip(note_highlight_color_tooltip))

from easyabc.

mmehl avatar mmehl commented on August 22, 2024

I get the mis-sized settings window in python 3.10 on SuSE. I haven't bothered to diagnose it - I just make them bigger to use them, and they work OK. I have more important problems to solve!

@mmehl - is it using fluidsynth? (#79)? What version of wxPython?

I'm using Ubuntu 23.10 and fluidsynth

$ python3 -c "import wx;print(wx.version)"
4.2.1

from easyabc.

topchyan avatar topchyan commented on August 22, 2024

I get the mis-sized settings window in python 3.10 on SuSE. I haven't bothered to diagnose it - I just make them bigger to use them, and they work OK.

Could you please explain how do you make them bigger? My controls seem to have been running into each other, but their sizes were okay, I think. This happened on some tabs in the settings dialog, but not on all of them.

from easyabc.

topchyan avatar topchyan commented on August 22, 2024

I applied all 3 patches listed here and the tool worked for me.

$ /usr/bin/python3 -V
Python 3.11.2

$ /usr/bin/python3 -c "import wx;print (wx.__version__)"
4.2.0


from easyabc.

topchyan avatar topchyan commented on August 22, 2024

image

The toolbar buttons layout and more importantly behavior after successful launch of the tool is problematic.

The "Play" button when not playing often is flipped to "Pause" image rather than "Play" which is confusing.
This goes away when "Stop" button pressed a few times, but not always.

Zoom slider works, but looks off

Play Position slider doesn't work at all.

from easyabc.

topchyan avatar topchyan commented on August 22, 2024

This does fix zoom slider issue. Thanks.
Could you also check the Play button and Play Position slider misbehavior?

from easyabc.

mmehl avatar mmehl commented on August 22, 2024

The play button problem is more complicated. It seems to be a issue in libfluidsynth:

  • after fluidsynth.fluid_player_stop(player) and then fluidsynth.fluid_player_play(player) the library denys to continue playing with the error message "fluidsynth: error: The maximum playback duration has been reached. Terminating player!"

I'll try to investigate this further.

See FluidSynth/fluidsynth#1296

from easyabc.

mmehl avatar mmehl commented on August 22, 2024

Problem with stop/pause is fixed in fluidsynth 2.3.4 (see FluidSynth/fluidsynth#1272).
New version of fluidsynth for Ubuntu Mantic 23.10 will be delivered with https://bugs.launchpad.net/ubuntu/+source/fluidsynth/+bug/2047656

from easyabc.

topchyan avatar topchyan commented on August 22, 2024

I built from sources just now

$ fluidsynth -V
FluidSynth runtime version 2.3.1
Copyright (C) 2000-2023 Peter Hanappe and others.
Distributed under the LGPL license.
SoundFont(R) is a registered trademark of Creative Technology Ltd.

FluidSynth executable version 2.3.4
Sample type=double

Not sure why there is a difference between runtime and executable. Perhaps I should have removed the package first prior to installing. The problem with play button still exists

from easyabc.

topchyan avatar topchyan commented on August 22, 2024

had to run sudo ldconfig and now they are in sync

$ fluidsynth -V
FluidSynth runtime version 2.3.4
Copyright (C) 2000-2023 Peter Hanappe and others.
Distributed under the LGPL license.
SoundFont(R) is a registered trademark of Creative Technology Ltd.

FluidSynth executable version 2.3.4
Sample type=double

Still the library is in the old version... need to find out how to build that
$ sudo apt show libfluidsynth3
Package: libfluidsynth3
Version: 2.3.1-2
Priority: optional
Section: libs
Source: fluidsynth
Maintainer: Debian Multimedia Maintainers [email protected]
Installed-Size: 607 kB

from easyabc.

mmehl avatar mmehl commented on August 22, 2024

It should be sufficient to copy the freshly compiled libfluidsynth into the EasyABC because the following search path is used:

lib_locations = ['./libfluidsynth.so.3', 'libfluidsynth.so.3', './libfluidsynth.so.2', 'libfluidsynth.so.2']

from easyabc.

topchyan avatar topchyan commented on August 22, 2024

Copied the files, but no change in behavior of play button

from easyabc.

topchyan avatar topchyan commented on August 22, 2024

@jwdj, are there any plans to integrate any of these recent changes to the code?

from easyabc.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.