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

gbsplay segfault on midi #11

Closed
Wapata opened this issue Nov 5, 2015 · 5 comments
Closed

gbsplay segfault on midi #11

Wapata opened this issue Nov 5, 2015 · 5 comments

Comments

@Wapata
Copy link

Wapata commented Nov 5, 2015

when i try to run this command
run ~/Téléchargements//Smurfs.gbs -2 -3 -4 -o midi

it segfaults with the followin trace
(I obtain this with help. I'm a GB sound fan, but not a good linux user)
#0 __GI__IO_fwrite (buf=0x7fffffffdbf7, size=1, count=1, fp=0x0) at iofwrite.c:41
#1 0x000055555555d36a in midi_write_event.constprop ()
#2 0x000055555555d73a in midi_io ()
#3 0x000055555555d9df in io_put ()
#4 0x000055555555e522 in gbhw_init ()
#5 0x000055555555ef5a in gbs_init ()
#6 0x000055555555ba4d in main ()

@ranma
Copy link
Collaborator

ranma commented Nov 15, 2015

Should be fixed by 711af96

@ranma ranma closed this as completed Nov 15, 2015
@Wapata
Copy link
Author

Wapata commented Nov 21, 2015

Thanks for this !!
It's better but it's not working good. All the files are 1ko (the very first notes).

And i'm not sure about this, but they may not have the correct length and i don't hear the battery channel (4).

@Wapata
Copy link
Author

Wapata commented Nov 21, 2015

with the help of nadenislamarre we've made an improvement.
It's about gbs.c from line 116 to 122:
//if (gbs->silence_start &&
// (gbs->ticks - gbs->silence_start) / GBHW_CLOCK >= gbs->silence_timeout) {
//if (gbs->subsong_info[gbs->subsong].len == 0) {
// gbs->subsong_info[gbs->subsong].len = gbs->ticks * GBS_LEN_DIV / GBHW_CLOCK;
//}
//return gbs_nextsubsong(gbs);
//}

then this command work: ~/dev/gbsplay$ ./gbsplay -o midi ~/Téléchargements//Smurfs.gbs
and return all the midi files with the correct lenght.

But there still a problem with the channels, the velocity, and others things that i don't know the english music word to explain well.

But, the music is exactly the good one with this command:
~/dev/gbsplay$ ./gbsplay -o alsa ~/Téléchargements//Smurfs.gbs

Why so much differences ? Specially the channel one.

@ranma
Copy link
Collaborator

ranma commented Nov 22, 2015

I've never used the midi output plugin myself, but from the code it looks like it ignores channel 4, so that part is expected.

@mmitch
Copy link
Owner

mmitch commented Nov 22, 2015

Not using channel 4 makes kind of sense: In a MIDI drum track (normally on channel 10), every note stands for one drum sound (35 = bass drum 1, 39 = hand clap, 46 = open hi-hat, etc.).
It's not so easy to calculate the current drum sound from current the noise and envelope on channel 4.

If somebody wanted to do some real cool programming, a conversion could propably be built, but I wouldn't even want to try…

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

No branches or pull requests

3 participants