summaryrefslogtreecommitdiff
path: root/model.py
diff options
context:
space:
mode:
Diffstat (limited to 'model.py')
-rw-r--r--model.py11
1 files changed, 9 insertions, 2 deletions
diff --git a/model.py b/model.py
index 62999c9..6c1b629 100644
--- a/model.py
+++ b/model.py
@@ -325,8 +325,9 @@ class PrimedGenerator(Runner):
tmp_sequences = torch.LongTensor(n_seqs, n_samples).fill_(utils.q_zero(self.model.q_levels))
q_levels = self.model.q_levels
- q_min = 0
- q_max = q_levels
+ q_width = q_levels >> 4
+ q_min = q_width
+ q_max = q_levels - q_width
print("_______-___-_---_-____")
print("_____________--_-_-_______")
@@ -343,11 +344,17 @@ class PrimedGenerator(Runner):
for i in range(n_samples):
x[:, i] = int((math.sin(i/44100 * primer_freq) + 1) / 2 * (q_max - q_min) + q_min)
return x
+ def _saw(x):
+ primer_freq = float(prime_param_a)
+ for i in range(n_samples):
+ x[:, i] = int((math.sin(i/44100 * primer_freq) + 1) / 2 * (q_max - q_min) + q_min)
+ return x
sequence_lookup = {
'zero': lambda x: x.fill_(utils.q_zero(self.model.q_levels)),
'noise': _noise,
'sin': _sin,
+ 'saw': _saw,
}
sequences = sequence_lookup.get(primer, 'zero')(sequences)