D1024=int(D512/2)# set this to a number with many factors, like 210. According to http://homes.sice.indiana.edu/donbyrd/CMNExtremes.htm this is the real world limit.
ifnotint(D1024)==D1024:
logger.error:(f"Warning: Lowest duration D0124 has decimal places: {D0124} but should be a plain integer. Your D4 value: {D4} has not enough 2^n factors. ")
logger.error(f"Warning: Lowest duration D0124 has decimal places: {D0124} but should be a plain integer. Your D4 value: {D4} has not enough 2^n factors. ")
#Remove the old link, if present. We cannot unlink directly in loadSoundfont because it is quite possible that a user will try out another soundfont but decide not to save but close and reopen to get his old soundfont back.
#Most set config must be called before start audio. Set audio outputs seems to be an exception.
@ -111,13 +111,13 @@ class Session(object):
self.data=None#This makes debugging output nicer. If we init Data() here all errors will be presented as follow-up error "while handling exception FileNotFoundError".
except(NotADirectoryError,PermissionError)ase:
self.data=None
logger.error:("Will not load or save because: "+e.__repr__())
logger.error("Will not load or save because: "+e.__repr__())
self.sock.setblocking(False)#We have waited for tha handshake. Now switch blocking off because we expect sock.recvfrom to be empty in 99.99...% of the time so we shouldn't wait for the answer.
#After this point the host must include self.reactToMessage in its event loop
#We assume we are save at startup.
self.announceSaveStatus(isClean=True)
defreactToMessage(self):
"""This is the main loop message. It is added to the clients event loop."""
@ -466,6 +469,9 @@ class NSMClient(object):
defannounceSaveStatus(self,isClean):
"""Only send to the NSM Server if there was really a change"""
#else try to use system-wide calfbox. Check for this and if the .so exists at the end of this file.
logger.info:("PATHS: {}".format(PATHS))
logger.info("PATHS: {}".format(PATHS))
defexitWithMessage(message:str):
@ -235,7 +235,7 @@ def profiler(*pargs, **kwds):
fromtempfileimportNamedTemporaryFile
cprofPath=NamedTemporaryFile().name+".cprof"
pr.dump_stats(cprofPath)
logger.info:("{}: write profiling data to {}".format(METADATA["name"],cprofPath))
logger.info("{}: write profiling data to {}".format(METADATA["name"],cprofPath))
print(f"pyprof2calltree -k -i {cprofPath}")
pr=cProfile.Profile()
@ -304,13 +304,13 @@ if args.mute:
#Make sure calfbox is available.
if"CALFBOXLIBABSPATH"inos.environ:
logger.info:("Looking for calfbox shared library in absolute path: {}".format(os.environ["CALFBOXLIBABSPATH"]))
logger.info("Looking for calfbox shared library in absolute path: {}".format(os.environ["CALFBOXLIBABSPATH"]))
else:
logger.info:("Looking for calfbox shared library systemwide through ctypes.util.find_library")
logger.info("Looking for calfbox shared library systemwide through ctypes.util.find_library")
try:
fromcalfboximportcbox
logger.info:("{}: using cbox python module from {} . Local version has higher priority than system wide.".format(METADATA["name"],os.path.abspath(cbox.__file__)))
logger.info("{}: using cbox python module from {} . Local version has higher priority than system wide.".format(METADATA["name"],os.path.abspath(cbox.__file__)))