1 | import { Scale } from "./Scale.js";
|
2 | import { optionsFromArguments } from "../core/util/Defaults.js";
|
3 | import { Pow } from "./Pow.js";
|
4 |
|
5 |
|
6 |
|
7 |
|
8 |
|
9 |
|
10 |
|
11 |
|
12 |
|
13 | export class ScaleExp extends Scale {
|
14 | constructor() {
|
15 | const options = optionsFromArguments(ScaleExp.getDefaults(), arguments, ["min", "max", "exponent"]);
|
16 | super(options);
|
17 | this.name = "ScaleExp";
|
18 | this.input = this._exp = new Pow({
|
19 | context: this.context,
|
20 | value: options.exponent,
|
21 | });
|
22 | this._exp.connect(this._mult);
|
23 | }
|
24 | static getDefaults() {
|
25 | return Object.assign(Scale.getDefaults(), {
|
26 | exponent: 1,
|
27 | });
|
28 | }
|
29 | |
30 |
|
31 |
|
32 |
|
33 |
|
34 | get exponent() {
|
35 | return this._exp.value;
|
36 | }
|
37 | set exponent(exp) {
|
38 | this._exp.value = exp;
|
39 | }
|
40 | dispose() {
|
41 | super.dispose();
|
42 | this._exp.dispose();
|
43 | return this;
|
44 | }
|
45 | }
|
46 |
|
\ | No newline at end of file |