Skip to content

Commit

Permalink
soundfont documentation
Browse files Browse the repository at this point in the history
  • Loading branch information
SamuelJanas committed Nov 17, 2023
1 parent ab94a21 commit cf75adf
Show file tree
Hide file tree
Showing 3 changed files with 12 additions and 1 deletion.
2 changes: 2 additions & 0 deletions docs/documentation/rendering.md
Original file line number Diff line number Diff line change
@@ -1,3 +1,5 @@
These functions provide a simple interface to render audio files from MIDI representations.

::: fortepyan.audio.render

::: fortepyan.audio.soundfont
2 changes: 1 addition & 1 deletion fortepyan/audio/render.py
Original file line number Diff line number Diff line change
Expand Up @@ -67,7 +67,7 @@ def midi_to_mp3(midi: Union[pretty_midi.PrettyMIDI, MidiPiece], mp3_path: str =
The path where the converted MP3 file will be saved. If not specified, a temporary file is created.
Returns:
str: The path to the created MP3 file.
mp3_path (str): The path to the created MP3 file.
Note:
If a `MidiPiece` object is provided, it is first converted to a `pretty_midi.PrettyMIDI` object
Expand Down
9 changes: 9 additions & 0 deletions fortepyan/audio/soundfont.py
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,15 @@


def download_if_needed() -> Path:
"""
Ensures the SoundFont file is downloaded in the user's data directory.
The function checks for 'soundfont.sf2' in the user's data directory, downloading it if absent.
The download URL is sourced from the application's configuration.
Returns:
Path: The path to the SoundFont file.
"""
app_name = "fortepyan"
app_author = "me"

Expand Down

0 comments on commit cf75adf

Please sign in to comment.