A Streamlit-based web application that converts Japanese text (romaji/hiragana/katakana) into MIDI files with customizable parameters. Perfect for UTAU/DIFFSINGER and other voice synthesis development workflows.
https://text2midi.streamlit.app/ Live demo
- Convert text to MIDI with customizable parameters
- Support for Japanese text input (romaji/hiragana/katakana)
- Special character handling (sokuon っ/ッ and small kana)
- Adjustable BPM and time signature
- Customizable base pitch
- Label file generation for voice synthesis timing
- Real-time label preview
- Automatic silence duration calculation
- Clean and intuitive user interface
- Clone the repository:
git clone https://github.com/yotsuuba/text2midi.git
cd text2midi
- Install the required dependencies:
pip install -r requirements.txt
- streamlit
- pandas
- numpy
- midiutil
- jaconv
- pretty_midi
- Start the Streamlit application:
streamlit run app.py
-
Open your web browser and navigate to
http://localhost:8501
-
Configure the settings in the sidebar:
- BPM (1-300)
- Time Signature
- Base Pitch (21-108)
- Label File Generation
-
Enter your text in the main text area
- Supports hiragana, katakana, or romaji
- Use empty lines to separate clusters
-
Adjust the Label Silence Duration if needed
-
Click "Generate MIDI" to create your files
The application accepts text in the following formats:
- Hiragana: あいうえお
- Katakana: アイウエオ
- Romaji: aiueo
Use empty lines to separate clusters for proper timing:
こんにちは
世界
-
MIDI File (.mid):
- Contains the generated musical notes
- Uses specified BPM and time signature
- Each character/syllable becomes a note
-
Label File (.txt) [Optional]:
- Contains timing information
- Format:
start_time end_time text
- Useful for voice synthesis timing
Parameter | Range | Description |
---|---|---|
BPM | 1-300 | Tempo in beats per minute |
Time Signature | 1-16/1-16 | Musical time signature |
Base Pitch | 21-108 | MIDI note number (C0-C8) |
Label Silence | 0.1-max | Silence duration between labels |
- Fork the repository
- Create your feature branch (
git checkout -b feature/amazing-feature
) - Commit your changes (
git commit -m 'Add amazing feature'
) - Push to the branch (
git push origin feature/amazing-feature
) - Open a Pull Request
Created by H5X2 (2024-2025)
For support, please open an issue in the GitHub repository or contact the maintainers.
- Thanks to the Streamlit team for the amazing framework
- All contributors and users of this tool