Skip to main content

pigstep

GitHub Actions PyPI PyPI - Python Version Code style: black

A beet plugin for importing songs into Minecraft.

Introduction

This beet plugin lets you include songs created with Open Note Block Studio in your project. It takes care of converting .nbs files to data packs.

Features

  • Keep .nbs files alongside the rest of your project
  • Embed note block studio songs into your output data pack
  • Automatically bundle extra notes when needed to support 6 octaves
  • Efficient function tree generation and chord deduplication
  • Flexible, can be used for making custom visualizers

Why not just export from Note Block Studio directly?

  • It's a bit more convenient to set up the plugin once and then have it automatically convert the latest version of the song
  • Less clutter, you can forget about having to navigate around the generated files
  • The plugin bundles the sound files required by your songs, no need to remember to activate the extra notes resource pack or to copy the sounds you need when you start using them

Installation

The package can be installed with pip.

$ pip install pigstep

Usage

The plugin generates scoreboard objectives that must be included in the output data pack. If you're not using it already, running the beet.contrib.scoreboard plugin at the end of the pipeline will create a function that adds all the generated objectives for you.

{
  "pipeline": ["pigstep", "beet.contrib.scoreboard"],
  "meta": {
    "pigstep": {
      "load": ["*.nbs"],
      "source": "ambient",
      "templates": {
        "play": "custom_play.mcfunction"
      }
    }
  }
}

You can require the plugin programmatically by using the pigstep plugin factory.

from beet import Context
from pigstep import pigstep

def my_plugin(ctx: Context):
    ctx.require(
        pigstep(
            load=["*.nbs"],
            source="ambient",
            templates={"play": "custom_play.mcfunction"},
        )
    )

All the configuration is optional. The plugin is a no-op if the load option is not specified or empty. The source option defaults to record. The templates option lets you override the templates used by the plugin.

Here are the functions generated for each song:

  • {namespace}:song/{song_name}/play - Play the song
  • {namespace}:song/{song_name}/pause - Pause the song, to resume run the play function again
  • {namespace}:song/{song_name}/stop - Stop the song, playing the song again will start from the beginning

Contributing

Contributions are welcome. Make sure to first open an issue discussing the problem or the new feature before creating a pull request. The project uses poetry.

$ poetry install

You can run the tests with poetry run pytest.

$ poetry run pytest

The project must type-check with pyright. If you're using VSCode the pylance extension should report diagnostics automatically. You can also install the type-checker locally with npm install and run it from the command-line.

$ npm run watch
$ npm run check

The code follows the black code style. Import statements are sorted with isort.

$ poetry run isort pigstep tests
$ poetry run black pigstep tests
$ poetry run black --check pigstep tests

License - MIT

Metadata

Release files for pigstep 0.2.1

For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.

Source distribution (sdist)

Source distribution for pigstep 0.2.1
File Size Uploaded
pigstep-0.2.1.tar.gz 287.4 kB Details

Built distribution (wheel)

Table of built distributions (wheels) for pigstep 0.2.1
File Interpreter ABI Platform
pigstep-0.2.1-py3-none-any.whl Python 3 none any Details

Total release size: 668.4 kB

Release files / pigstep-0.2.1.tar.gz

Download URL pigstep-0.2.1.tar.gz
Size 287.4 kB
Tags Source
SHA-256 checksum
How to use checksums
b348c798f7a923bae1543fa18a75c6b6054218f2292fdb95ffee220e82537c3c
BLAKE2b-256 checksum
How to use checksums
6488c29ff79e83c6d38b0ad2d5842af7494becd81237cfe584f0a5a1e2101acb
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via twine/3.4.1 importlib_metadata/4.0.1 pkginfo/1.7.0 requests/2.25.1 requests-toolbelt/0.9.1 tqdm/4.60.0 CPython/3.9.4

Release files / pigstep-0.2.1-py3-none-any.whl

Download URL pigstep-0.2.1-py3-none-any.whl
Size 381.0 kB
Tags Python 3
SHA-256 checksum
How to use checksums
f3e58f05b748c3add1089992f1431a26be4179cd9b52ecb2043882edcf9906fd
BLAKE2b-256 checksum
How to use checksums
60e1a3859449b322daebe2c3e926d08353795e6f27ce4ce71b391bb1e31c20c3
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via twine/3.4.1 importlib_metadata/4.0.1 pkginfo/1.7.0 requests/2.25.1 requests-toolbelt/0.9.1 tqdm/4.60.0 CPython/3.9.4

Release history Release notifications | RSS feed

This release

0.2.1 This release

2 release files

0.2.0

2 release files

0.1.0

2 release files

0.0.1

2 release files

0.0.0

2 release files

Anthropic, PBC Visionary sponsor Bloomberg Visionary sponsor Hudson River Trading Visionary sponsor Meta Visionary sponsor NVIDIA Visionary sponsor Microsoft Sustainability sponsor Depot Continuous Integration AWS Cloud computing and Security Sponsor Datadog Monitoring Fastly CDN Google Download Analytics Sentry Error logging StatusPage Status page