aboutsummaryrefslogtreecommitdiffstats
path: root/classes/ZZZ.sc
diff options
context:
space:
mode:
Diffstat (limited to 'classes/ZZZ.sc')
-rw-r--r--classes/ZZZ.sc23
1 files changed, 19 insertions, 4 deletions
diff --git a/classes/ZZZ.sc b/classes/ZZZ.sc
index 3f39357..65b18c1 100644
--- a/classes/ZZZ.sc
+++ b/classes/ZZZ.sc
@@ -51,7 +51,6 @@ ZZZ{
},{
voltage = amplitude.lincurve(1.0, 2.5, ampToVACConst, 7.7, -4, nil);
});
- voltage.postln;
^voltage;
}
@@ -69,7 +68,6 @@ ZZZ{
},{
amplitude = voltage.curvelin(ampToVACConst, 7.7, 1.0, 2.5, -4, \max);
});
- amplitude.postln;
^amplitude;
}
@@ -86,7 +84,6 @@ ZZZ{
},{
voltage = frequency.explin(55, 880, 1.0, 5.0, nil);
});
- voltage.postln;
^voltage;
}
@@ -103,8 +100,26 @@ ZZZ{
},{
frequency = voltage.linexp(1.0, 5.0, 55, 880, nil);
});
- frequency.postln;
^frequency;
}
+ /**
+ * Calculates amplitude for supplied frequency.
+ * Wraps call to hzToVAC -> vacToAmp
+ * @return amplitude for corresponding frequency
+ */
+ *hzToAmp{
+ arg frequency;
+ ^this.vacToAmp(this.hzToVAC(frequency));
+ }
+
+ /**
+ * Calculates frequency for supplied amplitude.
+ * Wraps call to ampToVAC -> vacToHz
+ * @return frequency for corresponding amplitude
+ */
+ *ampToHz{
+ arg amplitude;
+ ^this.vacToHz(this.ampToVAC(amplitude));
+ }
}