Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add empty!() for MIDITrack #174

Closed
NeroBlackstone opened this issue Jul 18, 2024 · 1 comment
Closed

Add empty!() for MIDITrack #174

NeroBlackstone opened this issue Jul 18, 2024 · 1 comment

Comments

@NeroBlackstone
Copy link
Member

NeroBlackstone commented Jul 18, 2024

Is your feature request related to a problem? Please describe.
Sometimes we want to clear a track (remove all events in tracks), but currently no documentation of how this can be done.

Describe the solution you'd like
Implement empty!() for MIDITrack

like:

midi_file = load("sample.mid")
track1 = midi.tracks[1]
# clear all events in track 1
empty!(track1)

We can add empty!(t::MIDITrack)=empty!(t.events) in source code

Describe alternatives you've considered
Not implement this function, just add documentation about how to clear a track.

What do you think?

@Datseris
Copy link
Member

Sure, you can add this overload

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants