diff options
Diffstat (limited to 'mesecons/mesecons_noteblock')
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 Binary files differnew file mode 100644 index 0000000..c4991fb --- /dev/null +++ b/mesecons/mesecons_noteblock/doc/noteblock/preview.png diff --git a/mesecons/mesecons_noteblock/doc/noteblock/recipe.png b/mesecons/mesecons_noteblock/doc/noteblock/recipe.png Binary files differnew file mode 100644 index 0000000..d3c3675 --- /dev/null +++ b/mesecons/mesecons_noteblock/doc/noteblock/recipe.png 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 Binary files differnew file mode 100644 index 0000000..331fc1c --- /dev/null +++ b/mesecons/mesecons_noteblock/sounds/mesecons_noteblock_a.ogg diff --git a/mesecons/mesecons_noteblock/sounds/mesecons_noteblock_a2.ogg b/mesecons/mesecons_noteblock/sounds/mesecons_noteblock_a2.ogg Binary files differnew file mode 100644 index 0000000..695b0f4 --- /dev/null +++ b/mesecons/mesecons_noteblock/sounds/mesecons_noteblock_a2.ogg diff --git a/mesecons/mesecons_noteblock/sounds/mesecons_noteblock_asharp.ogg b/mesecons/mesecons_noteblock/sounds/mesecons_noteblock_asharp.ogg Binary files differnew file mode 100644 index 0000000..db96aed --- /dev/null +++ b/mesecons/mesecons_noteblock/sounds/mesecons_noteblock_asharp.ogg diff --git a/mesecons/mesecons_noteblock/sounds/mesecons_noteblock_asharp2.ogg b/mesecons/mesecons_noteblock/sounds/mesecons_noteblock_asharp2.ogg Binary files differnew file mode 100644 index 0000000..27bd09d --- /dev/null +++ b/mesecons/mesecons_noteblock/sounds/mesecons_noteblock_asharp2.ogg diff --git a/mesecons/mesecons_noteblock/sounds/mesecons_noteblock_b.ogg b/mesecons/mesecons_noteblock/sounds/mesecons_noteblock_b.ogg Binary files differnew file mode 100644 index 0000000..810fe18 --- /dev/null +++ b/mesecons/mesecons_noteblock/sounds/mesecons_noteblock_b.ogg diff --git a/mesecons/mesecons_noteblock/sounds/mesecons_noteblock_b2.ogg b/mesecons/mesecons_noteblock/sounds/mesecons_noteblock_b2.ogg Binary files differnew file mode 100644 index 0000000..3de1250 --- /dev/null +++ b/mesecons/mesecons_noteblock/sounds/mesecons_noteblock_b2.ogg diff --git a/mesecons/mesecons_noteblock/sounds/mesecons_noteblock_c.ogg b/mesecons/mesecons_noteblock/sounds/mesecons_noteblock_c.ogg Binary files differnew file mode 100644 index 0000000..5c60d31 --- /dev/null +++ b/mesecons/mesecons_noteblock/sounds/mesecons_noteblock_c.ogg diff --git a/mesecons/mesecons_noteblock/sounds/mesecons_noteblock_c2.ogg b/mesecons/mesecons_noteblock/sounds/mesecons_noteblock_c2.ogg Binary files differnew file mode 100644 index 0000000..724db7d --- /dev/null +++ b/mesecons/mesecons_noteblock/sounds/mesecons_noteblock_c2.ogg diff --git a/mesecons/mesecons_noteblock/sounds/mesecons_noteblock_crash.ogg b/mesecons/mesecons_noteblock/sounds/mesecons_noteblock_crash.ogg Binary files differnew file mode 100644 index 0000000..0308d11 --- /dev/null +++ b/mesecons/mesecons_noteblock/sounds/mesecons_noteblock_crash.ogg diff --git a/mesecons/mesecons_noteblock/sounds/mesecons_noteblock_csharp.ogg b/mesecons/mesecons_noteblock/sounds/mesecons_noteblock_csharp.ogg Binary files differnew file mode 100644 index 0000000..12c1ef3 --- /dev/null +++ b/mesecons/mesecons_noteblock/sounds/mesecons_noteblock_csharp.ogg diff --git a/mesecons/mesecons_noteblock/sounds/mesecons_noteblock_csharp2.ogg b/mesecons/mesecons_noteblock/sounds/mesecons_noteblock_csharp2.ogg Binary files differnew file mode 100644 index 0000000..fc7f6c8 --- /dev/null +++ b/mesecons/mesecons_noteblock/sounds/mesecons_noteblock_csharp2.ogg diff --git a/mesecons/mesecons_noteblock/sounds/mesecons_noteblock_d.ogg b/mesecons/mesecons_noteblock/sounds/mesecons_noteblock_d.ogg Binary files differnew file mode 100644 index 0000000..929b7fb --- /dev/null +++ b/mesecons/mesecons_noteblock/sounds/mesecons_noteblock_d.ogg diff --git a/mesecons/mesecons_noteblock/sounds/mesecons_noteblock_d2.ogg b/mesecons/mesecons_noteblock/sounds/mesecons_noteblock_d2.ogg Binary files differnew file mode 100644 index 0000000..dfd702b --- /dev/null +++ b/mesecons/mesecons_noteblock/sounds/mesecons_noteblock_d2.ogg diff --git a/mesecons/mesecons_noteblock/sounds/mesecons_noteblock_dsharp.ogg b/mesecons/mesecons_noteblock/sounds/mesecons_noteblock_dsharp.ogg Binary files differnew file mode 100644 index 0000000..eb6045d --- /dev/null +++ b/mesecons/mesecons_noteblock/sounds/mesecons_noteblock_dsharp.ogg diff --git a/mesecons/mesecons_noteblock/sounds/mesecons_noteblock_dsharp2.ogg b/mesecons/mesecons_noteblock/sounds/mesecons_noteblock_dsharp2.ogg Binary files differnew file mode 100644 index 0000000..5ac16dd --- /dev/null +++ b/mesecons/mesecons_noteblock/sounds/mesecons_noteblock_dsharp2.ogg diff --git a/mesecons/mesecons_noteblock/sounds/mesecons_noteblock_e.ogg b/mesecons/mesecons_noteblock/sounds/mesecons_noteblock_e.ogg Binary files differnew file mode 100644 index 0000000..94977e0 --- /dev/null +++ b/mesecons/mesecons_noteblock/sounds/mesecons_noteblock_e.ogg diff --git a/mesecons/mesecons_noteblock/sounds/mesecons_noteblock_e2.ogg b/mesecons/mesecons_noteblock/sounds/mesecons_noteblock_e2.ogg Binary files differnew file mode 100644 index 0000000..1dcc0c4 --- /dev/null +++ b/mesecons/mesecons_noteblock/sounds/mesecons_noteblock_e2.ogg diff --git a/mesecons/mesecons_noteblock/sounds/mesecons_noteblock_f.ogg b/mesecons/mesecons_noteblock/sounds/mesecons_noteblock_f.ogg Binary files differnew file mode 100644 index 0000000..221d926 --- /dev/null +++ b/mesecons/mesecons_noteblock/sounds/mesecons_noteblock_f.ogg diff --git a/mesecons/mesecons_noteblock/sounds/mesecons_noteblock_f2.ogg b/mesecons/mesecons_noteblock/sounds/mesecons_noteblock_f2.ogg Binary files differnew file mode 100644 index 0000000..acf10db --- /dev/null +++ b/mesecons/mesecons_noteblock/sounds/mesecons_noteblock_f2.ogg diff --git a/mesecons/mesecons_noteblock/sounds/mesecons_noteblock_fsharp.ogg b/mesecons/mesecons_noteblock/sounds/mesecons_noteblock_fsharp.ogg Binary files differnew file mode 100644 index 0000000..7af83a8 --- /dev/null +++ b/mesecons/mesecons_noteblock/sounds/mesecons_noteblock_fsharp.ogg diff --git a/mesecons/mesecons_noteblock/sounds/mesecons_noteblock_fsharp2.ogg b/mesecons/mesecons_noteblock/sounds/mesecons_noteblock_fsharp2.ogg Binary files differnew file mode 100644 index 0000000..a96f637 --- /dev/null +++ b/mesecons/mesecons_noteblock/sounds/mesecons_noteblock_fsharp2.ogg diff --git a/mesecons/mesecons_noteblock/sounds/mesecons_noteblock_g.ogg b/mesecons/mesecons_noteblock/sounds/mesecons_noteblock_g.ogg Binary files differnew file mode 100644 index 0000000..480ca36 --- /dev/null +++ b/mesecons/mesecons_noteblock/sounds/mesecons_noteblock_g.ogg diff --git a/mesecons/mesecons_noteblock/sounds/mesecons_noteblock_g2.ogg b/mesecons/mesecons_noteblock/sounds/mesecons_noteblock_g2.ogg Binary files differnew file mode 100644 index 0000000..917b2b9 --- /dev/null +++ b/mesecons/mesecons_noteblock/sounds/mesecons_noteblock_g2.ogg diff --git a/mesecons/mesecons_noteblock/sounds/mesecons_noteblock_gsharp.ogg b/mesecons/mesecons_noteblock/sounds/mesecons_noteblock_gsharp.ogg Binary files differnew file mode 100644 index 0000000..2e71fea --- /dev/null +++ b/mesecons/mesecons_noteblock/sounds/mesecons_noteblock_gsharp.ogg diff --git a/mesecons/mesecons_noteblock/sounds/mesecons_noteblock_gsharp2.ogg b/mesecons/mesecons_noteblock/sounds/mesecons_noteblock_gsharp2.ogg Binary files differnew file mode 100644 index 0000000..941c685 --- /dev/null +++ b/mesecons/mesecons_noteblock/sounds/mesecons_noteblock_gsharp2.ogg diff --git a/mesecons/mesecons_noteblock/sounds/mesecons_noteblock_hihat.ogg b/mesecons/mesecons_noteblock/sounds/mesecons_noteblock_hihat.ogg Binary files differnew file mode 100644 index 0000000..0afa7c0 --- /dev/null +++ b/mesecons/mesecons_noteblock/sounds/mesecons_noteblock_hihat.ogg diff --git a/mesecons/mesecons_noteblock/sounds/mesecons_noteblock_kick.ogg b/mesecons/mesecons_noteblock/sounds/mesecons_noteblock_kick.ogg Binary files differnew file mode 100644 index 0000000..10d585b --- /dev/null +++ b/mesecons/mesecons_noteblock/sounds/mesecons_noteblock_kick.ogg diff --git a/mesecons/mesecons_noteblock/sounds/mesecons_noteblock_litecrash.ogg b/mesecons/mesecons_noteblock/sounds/mesecons_noteblock_litecrash.ogg Binary files differnew file mode 100644 index 0000000..79ab256 --- /dev/null +++ b/mesecons/mesecons_noteblock/sounds/mesecons_noteblock_litecrash.ogg diff --git a/mesecons/mesecons_noteblock/sounds/mesecons_noteblock_snare.ogg b/mesecons/mesecons_noteblock/sounds/mesecons_noteblock_snare.ogg Binary files differnew file mode 100644 index 0000000..83a7944 --- /dev/null +++ b/mesecons/mesecons_noteblock/sounds/mesecons_noteblock_snare.ogg diff --git a/mesecons/mesecons_noteblock/textures/mesecons_noteblock.png b/mesecons/mesecons_noteblock/textures/mesecons_noteblock.png Binary files differnew file mode 100644 index 0000000..7158a49 --- /dev/null +++ b/mesecons/mesecons_noteblock/textures/mesecons_noteblock.png |