Giter VIP home page Giter VIP logo

pigstep's Introduction

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

pigstep's People

Contributors

actions-user avatar dependabot[bot] avatar vberlier avatar

Stargazers

 avatar

Watchers

 avatar  avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.