Skip to main content

Schematic exporter for Minecraft Note Block Studio, making a galaxy-shaped redstone jukebox, that plays the song.

Project description

Galaxy Jukebox

Schematic exporter for Minecraft Note Block Studio, making a galaxy-shaped redstone jukebox, that plays the song.

Works with old and new versions of the NBS format, and outputs Sponge schematic (WorldEdit can load it, for example).

See Galaxy Jukebox GUI for the graphical interface.

The project is available on PyPI.

See the PyPI page for the screenshots!

screenshot from above

screenshot from the front

Comparison with the traditional walking design

Advantages of this design

  • you don't need to move
  • supports 20 tps, and every other tps (with the scaffolding thing)
  • you can actually see the noteblocks that play (and there are also optional redstone lamps)
  • looks like a colorful galaxy, pretty cool
  • sand doesn't fall (neither does concrete powder)

Drawbacks

  • pretty huge compared to the walking design
  • quite slow, sodium+lithium or a fast PC is strongly recommended for medium-to-large pieces
  • you need quite high render distances, so that all the redstone is loaded
  • most probably it doesn't work properly for pocket edition, though not tested

Installation

You can install the project via pip, if you have Python3 installed:

pip3 install galaxy-jukebox

Usage

From command line

You can convert a single file with:

python3 -m galaxy_jukebox input.nbs output.schem

or by using the dedicated command:

galaxy-jukebox input.nbs output.schem

The 2 conversion options (redstone lamp (bool), and side count / sides mode (-1, 1, 2 or 3)) described later, can also be used here:

galaxy-jukebox input.nbs output.schem False 2

From script

I'll show you how to use it with an example: this script batch converts all the nbs files from the current directory:

#!/usr/bin/env python3

from galaxy_jukebox import convert
from os import listdir

for filename in listdir():
    if filename[-4:] == ".nbs":
        convert(filename, filename[:-4] + ".schem")

This is the header for the convert function:

convert(song, out_path, use_redstone_lamp=True, sides_mode=-1)

Song is either pynbs.File, or a string (input path).

Output path is string.

Use redstone lamp: whether or not to place redstone lamp next to the note block (it looks cooler with lamp, but playback performance may be compromised).

Sides mode is how many sides the noteblocks should have (-1, or between 1 and 3):

  • -1 (automatic): using one of the following 3 based on noteblock count
  • 1: 2n wide, n high rectangle in front
  • 2: 2n×n rectangle to the right, and another in front
  • 3: 2n×n rectangles on all 3 sides

Feedback

Be sure to tell me if something ain't right, e.g. by opening an issue!

How it works

If you're interested in how it works, you can read the documentation locally (or on GitHub), where I try to describe the ideas behind the conversion.

Minecraft version

The program needs 1.14 for:

  • scaffolding (for the 1gt delay, there are other designs too, but this seems the best)
  • smooth granite/andesite slab (aesthetics)
  • birch sign (because we need 1.14, the sign has to have a woodtype)
  • all 16 noteblock sounds (there isn't any check present, whether they are available)
  • 1.13 is probably needed for the .schem support (and blockstates), when pasting the schematic
  • 1.13 for jungle wood (root)

Conversion performance

It is fine in my opinion, it takes 12 seconds to convert the 10 minute version of Genesis of the End on my machine (not a beast).

Improvements that could be made

We could use the volume and panning information, to place the note block at just the right position, so that the volume and panning sounds like it should. Then there would be holes in the wall of note blocks. The work required is first to split the lines/note blocks further (same pitch, different volume needs a different note block this way), and also store the additional information in the note lines. The hardest part would be the algorithm for calculating the best position, taking all the other note lines into account as well (so the note blocks are overall as close to their preferred position, as they can be).

Another idea would be to use command blocks with /playsound instead of note blocks where it makes sense: then we could support custom instruments, and pitch fine tuning (cents).

Huge thanks to these projects!

  • OpenNBS, the program for creating note block music
  • PyNBS, the library for interacting with NBS files
  • MCSchematic, for creating the output schematic file
  • Lithium, Sodium and Phosphor for optimizing the game enough for it to be able to play more complex pieces

Related links

Project details


Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Source Distribution

galaxy-jukebox-1.0.0.tar.gz (5.4 MB view details)

Uploaded Source

Built Distribution

If you're not sure about the file name format, learn more about wheel file names.

galaxy_jukebox-1.0.0-py2.py3-none-any.whl (21.5 kB view details)

Uploaded Python 2Python 3

File details

Details for the file galaxy-jukebox-1.0.0.tar.gz.

File metadata

  • Download URL: galaxy-jukebox-1.0.0.tar.gz
  • Upload date:
  • Size: 5.4 MB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: python-requests/2.25.1

File hashes

Hashes for galaxy-jukebox-1.0.0.tar.gz
Algorithm Hash digest
SHA256 e8ad8f9462ab666be9287e1e3d9515b369d80fc3f233cd14f8cfe0252aaa4cc0
MD5 1c25636305c362eabb886a52b6faf4b8
BLAKE2b-256 e2435386bd54455976dcb1a9968ba61a75bedf745ee28e460db9bfb75357d3e5

See more details on using hashes here.

File details

Details for the file galaxy_jukebox-1.0.0-py2.py3-none-any.whl.

File metadata

File hashes

Hashes for galaxy_jukebox-1.0.0-py2.py3-none-any.whl
Algorithm Hash digest
SHA256 25ffc82d3a9e8dcb9a3d13163074a4c634be8b59b5cbdf362eb29e0144551982
MD5 2cf18e68f58e4d77d70f9903baa240de
BLAKE2b-256 e225087b8b6e9aed6305f8d6d547998f2792922d603fd3fe732f2e018c55c7ca

See more details on using hashes here.

Supported by

AWS Cloud computing and Security Sponsor Datadog Monitoring Depot Continuous Integration Fastly CDN Google Download Analytics Pingdom Monitoring Sentry Error logging StatusPage Status page