summaryrefslogtreecommitdiff
path: root/model.py
diff options
context:
space:
mode:
authorJules Laplace <julescarbon@gmail.com>2018-05-15 00:50:48 +0200
committerJules Laplace <julescarbon@gmail.com>2018-05-15 00:50:48 +0200
commit7f2083a511a91edc13683d32903a06d1c1dd4d4e (patch)
tree6aa4a87c8c85a166155e1f4820ce9ac2b875aa7a /model.py
parentb5532f18c3b56d1715aef0a81820fd2ec7b05a70 (diff)
lol typo
Diffstat (limited to 'model.py')
-rw-r--r--model.py11
1 files changed, 11 insertions, 0 deletions
diff --git a/model.py b/model.py
index 5e8a2ce..5f20075 100644
--- a/model.py
+++ b/model.py
@@ -350,11 +350,22 @@ class PrimedGenerator(Runner):
x[:, i] = int((math.sin(i/44100 * primer_freq) + 1) / 2 * (q_width) + q_min)
return x
+ def _saw(x):
+ primer_width = int(n_samples / 2)
+ for i in range(n_samples):
+ # x[:, i] = #int((math.sin(i/44100 * primer_freq) + 1) / 2 * (q_width) + q_min)
+ if (i % primer_width) == 0:
+ x[:, i] = q_levels
+ else:
+ x[:, i] = int(q_levels / 2)
+ return x
+
sequence_lookup = {
'zero': lambda x: x.fill_(utils.q_zero(self.model.q_levels)),
'noise': _noise,
'sin': _sin,
'saw': _saw,
+ 'spike': _spike,
}
sequences = sequence_lookup.get(primer, 'zero')(sequences)