simplify instrument making by restricting it to range -1..1
This commit is contained in:
parent
11788900b9
commit
f39306e3d6
1 changed files with 2 additions and 5 deletions
|
@ -1,8 +1,5 @@
|
||||||
use std::{
|
use std::{
|
||||||
any::{Any, TypeId},
|
any::{Any, TypeId}, collections::{BTreeMap, HashMap}, f64, fmt::Debug, str::FromStr
|
||||||
collections::{BTreeMap, HashMap},
|
|
||||||
fmt::Debug,
|
|
||||||
str::FromStr,
|
|
||||||
};
|
};
|
||||||
|
|
||||||
use cfg_if::cfg_if;
|
use cfg_if::cfg_if;
|
||||||
|
@ -393,7 +390,7 @@ impl Context {
|
||||||
let mut map = self.namespace_generator().collect::<BTreeMap<_, _>>();
|
let mut map = self.namespace_generator().collect::<BTreeMap<_, _>>();
|
||||||
map.insert('n'.to_string(), note as f64);
|
map.insert('n'.to_string(), note as f64);
|
||||||
while self.current_length()? > *self.get('t')? - curr_t + (1f64 / SAMPLE_RATE as f64) {
|
while self.current_length()? > *self.get('t')? - curr_t + (1f64 / SAMPLE_RATE as f64) {
|
||||||
result.push(self.eval_with(&self.instrument, &mut map)?);
|
result.push(self.eval_with(&self.instrument, &mut map)? * f64::MAX);
|
||||||
self.tick()?;
|
self.tick()?;
|
||||||
map = self.namespace_generator().fold(map, |mut acc, (k, v)| {
|
map = self.namespace_generator().fold(map, |mut acc, (k, v)| {
|
||||||
acc.insert(k, v);
|
acc.insert(k, v);
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue