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

Getting the Note Length? #1

Open
shinkuan opened this issue Jun 4, 2020 · 2 comments
Open

Getting the Note Length? #1

shinkuan opened this issue Jun 4, 2020 · 2 comments
Labels
enhancement New feature or request

Comments

@shinkuan
Copy link

shinkuan commented Jun 4, 2020

ex:

foreach(var midiEvent in track.MidiEvents)
    {
        if(midiEvent.MidiEventType == MidiEventType.NoteOn)
        {
            var channel = midiEvent.Channel;
            var note = midiEvent.Note;
            var velocity = midiEvent.Velocity;
            var noteLength = midiEvent.Length //--I want a feature like this, indicate the length of the note (noteOff time - noteOn time)
        }
    }
@shinkuan shinkuan closed this as completed Jun 4, 2020
@davidluzgouveia davidluzgouveia added the enhancement New feature or request label Jun 6, 2020
@LovelyA72
Copy link

Yes, please! Note length is very important in midi music. And this is the most convenient C# midi parser on the internet afaik. Please make this happen!

@PiOver2
Copy link

PiOver2 commented Jan 10, 2022

I have implemented this in a derivative work by splitting midiEvents into MidiOnEvents and MidiOffEvents then calculating the difference in the NoteOn and NoteOff time markers

This is a very nice and robust parser, by the way. I am trying to extract my changes so they can be fully isolated from this example.

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

No branches or pull requests

4 participants