GuitarPro-to-Midi icon indicating copy to clipboard operation
GuitarPro-to-Midi copied to clipboard

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

Open AdamSEY opened this issue 2 years ago • 7 comments

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_Budokan__Tokyo__Japan__1984 (2).gp.zip

AdamSEY avatar Jan 05 '23 09:01 AdamSEY

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

rageagainsthepc avatar Jan 06 '23 08:01 rageagainsthepc

That's completely right! You can try it.

AdamSEY avatar Jan 06 '23 08:01 AdamSEY

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.

rageagainsthepc avatar Jan 06 '23 09:01 rageagainsthepc

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

AdamSEY avatar Jan 06 '23 19:01 AdamSEY

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 ?

m41w4r3exe avatar Nov 29 '23 16:11 m41w4r3exe

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

rageagainsthepc avatar Nov 30 '23 18:11 rageagainsthepc

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

AdamSEY avatar Nov 30 '23 18:11 AdamSEY