NBS Player/Jukebox "EasyPlay"

Started by Barnet, Oct 09, 2021, 11:34 PM

Previous topic - Next topic

Barnet

Greetings fellow nerds.

I present to you an actually easy to use noteblock studio player for CC Computers using only modems, monitors and speakers. I was looking for this for quite a while, but couldn't find anything up to date. Most NBS-Player I found were only usable with the old format. So if anyone can direct me to something well made that'd be great. Anyways... together with the nbs decoder from MysticT and some tweaking efforts of SoniEx2 from some years ago, I took on the task of making their program work again with the newer NBS versions and also make it easier to use for Pepegas like me.

Pastebin: 5vaJeT44

How to use:
  • Run the installer (5vaJeT44) -> installer
  • When you want to use a custom speaker setup (instead of the default configuration shown in the video) you need to run the "setup" command and follow the instructions. -> easyPlay setup
  • You can now put NBS files with your trusty windows explorer into the folder of your CC Computer or use the "download" command to get songs form the internet. (https://opennbs.org/songs/ for example) -> easyPlay download <url> <filename>
  • Start a song by using the "start" command. -> easyPlay start <fileName>
  • Profit

Notes:
  • The megalovania.nbs file always gets downloaded with the installation programm so you can always run that off the bat without any hassle.
  • When using a custom setup, make sure to run the "setup" command first. -> easyPlay setup <monitor> <slaves> ...
    Put the side where the monitor (or a modem connected to a monitor) at <monitor> and the side where the modems are that are connected to the speakers at <slaves> (separated by space, just like multiple arguments)
  • If you are confused by the setup command, just run it with any arguments and you'll get a step by step guide on how to get it done.
  • No songs that use custom instruments work with this program.
  • Keep in mind that this is a fairly scuffed program, since its original purpose was to play the old (version 0) NBS files on iron noteblocks from the CC Addon mod with the same name. I just smeared with my crayons a little bit through the code until it worked. So feel free to improve it and post your own version. :)

Update:
I recently updated the program and added some new features.
  • The installer is a little bit smarter now. It overrides all files that already exist instead of throwing errors. So you only need to pastebin the new installer and run that. No need to manually delete the files of older versions of this program.
  • You can now play a whole album by giving the "start" command a folder instead of just a file.
    ex.: easyPlay start songs (when "songs" is a directory that contains nbs files)
    This works recursively. So your "songs" folder can also contain more folders with more songs.
  • In addition to the album play, I also added the possibility to loop and shuffle these albums. Just provide the letters "s" for shuffle or "l" for loop as a 3rd argument when calling "easyPlay start".
    ex.: easyPlay start songs ls <- This would loop and shuffle the provided album
  • There are also some new controls. You can now skip a song by pressing the "D" key and end the program by pressing the "E" key.

pjals_but_noisy

you beat me to it! i was making a nbs player (more like an api) too! it supported v5 nbs, but there was endianness issues :/ i used this api for most of the stuff (it doesn't support little-endian though): click here
a

oliehaku

I have been racking my brain to try and figure out how to install custom songs for this thing in a multiplayer world. Mostly my problem is on player_nbs.lua:57: or nbs.lua:23: where it says that it failed to perform arithmetic on a nil value.
I'm creating the nbs files by loading midi files into nbs and then putting those saves onto pastebin, does that not work with these? Is there a location or source of nbs files that work? I could really use some help figuring this out.

Barnet

Quote from: oliehaku on Mar 07, 2022, 04:41 AMI have been racking my brain to try and figure out how to install custom songs for this thing in a multiplayer world. Mostly my problem is on player_nbs.lua:57: or nbs.lua:23: where it says that it failed to perform arithmetic on a nil value.
I'm creating the nbs files by loading midi files into nbs and then putting those saves onto pastebin, does that not work with these? Is there a location or source of nbs files that work? I could really use some help figuring this out.

This program uses the actual binary nbs files and therefore always parses them through an interpreter beforehand. I don't think you can download files from pastebin as binary. It's always a textfile, which doesn't work. So if you own the server you can just copy and paste the nbs files into the corresponding pc folder, located in the world folder (you have to name the pc first with the "label" command to indentify it). If you don't own the server, you have to upload your nbs file first to somewhere else than pastebin (some filesharing website) and then download the file with my nbs download function to get the full binary file -> easyPlay download <url> <filename>.

Lupus590

Alternatively, you can encode your binary file as base64 before uploading it to pastebin and then decode it on the CC computer before using it.

Also, newer CC:T versions have a file upload feature built into the mod, just drag and drop your file onto the game window while you have a computer GUI open and CC will upload the file to the computer that you have open. (It will have a pop up if it works, if it doesn't pop up then you might be on an old version of CC.)

oliehaku

Ah, this is what I needed to fix it! much appreciated! Sorry for asking so late after the post was made, I found it and this was the only one I could find that worked only using CC: tweaked. Anyways, have a good one and once again thank you for the quick reply!