Compare commits
No commits in common. "41aeef83d45d206632f424b762c4b761386e9b52" and "5651af2ac504244b2d29d5a5b987982e9c9ff6d0" have entirely different histories.
41aeef83d4
...
5651af2ac5
2 changed files with 6 additions and 8 deletions
|
@ -29,7 +29,7 @@ use nom_locate::{LocatedSpan, position};
|
||||||
use strum::{EnumDiscriminants, EnumString, IntoDiscriminant, IntoStaticStr};
|
use strum::{EnumDiscriminants, EnumString, IntoDiscriminant, IntoStaticStr};
|
||||||
use thiserror::Error;
|
use thiserror::Error;
|
||||||
|
|
||||||
const DEFAULT_INSTRUMENT: &str = "sin(2*pi()*(442*2^((n+1)/N))*t)";
|
const DEFAULT_INSTRUMENT: &str = "sin(2*pi()*(442+442*((n+1)/N))*t)";
|
||||||
const DEFAULT_LENGTH: &str = "2^(2-log(2, l))*(60/T)";
|
const DEFAULT_LENGTH: &str = "2^(2-log(2, l))*(60/T)";
|
||||||
|
|
||||||
#[derive(Debug, Parser)]
|
#[derive(Debug, Parser)]
|
||||||
|
|
|
@ -97,9 +97,8 @@ fn parse_and_compile(opts: &PlayOpts) -> anyhow::Result<Vec<f64>> {
|
||||||
opts.slopes()
|
opts.slopes()
|
||||||
.map(|(s, (v, e))| (s, VariableChange(*v, e.clone())))
|
.map(|(s, (v, e))| (s, VariableChange(*v, e.clone())))
|
||||||
.collect::<Vec<_>>(),
|
.collect::<Vec<_>>(),
|
||||||
HashMap::from(default_variables)
|
opts.variables()
|
||||||
.iter()
|
.chain(HashMap::from(default_variables).iter())
|
||||||
.chain(opts.variables())
|
|
||||||
.map(|(v, _)| *v)
|
.map(|(v, _)| *v)
|
||||||
.collect::<Vec<_>>(),
|
.collect::<Vec<_>>(),
|
||||||
);
|
);
|
||||||
|
@ -119,10 +118,9 @@ fn parse_and_compile(opts: &PlayOpts) -> anyhow::Result<Vec<f64>> {
|
||||||
let compiler = Compiler::from(Context::new(
|
let compiler = Compiler::from(Context::new(
|
||||||
'L'.to_string(),
|
'L'.to_string(),
|
||||||
'n'.to_string(),
|
'n'.to_string(),
|
||||||
default_variables
|
opts.variables()
|
||||||
.map(|(c, v)| (c.to_string(), v))
|
.map(|(a, b)| (a.to_string(), *b))
|
||||||
.into_iter()
|
.chain(default_variables.map(|(c, v)| (c.to_string(), v))),
|
||||||
.chain(opts.variables().map(|(a, b)| (a.to_string(), *b))),
|
|
||||||
opts.instrument().clone(),
|
opts.instrument().clone(),
|
||||||
opts.slopes()
|
opts.slopes()
|
||||||
.map(|(_, (a, b))| (a.to_string(), b.clone()))
|
.map(|(_, (a, b))| (a.to_string(), b.clone()))
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue