summaryrefslogtreecommitdiff
path: root/mesecons/mesecons_noteblock
diff options
context:
space:
mode:
Diffstat (limited to 'mesecons/mesecons_noteblock')
-rw-r--r--mesecons/mesecons_noteblock/depends.txt1
-rw-r--r--mesecons/mesecons_noteblock/doc/noteblock/description.html13
-rw-r--r--mesecons/mesecons_noteblock/doc/noteblock/preview.pngbin0 -> 118753 bytes
-rw-r--r--mesecons/mesecons_noteblock/doc/noteblock/recipe.pngbin0 -> 18182 bytes
-rw-r--r--mesecons/mesecons_noteblock/init.lua69
-rw-r--r--mesecons/mesecons_noteblock/sounds/mesecons_noteblock_a.oggbin0 -> 10808 bytes
-rw-r--r--mesecons/mesecons_noteblock/sounds/mesecons_noteblock_a2.oggbin0 -> 11735 bytes
-rw-r--r--mesecons/mesecons_noteblock/sounds/mesecons_noteblock_asharp.oggbin0 -> 10732 bytes
-rw-r--r--mesecons/mesecons_noteblock/sounds/mesecons_noteblock_asharp2.oggbin0 -> 11000 bytes
-rw-r--r--mesecons/mesecons_noteblock/sounds/mesecons_noteblock_b.oggbin0 -> 10282 bytes
-rw-r--r--mesecons/mesecons_noteblock/sounds/mesecons_noteblock_b2.oggbin0 -> 10045 bytes
-rw-r--r--mesecons/mesecons_noteblock/sounds/mesecons_noteblock_c.oggbin0 -> 11670 bytes
-rw-r--r--mesecons/mesecons_noteblock/sounds/mesecons_noteblock_c2.oggbin0 -> 16981 bytes
-rw-r--r--mesecons/mesecons_noteblock/sounds/mesecons_noteblock_crash.oggbin0 -> 50320 bytes
-rw-r--r--mesecons/mesecons_noteblock/sounds/mesecons_noteblock_csharp.oggbin0 -> 11651 bytes
-rw-r--r--mesecons/mesecons_noteblock/sounds/mesecons_noteblock_csharp2.oggbin0 -> 17008 bytes
-rw-r--r--mesecons/mesecons_noteblock/sounds/mesecons_noteblock_d.oggbin0 -> 11175 bytes
-rw-r--r--mesecons/mesecons_noteblock/sounds/mesecons_noteblock_d2.oggbin0 -> 16678 bytes
-rw-r--r--mesecons/mesecons_noteblock/sounds/mesecons_noteblock_dsharp.oggbin0 -> 10882 bytes
-rw-r--r--mesecons/mesecons_noteblock/sounds/mesecons_noteblock_dsharp2.oggbin0 -> 16145 bytes
-rw-r--r--mesecons/mesecons_noteblock/sounds/mesecons_noteblock_e.oggbin0 -> 10829 bytes
-rw-r--r--mesecons/mesecons_noteblock/sounds/mesecons_noteblock_e2.oggbin0 -> 15458 bytes
-rw-r--r--mesecons/mesecons_noteblock/sounds/mesecons_noteblock_f.oggbin0 -> 10990 bytes
-rw-r--r--mesecons/mesecons_noteblock/sounds/mesecons_noteblock_f2.oggbin0 -> 14917 bytes
-rw-r--r--mesecons/mesecons_noteblock/sounds/mesecons_noteblock_fsharp.oggbin0 -> 10509 bytes
-rw-r--r--mesecons/mesecons_noteblock/sounds/mesecons_noteblock_fsharp2.oggbin0 -> 14139 bytes
-rw-r--r--mesecons/mesecons_noteblock/sounds/mesecons_noteblock_g.oggbin0 -> 10465 bytes
-rw-r--r--mesecons/mesecons_noteblock/sounds/mesecons_noteblock_g2.oggbin0 -> 13342 bytes
-rw-r--r--mesecons/mesecons_noteblock/sounds/mesecons_noteblock_gsharp.oggbin0 -> 10595 bytes
-rw-r--r--mesecons/mesecons_noteblock/sounds/mesecons_noteblock_gsharp2.oggbin0 -> 12583 bytes
-rw-r--r--mesecons/mesecons_noteblock/sounds/mesecons_noteblock_hihat.oggbin0 -> 5459 bytes
-rw-r--r--mesecons/mesecons_noteblock/sounds/mesecons_noteblock_kick.oggbin0 -> 10361 bytes
-rw-r--r--mesecons/mesecons_noteblock/sounds/mesecons_noteblock_litecrash.oggbin0 -> 30453 bytes
-rw-r--r--mesecons/mesecons_noteblock/sounds/mesecons_noteblock_snare.oggbin0 -> 9865 bytes
-rw-r--r--mesecons/mesecons_noteblock/textures/mesecons_noteblock.pngbin0 -> 889 bytes
35 files changed, 83 insertions, 0 deletions
diff --git a/mesecons/mesecons_noteblock/depends.txt b/mesecons/mesecons_noteblock/depends.txt
new file mode 100644
index 0000000..acaa924
--- /dev/null
+++ b/mesecons/mesecons_noteblock/depends.txt
@@ -0,0 +1 @@
+mesecons
diff --git a/mesecons/mesecons_noteblock/doc/noteblock/description.html b/mesecons/mesecons_noteblock/doc/noteblock/description.html
new file mode 100644
index 0000000..729bfe1
--- /dev/null
+++ b/mesecons/mesecons_noteblock/doc/noteblock/description.html
@@ -0,0 +1,13 @@
+This effector makes a sound if powered and can be used for making music. Normally it makes piano sounds. The sound frequency can be changed by punching the block. There are some special sounds that depend on the block below:
+<table colspace="5">
+<tr><th>Block Below</th><th>Effect</th></tr>
+<tr><td>Glass</td><td>Hihat</td></tr>
+<tr><td>Stone</td><td>Kick</td></tr>
+<tr><td>Chest</td><td>Snare</td></tr>
+<tr><td>Tree</td><td>Crash</td></tr>
+<tr><td>Glass</td><td>Hihat</td></tr>
+<tr><td>Wood</td><td>Lite Crash</td></tr>
+<tr><td>Coal Block</td><td>Explosion Sound </td></tr>
+<tr><td>Lava Source</td><td>Fire Sound</td></tr>
+<tr><td>Steel Block</td><td>Raises the pitch by one octave</td></tr>
+</table>
diff --git a/mesecons/mesecons_noteblock/doc/noteblock/preview.png b/mesecons/mesecons_noteblock/doc/noteblock/preview.png
new file mode 100644
index 0000000..c4991fb
--- /dev/null
+++ b/mesecons/mesecons_noteblock/doc/noteblock/preview.png
Binary files differ
diff --git a/mesecons/mesecons_noteblock/doc/noteblock/recipe.png b/mesecons/mesecons_noteblock/doc/noteblock/recipe.png
new file mode 100644
index 0000000..d3c3675
--- /dev/null
+++ b/mesecons/mesecons_noteblock/doc/noteblock/recipe.png
Binary files differ
diff --git a/mesecons/mesecons_noteblock/init.lua b/mesecons/mesecons_noteblock/init.lua
new file mode 100644
index 0000000..d5e49ff
--- /dev/null
+++ b/mesecons/mesecons_noteblock/init.lua
@@ -0,0 +1,69 @@
+minetest.register_node("mesecons_noteblock:noteblock", {
+ description = "Noteblock",
+ tiles = {"mesecons_noteblock.png"},
+ groups = {snappy=2, choppy=2, oddly_breakable_by_hand=2},
+ on_punch = function(pos, node) -- change sound when punched
+ node.param2 = (node.param2+1)%12
+ mesecon.noteblock_play(pos, node.param2)
+ minetest.add_node(pos, node)
+ end,
+ sounds = default.node_sound_wood_defaults(),
+ mesecons = {effector = { -- play sound when activated
+ action_on = function(pos, node)
+ mesecon.noteblock_play(pos, node.param2)
+ end
+ }}
+})
+
+minetest.register_craft({
+ output = "mesecons_noteblock:noteblock 1",
+ recipe = {
+ {"group:wood", "group:wood", "group:wood"},
+ {"group:mesecon_conductor_craftable", "default:steel_ingot", "group:mesecon_conductor_craftable"},
+ {"group:wood", "group:wood", "group:wood"},
+ }
+})
+
+local soundnames = {
+ [0] = "mesecons_noteblock_csharp",
+ "mesecons_noteblock_d",
+ "mesecons_noteblock_dsharp",
+ "mesecons_noteblock_e",
+ "mesecons_noteblock_f",
+ "mesecons_noteblock_fsharp",
+ "mesecons_noteblock_g",
+ "mesecons_noteblock_gsharp",
+
+ "mesecons_noteblock_a",
+ "mesecons_noteblock_asharp",
+ "mesecons_noteblock_b",
+ "mesecons_noteblock_c"
+}
+
+local node_sounds = {
+ ["default:glass"] = "mesecons_noteblock_hihat",
+ ["default:stone"] = "mesecons_noteblock_kick",
+ ["default:lava_source"] = "fire_large",
+ ["default:chest"] = "mesecons_noteblock_snare",
+ ["default:tree"] = "mesecons_noteblock_crash",
+ ["default:wood"] = "mesecons_noteblock_litecrash",
+ ["default:coalblock"] = "tnt_explode",
+}
+
+mesecon.noteblock_play = function(pos, param2)
+ pos.y = pos.y-1
+ local nodeunder = minetest.get_node(pos).name
+ local soundname = node_sounds[nodeunder]
+ if not soundname then
+ soundname = soundnames[param2]
+ if not soundname then
+ minetest.log("error", "[mesecons_noteblock] No soundname found, test param2")
+ return
+ end
+ if nodeunder == "default:steelblock" then
+ soundname = soundname.. 2
+ end
+ end
+ pos.y = pos.y+1
+ minetest.sound_play(soundname, {pos = pos})
+end
diff --git a/mesecons/mesecons_noteblock/sounds/mesecons_noteblock_a.ogg b/mesecons/mesecons_noteblock/sounds/mesecons_noteblock_a.ogg
new file mode 100644
index 0000000..331fc1c
--- /dev/null
+++ b/mesecons/mesecons_noteblock/sounds/mesecons_noteblock_a.ogg
Binary files differ
diff --git a/mesecons/mesecons_noteblock/sounds/mesecons_noteblock_a2.ogg b/mesecons/mesecons_noteblock/sounds/mesecons_noteblock_a2.ogg
new file mode 100644
index 0000000..695b0f4
--- /dev/null
+++ b/mesecons/mesecons_noteblock/sounds/mesecons_noteblock_a2.ogg
Binary files differ
diff --git a/mesecons/mesecons_noteblock/sounds/mesecons_noteblock_asharp.ogg b/mesecons/mesecons_noteblock/sounds/mesecons_noteblock_asharp.ogg
new file mode 100644
index 0000000..db96aed
--- /dev/null
+++ b/mesecons/mesecons_noteblock/sounds/mesecons_noteblock_asharp.ogg
Binary files differ
diff --git a/mesecons/mesecons_noteblock/sounds/mesecons_noteblock_asharp2.ogg b/mesecons/mesecons_noteblock/sounds/mesecons_noteblock_asharp2.ogg
new file mode 100644
index 0000000..27bd09d
--- /dev/null
+++ b/mesecons/mesecons_noteblock/sounds/mesecons_noteblock_asharp2.ogg
Binary files differ
diff --git a/mesecons/mesecons_noteblock/sounds/mesecons_noteblock_b.ogg b/mesecons/mesecons_noteblock/sounds/mesecons_noteblock_b.ogg
new file mode 100644
index 0000000..810fe18
--- /dev/null
+++ b/mesecons/mesecons_noteblock/sounds/mesecons_noteblock_b.ogg
Binary files differ
diff --git a/mesecons/mesecons_noteblock/sounds/mesecons_noteblock_b2.ogg b/mesecons/mesecons_noteblock/sounds/mesecons_noteblock_b2.ogg
new file mode 100644
index 0000000..3de1250
--- /dev/null
+++ b/mesecons/mesecons_noteblock/sounds/mesecons_noteblock_b2.ogg
Binary files differ
diff --git a/mesecons/mesecons_noteblock/sounds/mesecons_noteblock_c.ogg b/mesecons/mesecons_noteblock/sounds/mesecons_noteblock_c.ogg
new file mode 100644
index 0000000..5c60d31
--- /dev/null
+++ b/mesecons/mesecons_noteblock/sounds/mesecons_noteblock_c.ogg
Binary files differ
diff --git a/mesecons/mesecons_noteblock/sounds/mesecons_noteblock_c2.ogg b/mesecons/mesecons_noteblock/sounds/mesecons_noteblock_c2.ogg
new file mode 100644
index 0000000..724db7d
--- /dev/null
+++ b/mesecons/mesecons_noteblock/sounds/mesecons_noteblock_c2.ogg
Binary files differ
diff --git a/mesecons/mesecons_noteblock/sounds/mesecons_noteblock_crash.ogg b/mesecons/mesecons_noteblock/sounds/mesecons_noteblock_crash.ogg
new file mode 100644
index 0000000..0308d11
--- /dev/null
+++ b/mesecons/mesecons_noteblock/sounds/mesecons_noteblock_crash.ogg
Binary files differ
diff --git a/mesecons/mesecons_noteblock/sounds/mesecons_noteblock_csharp.ogg b/mesecons/mesecons_noteblock/sounds/mesecons_noteblock_csharp.ogg
new file mode 100644
index 0000000..12c1ef3
--- /dev/null
+++ b/mesecons/mesecons_noteblock/sounds/mesecons_noteblock_csharp.ogg
Binary files differ
diff --git a/mesecons/mesecons_noteblock/sounds/mesecons_noteblock_csharp2.ogg b/mesecons/mesecons_noteblock/sounds/mesecons_noteblock_csharp2.ogg
new file mode 100644
index 0000000..fc7f6c8
--- /dev/null
+++ b/mesecons/mesecons_noteblock/sounds/mesecons_noteblock_csharp2.ogg
Binary files differ
diff --git a/mesecons/mesecons_noteblock/sounds/mesecons_noteblock_d.ogg b/mesecons/mesecons_noteblock/sounds/mesecons_noteblock_d.ogg
new file mode 100644
index 0000000..929b7fb
--- /dev/null
+++ b/mesecons/mesecons_noteblock/sounds/mesecons_noteblock_d.ogg
Binary files differ
diff --git a/mesecons/mesecons_noteblock/sounds/mesecons_noteblock_d2.ogg b/mesecons/mesecons_noteblock/sounds/mesecons_noteblock_d2.ogg
new file mode 100644
index 0000000..dfd702b
--- /dev/null
+++ b/mesecons/mesecons_noteblock/sounds/mesecons_noteblock_d2.ogg
Binary files differ
diff --git a/mesecons/mesecons_noteblock/sounds/mesecons_noteblock_dsharp.ogg b/mesecons/mesecons_noteblock/sounds/mesecons_noteblock_dsharp.ogg
new file mode 100644
index 0000000..eb6045d
--- /dev/null
+++ b/mesecons/mesecons_noteblock/sounds/mesecons_noteblock_dsharp.ogg
Binary files differ
diff --git a/mesecons/mesecons_noteblock/sounds/mesecons_noteblock_dsharp2.ogg b/mesecons/mesecons_noteblock/sounds/mesecons_noteblock_dsharp2.ogg
new file mode 100644
index 0000000..5ac16dd
--- /dev/null
+++ b/mesecons/mesecons_noteblock/sounds/mesecons_noteblock_dsharp2.ogg
Binary files differ
diff --git a/mesecons/mesecons_noteblock/sounds/mesecons_noteblock_e.ogg b/mesecons/mesecons_noteblock/sounds/mesecons_noteblock_e.ogg
new file mode 100644
index 0000000..94977e0
--- /dev/null
+++ b/mesecons/mesecons_noteblock/sounds/mesecons_noteblock_e.ogg
Binary files differ
diff --git a/mesecons/mesecons_noteblock/sounds/mesecons_noteblock_e2.ogg b/mesecons/mesecons_noteblock/sounds/mesecons_noteblock_e2.ogg
new file mode 100644
index 0000000..1dcc0c4
--- /dev/null
+++ b/mesecons/mesecons_noteblock/sounds/mesecons_noteblock_e2.ogg
Binary files differ
diff --git a/mesecons/mesecons_noteblock/sounds/mesecons_noteblock_f.ogg b/mesecons/mesecons_noteblock/sounds/mesecons_noteblock_f.ogg
new file mode 100644
index 0000000..221d926
--- /dev/null
+++ b/mesecons/mesecons_noteblock/sounds/mesecons_noteblock_f.ogg
Binary files differ
diff --git a/mesecons/mesecons_noteblock/sounds/mesecons_noteblock_f2.ogg b/mesecons/mesecons_noteblock/sounds/mesecons_noteblock_f2.ogg
new file mode 100644
index 0000000..acf10db
--- /dev/null
+++ b/mesecons/mesecons_noteblock/sounds/mesecons_noteblock_f2.ogg
Binary files differ
diff --git a/mesecons/mesecons_noteblock/sounds/mesecons_noteblock_fsharp.ogg b/mesecons/mesecons_noteblock/sounds/mesecons_noteblock_fsharp.ogg
new file mode 100644
index 0000000..7af83a8
--- /dev/null
+++ b/mesecons/mesecons_noteblock/sounds/mesecons_noteblock_fsharp.ogg
Binary files differ
diff --git a/mesecons/mesecons_noteblock/sounds/mesecons_noteblock_fsharp2.ogg b/mesecons/mesecons_noteblock/sounds/mesecons_noteblock_fsharp2.ogg
new file mode 100644
index 0000000..a96f637
--- /dev/null
+++ b/mesecons/mesecons_noteblock/sounds/mesecons_noteblock_fsharp2.ogg
Binary files differ
diff --git a/mesecons/mesecons_noteblock/sounds/mesecons_noteblock_g.ogg b/mesecons/mesecons_noteblock/sounds/mesecons_noteblock_g.ogg
new file mode 100644
index 0000000..480ca36
--- /dev/null
+++ b/mesecons/mesecons_noteblock/sounds/mesecons_noteblock_g.ogg
Binary files differ
diff --git a/mesecons/mesecons_noteblock/sounds/mesecons_noteblock_g2.ogg b/mesecons/mesecons_noteblock/sounds/mesecons_noteblock_g2.ogg
new file mode 100644
index 0000000..917b2b9
--- /dev/null
+++ b/mesecons/mesecons_noteblock/sounds/mesecons_noteblock_g2.ogg
Binary files differ
diff --git a/mesecons/mesecons_noteblock/sounds/mesecons_noteblock_gsharp.ogg b/mesecons/mesecons_noteblock/sounds/mesecons_noteblock_gsharp.ogg
new file mode 100644
index 0000000..2e71fea
--- /dev/null
+++ b/mesecons/mesecons_noteblock/sounds/mesecons_noteblock_gsharp.ogg
Binary files differ
diff --git a/mesecons/mesecons_noteblock/sounds/mesecons_noteblock_gsharp2.ogg b/mesecons/mesecons_noteblock/sounds/mesecons_noteblock_gsharp2.ogg
new file mode 100644
index 0000000..941c685
--- /dev/null
+++ b/mesecons/mesecons_noteblock/sounds/mesecons_noteblock_gsharp2.ogg
Binary files differ
diff --git a/mesecons/mesecons_noteblock/sounds/mesecons_noteblock_hihat.ogg b/mesecons/mesecons_noteblock/sounds/mesecons_noteblock_hihat.ogg
new file mode 100644
index 0000000..0afa7c0
--- /dev/null
+++ b/mesecons/mesecons_noteblock/sounds/mesecons_noteblock_hihat.ogg
Binary files differ
diff --git a/mesecons/mesecons_noteblock/sounds/mesecons_noteblock_kick.ogg b/mesecons/mesecons_noteblock/sounds/mesecons_noteblock_kick.ogg
new file mode 100644
index 0000000..10d585b
--- /dev/null
+++ b/mesecons/mesecons_noteblock/sounds/mesecons_noteblock_kick.ogg
Binary files differ
diff --git a/mesecons/mesecons_noteblock/sounds/mesecons_noteblock_litecrash.ogg b/mesecons/mesecons_noteblock/sounds/mesecons_noteblock_litecrash.ogg
new file mode 100644
index 0000000..79ab256
--- /dev/null
+++ b/mesecons/mesecons_noteblock/sounds/mesecons_noteblock_litecrash.ogg
Binary files differ
diff --git a/mesecons/mesecons_noteblock/sounds/mesecons_noteblock_snare.ogg b/mesecons/mesecons_noteblock/sounds/mesecons_noteblock_snare.ogg
new file mode 100644
index 0000000..83a7944
--- /dev/null
+++ b/mesecons/mesecons_noteblock/sounds/mesecons_noteblock_snare.ogg
Binary files differ
diff --git a/mesecons/mesecons_noteblock/textures/mesecons_noteblock.png b/mesecons/mesecons_noteblock/textures/mesecons_noteblock.png
new file mode 100644
index 0000000..7158a49
--- /dev/null
+++ b/mesecons/mesecons_noteblock/textures/mesecons_noteblock.png
Binary files differ