Skip to content

Commit

Permalink
updated docs example for analyzer
Browse files Browse the repository at this point in the history
  • Loading branch information
bmcfee committed Apr 19, 2022
1 parent bc87167 commit 051c916
Show file tree
Hide file tree
Showing 2 changed files with 8 additions and 8 deletions.
14 changes: 7 additions & 7 deletions crema/analyze.py
Original file line number Diff line number Diff line change
Expand Up @@ -37,20 +37,20 @@ def analyze(filename=None, y=None, sr=None):
--------
>>> from crema.analyze import analyze
>>> import librosa
>>> jam = analyze(filename=librosa.util.example_audio_file())
>>> jam = analyze(filename=librosa.ex('brahms'))
>>> jam
<JAMS(file_metadata=<FileMetadata(...)>,
annotations=[1 annotation],
sandbox=<Sandbox(...)>)>
>>> # Get the chord estimates
>>> chords = jam.annotations['chord', 0]
>>> chords.to_dataframe().head(5)
time duration value confidence
0 0.000000 0.092880 E:maj 0.336977
1 0.092880 0.464399 E:7 0.324255
2 0.557279 1.021678 E:min 0.448759
3 1.578957 2.693515 E:maj 0.501462
4 4.272472 1.486077 E:min 0.287264
time duration value confidence
0 0.000000 3.622313 G:min 0.767835
1 3.622313 1.207438 C:min/5 0.652179
2 4.829751 1.207438 D:maj 0.277913
3 6.037188 4.086712 G:min 0.878656
4 10.123900 1.486077 D#:maj 0.608746
'''

_load_models()
Expand Down
2 changes: 1 addition & 1 deletion docs/index.rst
Original file line number Diff line number Diff line change
Expand Up @@ -49,7 +49,7 @@ The simplest way to apply `crema` is via the command line:
python -m crema.analyze -o my_song.jams /path/to/my_song.ogg
.. note::
Any audio format supported by `librosa <https://librosa.github.io/>`_ will work here.
Any audio format supported by `librosa <https://librosa.org/>`_ will work here.

This command will apply all analyzers to `mysong.ogg` and store the outputs as
`my_song.jams`.
Expand Down

0 comments on commit 051c916

Please sign in to comment.