rageagainsthepc / GuitarPro-to-Midi

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

Error: Index was out of range. (Parameter 'index') #19

Open DivannKokos opened 2 years ago

DivannKokos commented 2 years ago

gp file: https://tabs.ultimate-guitar.com/tab/my-chemical-romance/welcome-to-the-black-parade-guitar-pro-2704041 -v:

Error: Index was out of range. Must be non-negative and less than the size of the collection. (Parameter 'index')
   at System.Collections.Generic.List`1.get_Item(Int32 index)
   at GuitarProToMidi.GP6File.transferBars(Node node, GP5File song) in C:\repositories\GuitarPro-to-Midi\src\GuitarProToMidi.Console\GP6File.cs:line 158
   at GuitarProToMidi.GP6File.GP6NodeToGP5File(Node node) in C:\repositories\GuitarPro-to-Midi\src\GuitarProToMidi.Console\GP6File.cs:line 131
   at GuitarProToMidi.GP7File.readSong() in C:\repositories\GuitarPro-to-Midi\src\GuitarProToMidi.Console\GP7File.cs:line 20
   at GuitarProToMidi.GpFileParser.CreateMidiFile() in C:\repositories\GuitarPro-to-Midi\src\GuitarProToMidi.Console\GPFileParser.cs:line 53
   at GuitarProToMidi.Program.<>c__DisplayClass0_0.<Main>b__1() in C:\repositories\GuitarPro-to-Midi\src\GuitarProToMidi.Console\Program.cs:line 41
   at Microsoft.Extensions.CommandLineUtils.CommandLineApplication.Execute(String[] args)
   at GuitarProToMidi.Program.Main(String[] args) in C:\repositories\GuitarPro-to-Midi\src\GuitarProToMidi.Console\Program.cs:line 53

this has been tried with build of standard branch, with build of branch of fix-index-out-of-range and with obviously standard exe in releases.

DivannKokos commented 2 years ago

it seems that i already got this error in last comment here: https://github.com/rageagainsthepc/GuitarPro-to-Midi/issues/14

DivannKokos commented 2 years ago

I tried creating GPs with one track at time, first drums then bass, and etc. I succefully convert every GP except GP with track of Piano.

DivannKokos commented 2 years ago

In this and file and last comment of #14 Problem has been fixed by turning Grand Staff to Single Staff in tracks of pianos image image

rageagainsthepc commented 2 years ago

Even the index-out-of-range branch? 🤔 I wasn't finished with that fix if I remember correctly. I'll look into it as time permits.

frosit commented 9 months ago

Tested it for ya, the index-out-of-range branch does indeed fix this issue, but not if there is a "grand staff" track in there. I'm an experienced developer but looking to learn c# so if there are any issues for a beginner C# but experienced developer, I could give it a go.

rageagainsthepc commented 9 months ago

@frosit Well, if you want to see idiomatic C# code, I would not look at this project too closely ;) I wanted to refactor the code base gradually at some point, but got discouraged by the sheer size of that feat. But considering you already seem to know where the problem with the fix for this issue lies, why not start with that?

frosit commented 9 months ago

I think that's roughly how the majority of github users think about roughly the majority of their code on this platform haha. It's partially what makes open source so great and at least I don't have to school you on using git 😉 thats when I really start to sweat haha. But thanks for the heads up, not looking to adapt bad practices so will make sure to inform myself properly on that elsewhere. I'll see where it brings me.

rageagainsthepc commented 9 months ago

Bear in mind that most of the code is not mine. I just forked the project and slapped some CLI around it. That means I am not really familiar with the code base myself, so don't expect too much in terms of insights into the inner workings and how things should behave.