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

MiscPeripherals

Started by Razputin, 21 March 2013 - 06:01 AM
Razputin #1
Posted 21 March 2013 - 07:01 AM
How do I get a iron note block to play a note? It always returns nil.



peripheral.wrap("top")
playNote(4,0)
Engineer #2
Posted 21 March 2013 - 07:04 AM
Try this:

local varWichYouCanNameWhatYouWant = peripheral.wrap("top")
varWichYouCanNameWhatYouWant.playNote( 4, 0 )

I am not sure about the parameters
LBPHacker #3
Posted 21 March 2013 - 07:20 AM
I am not sure about the parameters

First parameter is the instrument you want to play on, second is the actual note (0 - 24, just like with usual noteblocks) (0 is C4, 12 is C5, 24 is C6, you can guess the other ones),

Instruments:
0 - piano
1 - bassdrum
2 - snare
3 - click
4 - bass

And heck yeah, you have to wrap it before using it OR
peripheral.call("top", "playNote", 4, 0)