Iron Note Block - theoriginalbit/MoarPeripherals GitHub Wiki
![]() |
|---|
| Type: iron_note |
| ID No.: 3472 |
| Name: MoarPeripherals:blockIronNote |
The Iron Note Block is a (turtle-equippable) peripheral block that plays the same sounds as regular Note Blocks - however, while regular versions can only play one instrument at a time (depending on the material of the block placed beneath them), the Iron versions can play any of the five available instruments on demand.
Chords of up to five notes (six in versions prior to 1.3) can be played on each server tick (measured in twentieths of a second), although attempting to exceed a total of five per tenth of a second will trigger a flood-controlling "too many notes" error (aimed at reducing server lag).
An example music playback API / script, "Note", is included with MoarPeripherals.
While a setting for altering the range of the block's played sounds exists in moarperipherals.cfg, at this time it's non-functional.
This MoarPeripherals version of the Iron Note Block is similar to that seen in the MiscPeripherals mod (which is only compatible with older builds of ComputerCraft).
##Functions
| Name | Returns | Description |
|---|---|---|
| playNote(''number'' instrument, ''number'' pitch) | Nothing. | Plays a note of the specified instrument and pitch. Valid pitch values are 0 to 24 (two octaves, from F♯ through to F♯/G♭; refer here for specifics). Note that this function will intentionally error if a single block is asked to play more than five notes within a tenth of a second. |
| Index | Instrument |
|---|---|
| 0 | Piano / Harp |
| 1 | Bass Drum |
| 2 | Snare Drum |
| 3 | Clicks / Sticks |
| 4 | Bass Guitar / Double Bass |
##Recipe

##Code Example Plays a basic scale of C via an attached Iron Note Block, using chords consisting of all five instruments.
local ironNote = peripheral.find("iron_note")
local CScale = {6,8,10,11,13,15,17,18}
for pitch = 1, #CScale do
for instrument = 0, 4 do
ironNote.playNote(instrument, CScale[pitch])
end
sleep(0.5)
end
##Version History
| Build | Date | Details |
|---|---|---|
| v1.3.0 | 8 October 2014 | Fixed problem with number of notes that could be played. |
| v1.2.0 | 4 August 2014 | Now be equippable by Turtles. New texture. New recipe. |
| v1.0.1 | 7 July 2014 | Added Iron Note Block. |
