Skip to content
Snippets Groups Projects
Commit a4be0596 authored by moon2's avatar moon2 :speech_balloon: Committed by q3k
Browse files

minor bugfix

parent ba3a2bc5
No related branches found
No related tags found
No related merge requests found
......@@ -32,7 +32,7 @@ STATIC mp_obj_t tinysynth_make_new(const mp_obj_type_t *type, size_t n_args, siz
self->osc.attack_steps = 3;
self->osc.vol = 1.;
self->osc.gate = 0.01;
self->osc.freq = mp_obj_get_int(args[0]);
self->osc.freq = mp_obj_get_float(args[0]);
self->osc.counter = 0;
self->osc.bend = 1;
self->osc.noise_reg = 1;
......
......@@ -6,19 +6,16 @@ synths = []
for i in range(5):
synths += [tinysynth(440,1)]
chords = [[0,3,7,10,12],[-2,2,5,8,10],[i-2,3,7,10,14],[-4,0,3,8,12],[-1,2,5,7,11]]
chords = [[0,3,7,10,12],[-2,2,5,8,10],[-2,3,7,10,14],[-4,0,3,8,12],[-1,2,5,7,11]]
def tune_guitar_to_chord(chord):
for j in range(5):
frq = 440 * (2**(chord[j]/12))
synths[j].freq(int(frq))
tune_guitar_to_chord(chords[2])
chord = chords[3]
while True:
for i in range(10):
if(get_captouch(i)):
if(i%2):
tune_guitar_to_chord(chords[int((i-1)/2)])
chord = chords[int((i-1)/2)]
else:
synths[int(i/2)].start()
i = int(i/2)
synths[i].freq(440*(2**(chord[i]/12)))
synths[i].start()
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment