Skip to content

Commit

Permalink
Merge branch 'release/0.2.9'
Browse files Browse the repository at this point in the history
  • Loading branch information
roszcz committed Aug 27, 2024
2 parents 7790f54 + 717c93b commit e02a73d
Show file tree
Hide file tree
Showing 5 changed files with 14 additions and 10 deletions.
12 changes: 7 additions & 5 deletions docs/index.md
Original file line number Diff line number Diff line change
Expand Up @@ -2,9 +2,11 @@

![GitHub CI](https://github.com/Nospoko/Fortepyan/actions/workflows/ci_tests.yaml/badge.svg?branch=master) [![Python 3.9](https://img.shields.io/badge/python-3.9+-blue.svg)](https://www.python.org/downloads) [![PyPI version](https://img.shields.io/pypi/v/fortepyan.svg)](https://pypi.org/project/fortepyan/) [![PyPI download month](https://img.shields.io/pypi/dm/fortepyan.svg)](https://pypi.org/project/fortepyan/)

Fortepyan is a Python package designed for programmers who work with MIDI data. Its standout feature is the ability to visualize MIDI data in a pianoroll format, providing an intuitive and interactive way to work with musical data.
Fortepyan is a Python package designed for programmers who work with MIDI data.
Its standout feature is the ability to visualize MIDI data in a pianoroll format, providing an intuitive and interactive way to work with musical data.

Creating new midi files is as simple as creating a pandas dataframe. All you need is a couple of lines of code to create a new midi file from scratch.

```python
import fortepyan as ff
import pandas as pd
Expand All @@ -13,10 +15,10 @@ import random
# Create a dataframe with random values
df = pd.DataFrame(
{
"start": [i for i in range(0, 100)],
"duration": [1 for i in range(0, 100)],
"pitch": [random.randint(40, 90) for i in range(0, 100)],
"velocity": [random.randint(40, 90) for i in range(0, 100)],
"start": [it for it in range(0, 100)],
"duration": [1 for it in range(0, 100)],
"pitch": [random.randint(40, 90) for it in range(0, 100)],
"velocity": [random.randint(40, 90) for it in range(0, 100)],
}
)

Expand Down
2 changes: 1 addition & 1 deletion fortepyan/__init__.py
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@
from fortepyan.midi.structures import MidiFile, MidiPiece

__all__ = ["view", "MidiFile", "MidiPiece"]
__version__ = "0.2.8"
__version__ = "0.2.9"

# Pretty MIDI will throw an unwanted error for large files with high PPQ
# This is a workaround
Expand Down
3 changes: 2 additions & 1 deletion fortepyan/midi/structures.py
Original file line number Diff line number Diff line change
Expand Up @@ -348,7 +348,8 @@ def to_midi(self, instrument_name: str = "Piano") -> "MidiFile":
"""
Converts the note data stored in this object into a MIDI track using the specified instrument.
This function creates a MIDI track with notes defined by the object's data. It uses the MidiFile to construct the track and the notes within it.
This function creates a MIDI track with notes defined by the object's data.
It uses the MidiFile to construct the track and the notes within it.
Args:
instrument_name (str, optional):
Expand Down
2 changes: 1 addition & 1 deletion fortepyan/view/pianoroll/structures.py
Original file line number Diff line number Diff line change
Expand Up @@ -138,7 +138,7 @@ class DualPianoRoll(PianoRoll):
_build_image(): Builds the dual-layer piano roll image from the MIDI data, applying color mappings.
"""

base_cmap: Union[str, ListedColormap] = cm.devon_r
base_cmap: Union[str, ListedColormap] = field(default_factory=cm.devon_r)
marked_cmap: Union[str, ListedColormap] = "RdPu"
mark_key: str = "mask"

Expand Down
5 changes: 3 additions & 2 deletions pyproject.toml
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@ build-backend = "setuptools.build_meta"

[project]
name = "fortepyan"
version = "0.2.8"
version = "0.2.9"
description = "Process MIDI piano with (almost) no pain"
readme = "README.md"
authors = [{ name = "Piano For AI", email = "[email protected]" }]
Expand All @@ -20,6 +20,7 @@ keywords = ["midi", "music", "piano"]
dependencies = [
"appdirs>=1.4.4",
"boto3",
"pandas",
"midi2audio>=0.1.1",
"numpy>=1.23.4",
"pretty-midi>=0.2.9",
Expand Down Expand Up @@ -47,7 +48,7 @@ packages = [
]

[tool.bumpver]
current_version = "0.2.8"
current_version = "0.2.9"
version_pattern = "MAJOR.MINOR.PATCH"
commit_message = "bump version {old_version} -> {new_version}"
commit = false
Expand Down

0 comments on commit e02a73d

Please sign in to comment.