rageagainsthepc / GuitarPro-to-Midi

Convert all GuitarPro formats (3 to 7) to Midi simulating bending, overtones etc.
64 stars 7 forks source link

Error: Unknown enum value. (Parameter 'trip') Actual value was eigth. #22

Open AdamSEY opened 1 year ago

AdamSEY commented 1 year ago

I'm not an expert programmer but I suggest that we do the following changes to skip invalid data:

    var trip = _barMaster[measureIndex].TripletFeel;
    // Check if the value of trip is a valid enum value
    if (!Enum.IsDefined(typeof(TripletFeel), trip))
    {
        // Skip this data and move on to the next iteration
        continue;
    }       

Here's the GP file: Difficult_To_Cure_Live_At_BudokanTokyoJapan1984 (2).gp.zip

rageagainsthepc commented 1 year ago

I'm missing a little bit of context here. Does the program abort when it fails to convert trip to an enum?

AdamSEY commented 1 year ago

That's completely right! You can try it.

rageagainsthepc commented 1 year ago

I agree the program should continue instead of simply exiting with an error, but usually when we encounter these kinds of errors it's not caused by invalid data. I think it's most likely something that simply isn't implemented yet. We should at least issue a warning here instead of silently skipping over this measure. Feel free to create a PR and I will review it. If you know what the meaning of this unknown value is you could also try to implement that.

AdamSEY commented 1 year ago

Please take a look: https://github.com/rageagainsthepc/GuitarPro-to-Midi/pull/23

m41w4r3exe commented 9 months ago

I'm facing this error and it causes conversion to abort, warning and continue conversion would have been preferred! Could you have time to take a look at PR @rageagainsthepc ?

rageagainsthepc commented 9 months ago

That PR was basically finished except for some minor formatting issues when the author simply stopped responding.

AdamSEY commented 9 months ago

@rageagainsthepc, I'm sorry I really got busy and forgot about this, I will take a look.