Browse Source

use new libcalfbox-lss

master
Nils 7 months ago
parent
commit
c365ec352d
  1. 1
      configure
  2. 2
      engine/config.py
  3. 32
      engine/main.py

1
configure

@ -1,6 +1,5 @@
#!/bin/bash
program=fluajho
cboxconfigure="--without-libsmf"
version=1.7.1
. template/configure.template #. is the posix compatible version of source

2
engine/config.py

@ -74,6 +74,4 @@ instruments. There is only one JACK-Midi input but each of the 16 midi channels
JACK audio output. Additionally there is a stereo mix output pair.
""",
"dependencies" : "\n".join("* "+dep for dep in ("Fluidsynth", )),
}

32
engine/main.py

@ -25,7 +25,7 @@ import logging; logger = logging.getLogger(__name__); logger.info("import")
import os.path
#Third Party
from calfbox import cbox
from template.calfbox import cbox
#Template Modules
from template.start import PATHS
@ -33,16 +33,16 @@ import template.engine.sampler_sf2
class Data(template.engine.sampler_sf2.Sampler_sf2):
"""There must always be a Data class in a file main.py.
Simply inheriting from engine.data.Data is easiest.
"""
DEFAULT_PATCHES = { #Choose a nice set of instruments as program default.
Simply inheriting from engine.data.Data is easiest.
"""
DEFAULT_PATCHES = { #Choose a nice set of instruments as program default.
# channel: (bank, program, name)
#the name doesn't matter for the program at all, it is only to get a human readable save file. We set it to "" here because it gets updated automatically.
1: (0, 0, ""), #piano
#the name doesn't matter for the program at all, it is only to get a human readable save file. We set it to "" here because it gets updated automatically.
1: (0, 0, ""), #piano
2: (0, 49, ""), #slow strings
3: (127, 95, ""), #Brass Section 1
4: (0, 52, ""), #Chor Aahs
5: (0, 21, ""), #Accordion
5: (0, 21, ""), #Accordion
6: (0, 11, ""), #Vibraphone
7: (0, 19, ""), #Church Organ
8: (0, 59, ""), #Muted Trumpet
@ -55,22 +55,16 @@ class Data(template.engine.sampler_sf2.Sampler_sf2):
15: (0, 38, ""), #Synth Bass 1
16: (8, 125, ""), #Starship
}
def __init__(self, parentSession, filePath="", activePatches=DEFAULT_PATCHES, ignoreProgramChanges=False): #Program start.
DEFAULT_GM_SF2 = os.path.join(PATHS["share"], "gm.sf2")
if not os.path.exists(DEFAULT_GM_SF2): #a workaround if we are starting the compiled version without installing.
_engineRoot = os.path.dirname(__file__)
DEFAULT_GM_SF2 = os.path.join(_engineRoot, "resources/gm.sf2")
if not filePath: #First start or save file with no filePath -> Default GM soundfont
_engineRoot = os.path.dirname(__file__)
DEFAULT_GM_SF2 = os.path.join(_engineRoot, "resources/gm.sf2")
if not filePath: #First start or save file with no filePath -> Default GM soundfont
#The default sf2 has a dynamic path. It depends on where the program is run from. We need to prevent an absolute path.
super().__init__(parentSession, filePath, activePatches, ignoreProgramChanges, mixer=True, defaultSoundfont=DEFAULT_GM_SF2)
else:
super().__init__(parentSession, filePath, activePatches, ignoreProgramChanges, mixer=True)

Loading…
Cancel
Save