This is a read-only snapshot of the ComputerCraft forums, taken in April 2020.
roger109z's profile picture

The Speaker

Started by roger109z, 28 February 2018 - 10:43 PM
roger109z #1
Posted 28 February 2018 - 11:43 PM
Does anyone know of any documentation for the speaker or at least know what to put in for the instrument argument of playNote?
SquidDev #2
Posted 28 February 2018 - 11:45 PM
There is some information on the GitHub wiki. There's a link to a Minecraft wiki page, which includes more information on possible sounds and instruments.
Bomb Bloke #3
Posted 01 March 2018 - 02:19 AM
Have speakers changed since I last tested them? Last I did, messing with the volume parameter indeed allowed you to change the volume of the sound - up to a certain value, after which it started to affect the range instead.

Which is a really unintuitive way of handling things, hence why I suspect the documentation is in error. I'll have to give them another go if no one knows off the top of their head.
EveryOS #4
Posted 01 March 2018 - 03:48 PM
I found documentation here: https://raw.githubus...lp/speakers.txt
EDIT: This is basically what @SquidDev found, but it is a bit less wall o' texty and has a different example for playsound
Edited on 01 March 2018 - 02:52 PM
SquidDev #5
Posted 01 March 2018 - 04:00 PM
Have speakers changed since I last tested them? Last I did, messing with the volume parameter indeed allowed you to change the volume of the sound - up to a certain value, after which it started to affect the range instead.
That's just how Minecraft's sound system works, it's not anything CC specific. Volume is effectively calculated with Math.clamp(0, 1, volume * distance), and so there's a point where upping the volume only makes it travel further.
Bomb Bloke #6
Posted 02 March 2018 - 02:45 AM
But there's still a range where it does affect the actual volume, yeah? The documentation currently states "a higher volume does not imply a louder sound, merely that it can be heard further away" - indicating that the volume parameter doesn't affect actual volume at all.