galaxy-jukebox


Namegalaxy-jukebox JSON
Version 1.0.0 PyPI version JSON
download
home_pageNone
SummarySchematic exporter for Minecraft Note Block Studio, making a galaxy-shaped redstone jukebox, that plays the song.
upload_time2023-02-04 18:21:46
maintainerNone
docs_urlNone
authorNone
requires_pythonNone
licenseNone
keywords minecraft note block noteblock schematic redstone
VCS
bugtrack_url
requirements No requirements were recorded.
Travis-CI No Travis.
coveralls test coverage No coveralls.
            # 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](https://pypi.org/project/galaxy-jukebox-gui/) for the graphical interface.

The project is available on [PyPI](https://pypi.org/project/galaxy-jukebox/).

<!---Github absolute link, so it works on PyPI at least--->
![See the PyPI page for the screenshots!](https://raw.githubusercontent.com/4321ba/Galaxy_Jukebox/main/converter/screenshots/screenshot_1.png)

![screenshot from above](https://raw.githubusercontent.com/4321ba/Galaxy_Jukebox/main/converter/screenshots/screenshot_2.png)

![screenshot from the front](https://raw.githubusercontent.com/4321ba/Galaxy_Jukebox/main/converter/screenshots/screenshot_3.png)

## 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:

```sh
pip3 install galaxy-jukebox
```

## Usage

### From command line

You can convert a single file with:

```sh
python3 -m galaxy_jukebox input.nbs output.schem
```

or by using the dedicated command:

```sh
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:

```sh
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:

```py
#!/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:

```py
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](https://github.com/4321ba/Galaxy_Jukebox/issues)!

## How it works

If you're interested in how it works, you can read the documentation [locally](documentation.md) (or on [GitHub](https://github.com/4321ba/Galaxy_Jukebox/blob/main/converter/documentation.md)), 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](https://www.youtube.com/watch?v=O0xOAOM_R0Y), 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](https://github.com/OpenNBS/OpenNoteBlockStudio), the program for creating note block music
- [PyNBS](https://github.com/vberlier/pynbs), the library for interacting with NBS files
- [MCSchematic](https://github.com/Sloimayyy/mcschematic), for creating the output schematic file
- [Lithium](https://www.curseforge.com/minecraft/mc-mods/lithium), [Sodium](https://www.curseforge.com/minecraft/mc-mods/sodium) and [Phosphor](https://www.curseforge.com/minecraft/mc-mods/phosphor) for optimizing the game enough for it to be able to play more complex pieces

## Related links

- [Open Noteblock Studio issue](https://github.com/OpenNBS/OpenNoteBlockStudio/issues/310)
- [ONBS schematic export rework project](https://github.com/OpenNBS/OpenNoteBlockStudio/projects/1)
- [Noteblock instruments on MC wiki](https://minecraft.fandom.com/wiki/Note_Block#Instruments)

            

Raw data

            {
    "_id": null,
    "home_page": null,
    "name": "galaxy-jukebox",
    "maintainer": null,
    "docs_url": null,
    "requires_python": null,
    "maintainer_email": null,
    "keywords": "minecraft,note,block,noteblock,schematic,redstone",
    "author": null,
    "author_email": "1234ab <nevenincs007@gmail.com>",
    "download_url": "https://files.pythonhosted.org/packages/e2/43/5386bd54455976dcb1a9968ba61a75bedf745ee28e460db9bfb75357d3e5/galaxy-jukebox-1.0.0.tar.gz",
    "platform": null,
    "description": "# Galaxy Jukebox\n\nSchematic exporter for Minecraft Note Block Studio, making a galaxy-shaped redstone jukebox, that plays the song.\n\nWorks with old and new versions of the NBS format, and outputs Sponge schematic (WorldEdit can load it, for example).\n\nSee [Galaxy Jukebox GUI](https://pypi.org/project/galaxy-jukebox-gui/) for the graphical interface.\n\nThe project is available on [PyPI](https://pypi.org/project/galaxy-jukebox/).\n\n<!---Github absolute link, so it works on PyPI at least--->\n![See the PyPI page for the screenshots!](https://raw.githubusercontent.com/4321ba/Galaxy_Jukebox/main/converter/screenshots/screenshot_1.png)\n\n![screenshot from above](https://raw.githubusercontent.com/4321ba/Galaxy_Jukebox/main/converter/screenshots/screenshot_2.png)\n\n![screenshot from the front](https://raw.githubusercontent.com/4321ba/Galaxy_Jukebox/main/converter/screenshots/screenshot_3.png)\n\n## Comparison with the traditional walking design\n\n### Advantages of this design\n\n+ you don't need to move\n+ supports 20 tps, and every other tps (with the scaffolding thing)\n+ you can actually see the noteblocks that play (and there are also optional redstone lamps)\n+ looks like a colorful galaxy, pretty cool\n+ sand doesn't fall (neither does concrete powder)\n\n### Drawbacks\n\n- pretty huge compared to the walking design\n- quite slow, sodium+lithium or a fast PC is strongly recommended for medium-to-large pieces\n- you need quite high render distances, so that all the redstone is loaded\n- most probably it doesn't work properly for pocket edition, though not tested\n\n## Installation\n\nYou can install the project via pip, if you have Python3 installed:\n\n```sh\npip3 install galaxy-jukebox\n```\n\n## Usage\n\n### From command line\n\nYou can convert a single file with:\n\n```sh\npython3 -m galaxy_jukebox input.nbs output.schem\n```\n\nor by using the dedicated command:\n\n```sh\ngalaxy-jukebox input.nbs output.schem\n```\n\nThe 2 conversion options (redstone lamp (bool), and side count / sides mode (-1, 1, 2 or 3)) described later, can also be used here:\n\n```sh\ngalaxy-jukebox input.nbs output.schem False 2\n```\n\n### From script\n\nI'll show you how to use it with an example: this script batch converts all the nbs files from the current directory:\n\n```py\n#!/usr/bin/env python3\n\nfrom galaxy_jukebox import convert\nfrom os import listdir\n\nfor filename in listdir():\n    if filename[-4:] == \".nbs\":\n        convert(filename, filename[:-4] + \".schem\")\n```\n\nThis is the header for the convert function:\n\n```py\nconvert(song, out_path, use_redstone_lamp=True, sides_mode=-1)\n```\n\nSong is either pynbs.File, or a string (input path).\n\nOutput path is string.\n\nUse 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).\n\nSides mode is how many sides the noteblocks should have (-1, or between 1 and 3):\n\n- -1 (automatic): using one of the following 3 based on noteblock count\n- 1: 2n wide, n high rectangle in front\n- 2: 2n\u00d7n rectangle to the right, and another in front\n- 3: 2n\u00d7n rectangles on all 3 sides\n\n## Feedback\n\nBe sure to tell me if something ain't right, e.g. by opening an [issue](https://github.com/4321ba/Galaxy_Jukebox/issues)!\n\n## How it works\n\nIf you're interested in how it works, you can read the documentation [locally](documentation.md) (or on [GitHub](https://github.com/4321ba/Galaxy_Jukebox/blob/main/converter/documentation.md)), where I try to describe the ideas behind the conversion.\n\n## Minecraft version\n\nThe program needs 1.14 for:\n\n- scaffolding (for the 1gt delay, there are [other designs too](https://www.youtube.com/watch?v=O0xOAOM_R0Y), but this seems the best)\n- smooth granite/andesite slab (aesthetics)\n- birch sign (because we need 1.14, the sign has to have a woodtype)\n- all 16 noteblock sounds (there isn't any check present, whether they are available)\n- 1.13 is probably needed for the .schem support (and blockstates), when pasting the schematic\n- 1.13 for jungle wood (root)\n\n## Conversion performance\n\nIt 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).\n\n## Improvements that could be made\n\nWe 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).\n\nAnother 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).\n\n## Huge thanks to these projects!\n- [OpenNBS](https://github.com/OpenNBS/OpenNoteBlockStudio), the program for creating note block music\n- [PyNBS](https://github.com/vberlier/pynbs), the library for interacting with NBS files\n- [MCSchematic](https://github.com/Sloimayyy/mcschematic), for creating the output schematic file\n- [Lithium](https://www.curseforge.com/minecraft/mc-mods/lithium), [Sodium](https://www.curseforge.com/minecraft/mc-mods/sodium) and [Phosphor](https://www.curseforge.com/minecraft/mc-mods/phosphor) for optimizing the game enough for it to be able to play more complex pieces\n\n## Related links\n\n- [Open Noteblock Studio issue](https://github.com/OpenNBS/OpenNoteBlockStudio/issues/310)\n- [ONBS schematic export rework project](https://github.com/OpenNBS/OpenNoteBlockStudio/projects/1)\n- [Noteblock instruments on MC wiki](https://minecraft.fandom.com/wiki/Note_Block#Instruments)\n",
    "bugtrack_url": null,
    "license": null,
    "summary": "Schematic exporter for Minecraft Note Block Studio, making a galaxy-shaped redstone jukebox, that plays the song.",
    "version": "1.0.0",
    "split_keywords": [
        "minecraft",
        "note",
        "block",
        "noteblock",
        "schematic",
        "redstone"
    ],
    "urls": [
        {
            "comment_text": null,
            "digests": {
                "blake2b_256": "e225087b8b6e9aed6305f8d6d547998f2792922d603fd3fe732f2e018c55c7ca",
                "md5": "2cf18e68f58e4d77d70f9903baa240de",
                "sha256": "25ffc82d3a9e8dcb9a3d13163074a4c634be8b59b5cbdf362eb29e0144551982"
            },
            "downloads": -1,
            "filename": "galaxy_jukebox-1.0.0-py2.py3-none-any.whl",
            "has_sig": false,
            "md5_digest": "2cf18e68f58e4d77d70f9903baa240de",
            "packagetype": "bdist_wheel",
            "python_version": "py2.py3",
            "requires_python": null,
            "size": 21496,
            "upload_time": "2023-02-04T18:21:42",
            "upload_time_iso_8601": "2023-02-04T18:21:42.084258Z",
            "url": "https://files.pythonhosted.org/packages/e2/25/087b8b6e9aed6305f8d6d547998f2792922d603fd3fe732f2e018c55c7ca/galaxy_jukebox-1.0.0-py2.py3-none-any.whl",
            "yanked": false,
            "yanked_reason": null
        },
        {
            "comment_text": null,
            "digests": {
                "blake2b_256": "e2435386bd54455976dcb1a9968ba61a75bedf745ee28e460db9bfb75357d3e5",
                "md5": "1c25636305c362eabb886a52b6faf4b8",
                "sha256": "e8ad8f9462ab666be9287e1e3d9515b369d80fc3f233cd14f8cfe0252aaa4cc0"
            },
            "downloads": -1,
            "filename": "galaxy-jukebox-1.0.0.tar.gz",
            "has_sig": false,
            "md5_digest": "1c25636305c362eabb886a52b6faf4b8",
            "packagetype": "sdist",
            "python_version": "source",
            "requires_python": null,
            "size": 5428182,
            "upload_time": "2023-02-04T18:21:46",
            "upload_time_iso_8601": "2023-02-04T18:21:46.035558Z",
            "url": "https://files.pythonhosted.org/packages/e2/43/5386bd54455976dcb1a9968ba61a75bedf745ee28e460db9bfb75357d3e5/galaxy-jukebox-1.0.0.tar.gz",
            "yanked": false,
            "yanked_reason": null
        }
    ],
    "upload_time": "2023-02-04 18:21:46",
    "github": false,
    "gitlab": false,
    "bitbucket": false,
    "lcname": "galaxy-jukebox"
}
        
Elapsed time: 0.05898s