NoteMod 2

ITR

l̺̤͈̘̰̺͉̳͉̖̝̱̻̠̦͈ͅ֍̫̜̥̭͖̱̟̟͉͙̜̰ͅl̺̤͈̘̰̺͉̳͉̖̝̱̻̠̦͈ͅ
Staff member
#1
A lot of thanks to AvarethTaika for providing sounds, StuChris for providing models+textures for the Logic Block and the NoteBlock, and Eriyo2000 for additional input on models!

NB: Needs more stuff! Post below or message me on Discord if you wanna help!

This mod allows you to create automatic music machines in Besiege. It contains a Note Block, an IO Block, and a Delay Block. It also features a tick-based logic system which hooks automatically into all blocks in besiege with a key.


The IO system has a GUI-window named "IO", containing two toggles "Link" and "UnLink".
If you have "Link" toggled on and hover over an Output Block and press "Q", then hover over an Input Block and press Q again, you will create a link from that Output Block to the Input Block. UnLink unlinks a previously created link with the same actions.

There can be multiple output-blocks connected to one Input Block, where if any of those output blocks are outputting "True", the input of the Input block will be "True". This is also known as an "Or" gate.

An Input Block is any block that you can assign a key to. If the input to the Input Block is "True", it will be the same as if the key is down for that block. Note that this will work in addition to that blocks other inputs.

An Output Block is any block that can output. Currently, the only ones that can do this are the IO Block and the Delay Block, both of which happen to also be Input Blocks. Output Blocks are black when outputting "False", and Red when outputting "True".

The Delay Block takes the input and delays it the designated amount of time before outputting. The "Extend Output" toggle makes it so any "True" output will be outputted immediately, but any "False" output will still be delayed. Note that the IO system uses ticks on a 16ms timer, so anything not a multiple of 16 ms will be ceiled up.

The Logic Block continuously outputs either "True" or "False", which is designated by the "Start State". Hold to reverse decides whether you have to hold the designated key to invert the output from the initial output, or have it invert every time you press it. If you have both Hold To Reverse and Start State on, it is effectively a "Not" gate.

The Note Block plays the chosen note when the key is pressed or the block is clicked on. QuickPlay decides whether the audio will restart playing if you press the key twice before it finishes playing. Speed changes the pitch and tempo of the song. Note that speed uses % to allow greater precision.

Additional Notes:
  • The key used to Link and UnLink blocks can be changed in Ctrl+J
  • The mod is installed by extracting the contents of the attached Zip-Folder to your "Mods" folder. Remember to install Spaar's Modloader first, and to merge the contents of the "Resources" folder.
  • If it doesn't work, you either installed it incorrectly (Most likely by not merging the "Resources" folder in the zip-file with the "Resources" folder in the "Mods" folder, or you are using this way into the future, when features of this mod no longer works.
  • Since the mod uses reflection to hijack the key system, it has to check through a Dictionary approximately each frame * the amount of blocks with keys you have on the currently loaded machine, so it may cause some lag
Download: http://www.mediafire.com/file/3sn8r8tvcdt2ci1/NoteMod2.zip
 
Last edited:

ITR

l̺̤͈̘̰̺͉̳͉̖̝̱̻̠̦͈ͅ֍̫̜̥̭͖̱̟̟͉͙̜̰ͅl̺̤͈̘̰̺͉̳͉̖̝̱̻̠̦͈ͅ
Staff member
#2
Btw, this should be turing complete, so computers are fully possible.

Also, modded blocks should work with this, so you can have input if you combine this with the Automatron+SensorMod
 

ITR

l̺̤͈̘̰̺͉̳͉̖̝̱̻̠̦͈ͅ֍̫̜̥̭͖̱̟̟͉͙̜̰ͅl̺̤͈̘̰̺͉̳͉̖̝̱̻̠̦͈ͅ
Staff member
#6
i'll try and make some models for the blocks, i have a couple interesting ideas
Keep in mind that if you also make graphics, they'd have to fit with the "black when False, white when True" thingy for the Output blocks (though I could change black to some other color)
 
#7
when it changes color is that the texture changing to a different file, or the blocks actual color? also, does the note block only play piano?
 

ITR

l̺̤͈̘̰̺͉̳͉̖̝̱̻̠̦͈ͅ֍̫̜̥̭͖̱̟̟͉͙̜̰ͅl̺̤͈̘̰̺͉̳͉̖̝̱̻̠̦͈ͅ
Staff member
#8
when it changes color is that the texture changing to a different file, or the blocks actual color? also, does the note block only play piano?
It's technically just changing the color, but I can make it change texture instead too

Currently it only plays piano, but I can easily make it play more stuff
 

ITR

l̺̤͈̘̰̺͉̳͉̖̝̱̻̠̦͈ͅ֍̫̜̥̭͖̱̟̟͉͙̜̰ͅl̺̤͈̘̰̺͉̳͉̖̝̱̻̠̦͈ͅ
Staff member
#9
New Update! Renamed IO Blocks to Logic Blocks, and made them start with whatever startstate they have instead of instantly switching to it.
Also used HoveredBlock from AddPiece instead of using raycasting, so it should be easier to link or unlink blocks now.

Added 2 more blocks, one that activates when something is inside it, and another one that activates if it's burned or hit by water.
 

ITR

l̺̤͈̘̰̺͉̳͉̖̝̱̻̠̦͈ͅ֍̫̜̥̭͖̱̟̟͉͙̜̰ͅl̺̤͈̘̰̺͉̳͉̖̝̱̻̠̦͈ͅ
Staff member
#10
New Update! Fixed some bugs that made the new blocks not store their connections, added new models and sounds provided by StuChris and Avareth respectively, and added a Color Block that can display colors!
Note that the textures for the logic block are temporary, as I ran into some problems with importing them.
 
#11
could you possibly add an octave toggle/slider? ive been trying to achive notes of different octaves with the speed slider, but it sometimes is too fast, and the sound can sound... off
 

ITR

l̺̤͈̘̰̺͉̳͉̖̝̱̻̠̦͈ͅ֍̫̜̥̭͖̱̟̟͉͙̜̰ͅl̺̤͈̘̰̺͉̳͉̖̝̱̻̠̦͈ͅ
Staff member
#13
could you possibly add an octave toggle/slider? ive been trying to achive notes of different octaves with the speed slider, but it sometimes is too fast, and the sound can sound... off
That would require having sound files for each octave, or getting some library that can change the pitch runtime (which might cause more lag), so no
 
#14
also, the old piano sound seems to have gone, and it was perfect for a project i was working on, with the new update, it sounds like a completely different piano AND different notes :/
 

ITR

l̺̤͈̘̰̺͉̳͉̖̝̱̻̠̦͈ͅ֍̫̜̥̭͖̱̟̟͉͙̜̰ͅl̺̤͈̘̰̺͉̳͉̖̝̱̻̠̦͈ͅ
Staff member
#15
also, the old piano sound seems to have gone, and it was perfect for a project i was working on, with the new update, it sounds like a completely different piano AND different notes :/
Yeah, they're a different set that were G sentered, while these are C centered
 

Sanpyr

Active Member
#16
probably necroposting (sorry), but the Delay Block doesn't work.
not sure if i'm just doing it wrong, but it won't change state (all the other blocks work fine)
there isn't any errors either
 

Sanpyr

Active Member
#17
also worth mentioning the Delay Block doesn't even change color: it is completely unresponsive to any input, regardless of settings
 
Top