putao


Nameputao JSON
Version 0.4.1 PyPI version JSON
download
home_pageNone
SummaryPoor man's UTAU
upload_time2024-09-01 14:11:17
maintainerNone
docs_urlNone
authorNone
requires_python>=3.10
licenseNone
keywords synthesis utau
VCS
bugtrack_url
requirements No requirements were recorded.
Travis-CI No Travis.
coveralls test coverage No coveralls.
            # putao: Poor man's UTAU 🍇

![レロレロ](https://github.com/ongyx/putao/blob/main/logo.png?raw=true)

putao is a Python module that allows programmatic creation, editing, and saving of UTAU-style songs.

No more having to wrestle with encoding issues: all filenames and text files use UTF-8, re-encoded from Shift-JIS if necessary.

Originally, it was a joke inspired by [Composite]'s [Bad Apple] script but is now an experimental attempt at creating a voice synthesizer in Python.

## Why name it putao?

Because python + utau = putao. Conincidentally, it means 'grape' (葡萄) in Chinese.

## How it works

putao uses UTAU-format voicebanks (with `oto.ini` files).

The key difference is that putao does not shell out to `resampler.exe`, or any other `.exe` compiled resampler.
putao's resampler is written entierly in Python, thanks to [pyworld].

(Which means it is cross-platform, as long as you have a C compiler for pyworld.)

The resampler's core logic is in [`model.py`](./putao/model.py), which models UTAU elements as python classes.
To create a new resampler, inherit from the `Resampler` class and override the abstract methods.

To save time, putao generates frequency files from pyworld for all the wavfiles in `oto.ini`,
similar to `.frq` files generated by UTAU's `resampler.exe`.
These analysis files are just numpy arrays saved in numpy's native format (hence the `.npy` extension).

Later on when rendering songs, the frequency files can be loaded back into the resampler.

NOTE: You have to use `putao extract <voicebank zipfile> -t <folder>` so the oto.ini and filenames can be read correctly by putao!

## Making a song

`.mml` song files are written with an extended form of [Music Macro Language], described below.

Check out some [examples](./examples): to render them, do the following:
(You need to supply your own UTAU voicebank, though. Make sure to extract with `putao extract` for utf8!).

```
cd examples
putao new <name>
putao render -s <name>.mml
```

where name is one of the `.mml` files, i.e bad_apple.

putao is CLI-only for now; creating a GUI to make songs is currently high priority,
and it will be worked on once putao's API is stabilised.

## MML Syntax

(Anything enclosed in '[]' is optional.)

lengths below may be one of '1', '2', '4', '8', '16', '32', '64'
(1 -> whole note, 2 -> half note, 4 -> quarter note, 8 -> eighth note, etc.)

Core syntax:

    (key)[accidental][length]
        Play a note.

        key must be one of the letters 'abcdefg',
        and accidental may be '+', '#' (sharp) or '-' (flat).
        i.e 'c2'

    p[length] / r[length]
        Pause/rest playing notes.

    o(octave)
        Change the octave of the notes.

        octave must be a integer.

    > / <
        Shift current octave up or down.

    l(length)
        Change the length of the notes.

    t(tempo)
        Change the tempo of the notes.

        tempo must be an integer, in beats per minute.

Extended syntax:

    #[comment]
        A comment.
        Comments can appear anywhere in a line (i.e after commands).
        All text between the '#' until the next newline is ignored.

    @(trackname)
        Add any notes after this to trackname.
        Any notes without a specified track are implictly added to the 'global' track.

    |(lyrics)
        Add lyrics to the current track, split by whitespace.
        Each split is a phoneme.

## Todo

- Add midi support (WIP, 50%)
- GUI

## Install

```
pip install putao
```

On Linux, you may have to install your distro's equivelent of the following packages:

- `libsnffile1`

i.e Debian:

```
sudo apt install libsndfile1
```

## License

MIT.

[Composite]: https://www.youtube.com/c/Composite1618
[Bad Apple]: https://github.com/Composite1618/CompositeMemes/
[pyworld]: https://github.com/JeremyCCHsu/Python-Wrapper-for-World-Vocoder
[Music Macro Language]: https://en.wikipedia.org/wiki/Music_Macro_Language
[flit]: https://flit.pypa.io/en/stable

            

Raw data

            {
    "_id": null,
    "home_page": null,
    "name": "putao",
    "maintainer": null,
    "docs_url": null,
    "requires_python": ">=3.10",
    "maintainer_email": null,
    "keywords": "synthesis, utau",
    "author": null,
    "author_email": "Ong Yong Xin <ongyongxin2020+github@gmail.com>",
    "download_url": "https://files.pythonhosted.org/packages/80/69/a804b12154f5fcf02f9df747bf2c96370f53fcd1dbbb45367f3878452a64/putao-0.4.1.tar.gz",
    "platform": null,
    "description": "# putao: Poor man's UTAU \ud83c\udf47\n\n![\u30ec\u30ed\u30ec\u30ed](https://github.com/ongyx/putao/blob/main/logo.png?raw=true)\n\nputao is a Python module that allows programmatic creation, editing, and saving of UTAU-style songs.\n\nNo more having to wrestle with encoding issues: all filenames and text files use UTF-8, re-encoded from Shift-JIS if necessary.\n\nOriginally, it was a joke inspired by [Composite]'s [Bad Apple] script but is now an experimental attempt at creating a voice synthesizer in Python.\n\n## Why name it putao?\n\nBecause python + utau = putao. Conincidentally, it means 'grape' (\u8461\u8404) in Chinese.\n\n## How it works\n\nputao uses UTAU-format voicebanks (with `oto.ini` files).\n\nThe key difference is that putao does not shell out to `resampler.exe`, or any other `.exe` compiled resampler.\nputao's resampler is written entierly in Python, thanks to [pyworld].\n\n(Which means it is cross-platform, as long as you have a C compiler for pyworld.)\n\nThe resampler's core logic is in [`model.py`](./putao/model.py), which models UTAU elements as python classes.\nTo create a new resampler, inherit from the `Resampler` class and override the abstract methods.\n\nTo save time, putao generates frequency files from pyworld for all the wavfiles in `oto.ini`,\nsimilar to `.frq` files generated by UTAU's `resampler.exe`.\nThese analysis files are just numpy arrays saved in numpy's native format (hence the `.npy` extension).\n\nLater on when rendering songs, the frequency files can be loaded back into the resampler.\n\nNOTE: You have to use `putao extract <voicebank zipfile> -t <folder>` so the oto.ini and filenames can be read correctly by putao!\n\n## Making a song\n\n`.mml` song files are written with an extended form of [Music Macro Language], described below.\n\nCheck out some [examples](./examples): to render them, do the following:\n(You need to supply your own UTAU voicebank, though. Make sure to extract with `putao extract` for utf8!).\n\n```\ncd examples\nputao new <name>\nputao render -s <name>.mml\n```\n\nwhere name is one of the `.mml` files, i.e bad_apple.\n\nputao is CLI-only for now; creating a GUI to make songs is currently high priority,\nand it will be worked on once putao's API is stabilised.\n\n## MML Syntax\n\n(Anything enclosed in '[]' is optional.)\n\nlengths below may be one of '1', '2', '4', '8', '16', '32', '64'\n(1 -> whole note, 2 -> half note, 4 -> quarter note, 8 -> eighth note, etc.)\n\nCore syntax:\n\n    (key)[accidental][length]\n        Play a note.\n\n        key must be one of the letters 'abcdefg',\n        and accidental may be '+', '#' (sharp) or '-' (flat).\n        i.e 'c2'\n\n    p[length] / r[length]\n        Pause/rest playing notes.\n\n    o(octave)\n        Change the octave of the notes.\n\n        octave must be a integer.\n\n    > / <\n        Shift current octave up or down.\n\n    l(length)\n        Change the length of the notes.\n\n    t(tempo)\n        Change the tempo of the notes.\n\n        tempo must be an integer, in beats per minute.\n\nExtended syntax:\n\n    #[comment]\n        A comment.\n        Comments can appear anywhere in a line (i.e after commands).\n        All text between the '#' until the next newline is ignored.\n\n    @(trackname)\n        Add any notes after this to trackname.\n        Any notes without a specified track are implictly added to the 'global' track.\n\n    |(lyrics)\n        Add lyrics to the current track, split by whitespace.\n        Each split is a phoneme.\n\n## Todo\n\n- Add midi support (WIP, 50%)\n- GUI\n\n## Install\n\n```\npip install putao\n```\n\nOn Linux, you may have to install your distro's equivelent of the following packages:\n\n- `libsnffile1`\n\ni.e Debian:\n\n```\nsudo apt install libsndfile1\n```\n\n## License\n\nMIT.\n\n[Composite]: https://www.youtube.com/c/Composite1618\n[Bad Apple]: https://github.com/Composite1618/CompositeMemes/\n[pyworld]: https://github.com/JeremyCCHsu/Python-Wrapper-for-World-Vocoder\n[Music Macro Language]: https://en.wikipedia.org/wiki/Music_Macro_Language\n[flit]: https://flit.pypa.io/en/stable\n",
    "bugtrack_url": null,
    "license": null,
    "summary": "Poor man's UTAU",
    "version": "0.4.1",
    "project_urls": {
        "Source code": "https://github.com/ongyx/putao"
    },
    "split_keywords": [
        "synthesis",
        " utau"
    ],
    "urls": [
        {
            "comment_text": null,
            "digests": {
                "blake2b_256": "0417064ec34fec05a56ffc6995c39f64c1e902ff392bd9cc8c2c7b18466c94c0",
                "md5": "e8789385a907139d100dd202d3189bad",
                "sha256": "588e5d94331ba766c2520241d60e9f4f77176eb376d8513dadc45a79e1297fd9"
            },
            "downloads": -1,
            "filename": "putao-0.4.1-py3-none-any.whl",
            "has_sig": false,
            "md5_digest": "e8789385a907139d100dd202d3189bad",
            "packagetype": "bdist_wheel",
            "python_version": "py3",
            "requires_python": ">=3.10",
            "size": 22154,
            "upload_time": "2024-09-01T14:11:15",
            "upload_time_iso_8601": "2024-09-01T14:11:15.065744Z",
            "url": "https://files.pythonhosted.org/packages/04/17/064ec34fec05a56ffc6995c39f64c1e902ff392bd9cc8c2c7b18466c94c0/putao-0.4.1-py3-none-any.whl",
            "yanked": false,
            "yanked_reason": null
        },
        {
            "comment_text": null,
            "digests": {
                "blake2b_256": "8069a804b12154f5fcf02f9df747bf2c96370f53fcd1dbbb45367f3878452a64",
                "md5": "3c0236ee8b552c0ce2a72a9e8ad81d97",
                "sha256": "c846a31e10edca042547d3af27875ca7384d14639a9497c40dac76ad59e40837"
            },
            "downloads": -1,
            "filename": "putao-0.4.1.tar.gz",
            "has_sig": false,
            "md5_digest": "3c0236ee8b552c0ce2a72a9e8ad81d97",
            "packagetype": "sdist",
            "python_version": "source",
            "requires_python": ">=3.10",
            "size": 21394,
            "upload_time": "2024-09-01T14:11:17",
            "upload_time_iso_8601": "2024-09-01T14:11:17.242775Z",
            "url": "https://files.pythonhosted.org/packages/80/69/a804b12154f5fcf02f9df747bf2c96370f53fcd1dbbb45367f3878452a64/putao-0.4.1.tar.gz",
            "yanked": false,
            "yanked_reason": null
        }
    ],
    "upload_time": "2024-09-01 14:11:17",
    "github": true,
    "gitlab": false,
    "bitbucket": false,
    "codeberg": false,
    "github_user": "ongyx",
    "github_project": "putao",
    "travis_ci": false,
    "coveralls": false,
    "github_actions": false,
    "lcname": "putao"
}
        
Elapsed time: 0.32446s