Skip to content

Commit

Permalink
Update examples
Browse files Browse the repository at this point in the history
  • Loading branch information
akx committed Feb 8, 2023
1 parent a1effd4 commit ccf02cc
Show file tree
Hide file tree
Showing 2 changed files with 13 additions and 12 deletions.
15 changes: 8 additions & 7 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -51,14 +51,17 @@ pip install miditoolkit
## Example Usage

```python
import miditoolkit
path_midi = miditoolkit.midi.utils.example_midi_file()
midi_obj = miditoolkit.midi.parser.MidiFile(path_midi)
from miditoolkit.midi.parser import MidiFile
from miditoolkit.midi.utils import example_midi_file

path_midi = example_midi_file()
midi_obj = MidiFile(path_midi)

print(midi_obj)
```

"""
Output:
```
ticks per beat: 480
max tick: 72002
tempo changes: 68
Expand All @@ -67,8 +70,6 @@ key sig: 0
markers: 71
lyrics: False
instruments: 2
"""
```
A. [Parse and create MIDI files](examples/parse_and_create_MIDI_files.ipynb)
B. [Piano-roll Manipulation](examples/pinoroll_manipulation.ipynb)
Expand Down
10 changes: 5 additions & 5 deletions test.py
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
import miditoolkit
from miditoolkit.midi.parser import MidiFile
from miditoolkit.midi.utils import example_midi_file

path_midi = example_midi_file()
midi_obj = MidiFile(path_midi)

path_midi = miditoolkit.midi.utils.example_midi_file()
midi_obj = miditoolkit.midi.parser.MidiFile(path_midi)

print(midi_obj)
print(midi_obj)

0 comments on commit ccf02cc

Please sign in to comment.