Skip to content

Commit

Permalink
audiobro1 tweaking
Browse files Browse the repository at this point in the history
  • Loading branch information
dansgithubuser committed Mar 23, 2024
1 parent 41d0ab3 commit 1e556da
Show file tree
Hide file tree
Showing 3 changed files with 23 additions and 14 deletions.
Binary file modified assets/midis/audiobro1.mid
Binary file not shown.
Binary file modified assets/musescore/audiobro1.mscz
Binary file not shown.
37 changes: 23 additions & 14 deletions assets/systems/audiobro1.py
Original file line number Diff line number Diff line change
Expand Up @@ -10,15 +10,16 @@
args = parser.parse_args()

class Voice:
def __init__(self, name, *kinds, input=None, output=None):
def __init__(self, name, *component_names, input=None, output=None):
globals()[name] = self
self.components = {}
for kind in kinds:
component = dlal.component_class(kind)(name=f'{name}.{kind}')
self.components[kind] = component
setattr(self, kind, component)
self.input = self.pick(input or [kinds[0]])
self.output = self.pick(output or [kinds[-1]])
for component_name in component_names:
kind = component_name.split('_')[0]
component = dlal.component_class(kind)(name=f'{name}.{component_name}')
self.components[component_name] = component
setattr(self, component_name, component)
self.input = self.pick(input or [component_names[0]])
self.output = self.pick(output or [component_names[-1]])

def pick(self, ks):
return [
Expand Down Expand Up @@ -49,7 +50,7 @@ def connect(self, other):
driver = dlal.Audio()
comm = dlal.Comm()
Voice('drum', 'buf')
Voice('piano', 'sonic')
Voice('piano', 'sonic', 'lfo', 'mul', 'buf_1', 'buf_2')
Voice('bass', 'sonic', 'lim', 'buf')
Voice('ghost', 'gain', 'midman', 'rhymel', 'lpf', 'lfo', 'oracle', 'sonic', 'lim', 'buf', input=['rhymel'])
Lforacle('ghost_lfo_i20', 0.40000, 0.3, 0.3, 'i2', 0, '%')
Expand Down Expand Up @@ -104,7 +105,8 @@ def connect(self, other):
# cricket
drum.buf.load('assets/sounds/animal/cricket.wav', 56)
drum.buf.amplify(1.5, 56)
drum.buf.mul(56, 1)
drum.buf.sin(0.25, 80, 0.75, 1, 2)
drum.buf.mul(56, 2)
# shunk
drum.buf.load('assets/sounds/drum/snare.wav', 36)
drum.buf.resample(0.3, 36)
Expand Down Expand Up @@ -150,7 +152,7 @@ def connect(self, other):

piano.sonic.from_json({
"0": {
"a": 4e-3, "d": 1e-4, "s": 0, "r": 2e-4, "m": 1,
"a": 4e-3, "d": 5e-5, "s": 0.2, "r": 2e-4, "m": 1,
"i0": 0, "i1": 0.06, "i2": 0, "i3": 0, "o": 0.25,
},
"1": {
Expand All @@ -166,6 +168,9 @@ def connect(self, other):
"i0": 0, "i1": 0, "i2": 0, "i3": 0, "o": 0,
},
})
piano.lfo.freq(12)
piano.lfo.amp(0.5)
piano.lfo.offset(1)

ghost.gain.set(0)
ghost.midman.directive([{'nibble': 0x90}], 0, 'midi', [0x90, '%1', 0])
Expand All @@ -178,7 +183,7 @@ def connect(self, other):
ghost.sonic.from_json({
"0": {
"a": 1e-3, "d": 5e-3, "s": 1, "r": 6e-5, "m": 1,
"i0": 0, "i1": 0.15, "i2": 0, "i3": 0, "o": 0.95,
"i0": 0, "i1": 0.15, "i2": 0, "i3": 0, "o": 0.95/2,
},
"1": {
"a": 1, "d": 2e-5, "s": 0, "r": 1, "m": 1,
Expand All @@ -194,8 +199,8 @@ def connect(self, other):
},
})
ghost.sonic.midi(midi.Msg.pitch_bend_range(64))
ghost.lim.hard(0.25)
ghost.lim.soft(0.15)
ghost.lim.hard(0.25/2)
ghost.lim.soft(0.15/2)

bell.sonic.from_json({
"0": {
Expand Down Expand Up @@ -246,6 +251,10 @@ def connect(self, other):
gain.set(0)

# connect
piano.sonic.connect(piano.buf_2)
piano.lfo.connect(piano.buf_1)
piano.mul.connect(piano.buf_1)
piano.mul.connect(piano.buf_2)
bass.sonic.connect(bass.buf)
bass.lim.connect(bass.buf)
ghost.gain.connect(ghost.oracle)
Expand Down Expand Up @@ -278,4 +287,4 @@ def connect(self, other):
if args.live:
dlal.typical_setup()
else:
dlal.typical_setup(live=False, duration=270)
dlal.typical_setup(live=False, duration=227)

0 comments on commit 1e556da

Please sign in to comment.