Skip to content

Commit

Permalink
making headers and patches.h generated by makefile
Browse files Browse the repository at this point in the history
  • Loading branch information
bwhitman committed Mar 28, 2024
1 parent f831390 commit a28fe30
Show file tree
Hide file tree
Showing 3 changed files with 147 additions and 140 deletions.
9 changes: 8 additions & 1 deletion Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -40,8 +40,14 @@ OBJECTS = $(patsubst %.c, %.o, src/algorithms.c src/amy.c src/envelope.c \
src/libminiaudio-audio.c)

HEADERS = $(wildcard src/*.h) src/amy_config.h
HEADERS_BUILD := $(filter-out src/patches.h,$(HEADERS))

%.o: %.c $(HEADERS)
PYTHONS = $(wildcard *.py)

src/patches.h: $(PYTHONS) $(HEADERS_BUILD)
${PYTHON} amy_headers.py

%.o: %.c $(HEADERS) src/patches.h
$(CC) $(CFLAGS) -c $< -o $@

%.o: %.mm $(HEADERS)
Expand Down Expand Up @@ -74,4 +80,5 @@ web: $(TARGET)

clean:
-rm -f src/*.o
-rm -r src/patches.h
-rm -f $(TARGET)
20 changes: 10 additions & 10 deletions fm.py
Original file line number Diff line number Diff line change
Expand Up @@ -234,9 +234,9 @@ def send_to_AMY(self, reset=True):
if(amp_times[4] > last_release_time):
last_release_time = amp_times[4]
last_release_value = amp_levels[4]
print("osc %d (op %d) freq %.6f ratio %d env %s amp %.6f amp_mod %d" % \
(i+1, osc.op_num, osc.frequency, osc.freq_is_ratio, oscbpfmt,
osc.op_amp, osc.ampmodsens))
#print("osc %d (op %d) freq %.6f ratio %d env %s amp %.6f amp_mod %d" % \
# (i+1, osc.op_num, osc.frequency, osc.freq_is_ratio, oscbpfmt,
# osc.op_amp, osc.ampmodsens))

# Make them all in cosine phase, to be like DX7. Important for slow oscs
args = {"osc":i+1,
Expand All @@ -257,22 +257,22 @@ def send_to_AMY(self, reset=True):
amy.send(**args)

# Set up the amp LFO
print("osc 7 amp lfo wave %d freq %f amp %f" % (
self.lfo_waveform, self.lfo_freq, self.amp_lfo_amp))
#print("osc 7 amp lfo wave %d freq %f amp %f" % (
# self.lfo_waveform, self.lfo_freq, self.amp_lfo_amp))
amy.send(osc=7, wave=self.lfo_waveform, freq=t(self.lfo_freq),
amp=t(self.amp_lfo_amp))

# and the pitch one
print("osc 8 pitch lfo wave %d freq %f amp %f" % (
self.lfo_waveform, self.lfo_freq, self.pitch_lfo_amp))
#print("osc 8 pitch lfo wave %d freq %f amp %f" % (
# self.lfo_waveform, self.lfo_freq, self.pitch_lfo_amp))
amy.send(osc=8, wave=self.lfo_waveform, freq=t(self.lfo_freq),
amp=t(self.pitch_lfo_amp))

print("not used: lfo delay %d " % self.lfo_delay)
#print("not used: lfo delay %d " % self.lfo_delay)

ampbp = "0,1,%d,%f" % (last_release_time, last_release_value)
print("osc 0 (main) algo %d feedback %f pitchenv %s ampenv %s" % (
self.algo, self.feedback, pitchbp, ampbp))
#print("osc 0 (main) algo %d feedback %f pitchenv %s ampenv %s" % (
# self.algo, self.feedback, pitchbp, ampbp))
amy.send(osc=0, wave=amy.ALGO, algorithm=self.algo, feedback=t(self.feedback),
algo_source="1,2,3,4,5,6",
bp0=ampbp, bp0_target=amy.TARGET_AMP+amy.TARGET_DX7_EXPONENTIAL,
Expand Down
Loading

0 comments on commit a28fe30

Please sign in to comment.