drenl
drenl

Reputation: 1333

Change volume setting in ToneJS API

I'm new to the world of library API's, and not having much luck figuring out ToneJS. In particular I, am trying to change the setting on volume.

I've got: let appVol = new Tone.Volume(). I'd like the user to be able to change that default '0' setting. From looking at the link above, it seems like appVol.volume = -12 should work to do this; it does not.

What is the correct code to do this? And if you can explain it - what am I missing here?

Upvotes: 0

Views: 2504

Answers (2)

drenl
drenl

Reputation: 1333

Turns out that .volume, like many properties in ToneJS, is a signal-rate-property ... this means that it needs to be manipulated as such: appVol.volume.value = -12.

Signal-rate properties can be identified in the ToneJS API docs by the presence of a circled "~" to the left of the description.

Upvotes: 3

vm909
vm909

Reputation: 581

Have you connected your volume to a master output? You probably want to change volume via Master, according to the docs.

Upvotes: 0

Related Questions