[SOLVED] Music doesn't loop seamlessly?

Post here if you need help getting started with Daggerfall Unity or just want to clarify a potential bug. Questions about playing or modding classic Daggerfall should be posted to Community.
User avatar
Interkarma
Posts: 7236
Joined: Sun Mar 22, 2015 1:51 am

Re: Music doesn't loop seamlessly?

Post by Interkarma »

Thanks for checking. I have a refactor on my internal roadmap to fix the problem with wrong playlist selection in dungeons. I'll work my way down to this one when I can.

User avatar
Nash
Posts: 11
Joined: Fri Jun 08, 2018 11:19 am
Location: Kuala Lumpur, Malaysia
Contact:

Re: Music doesn't loop seamlessly?

Post by Nash »

Hi, just dropping in to say that I do plan to trim the songs to loop seamlessly, it's just that I've been busy with some other projects since I last posted here. I will try to get them done within this coming week.

I also plan to install Unity 2018 (was always an Unreal user) and have a play around with DFU when it finally gets upgraded. :)
Nash Muhandes

User avatar
Interkarma
Posts: 7236
Joined: Sun Mar 22, 2015 1:51 am

Re: Music doesn't loop seamlessly?

Post by Interkarma »

That would be awesome, thanks Nash. And no rush - only do stuff in your own time. :)

User avatar
Nash
Posts: 11
Joined: Fri Jun 08, 2018 11:19 am
Location: Kuala Lumpur, Malaysia
Contact:

Re: Music doesn't loop seamlessly?

Post by Nash »

Image

Finally finished trimming the songs. There are a total of 132 songs that had to be worked on, and I tried a lot of things since my initial attempt last year. The first obvious attempt was to use automation. My music software has (a horribly oudated) scripting language, so after some observation, it seems that the "ghost" notes at the end of the songs are all at 0 velocity. Should be easy enough to do this, so I went ahead and did it. After automating around half of the songs (50 or so), I listened to the result and it seems like it botched up the original song, and it started deleting non-notes (like controller events and what-not). This was a no-go.

On top of that, some songs (like 2) actually already loop seamlessly (the menu music, and 10.mid I think; one of the night themes). To make things even more confusing, some songs have a stray note at the end that was supposed to sort of lead into the start of the song? Long story short, automation wasn't going to work. I had to listen to EVERY song, and apply slightly different treatment to each of them.

Suffice it to say, doing this for 132 songs was not fun. :P

Well, I finally got all of them, I hope, but here's the thing - a lot of these songs I have not heard in-game, so I don't really have any good memories WRT to how they're supposed to loop. I suppose if any of them sounds wrong, I can follow up with fix PRs.

But enough talk, here's the PR: https://github.com/Interkarma/daggerfal ... /pull/1450
Nash Muhandes

User avatar
Interkarma
Posts: 7236
Joined: Sun Mar 22, 2015 1:51 am

Re: Music doesn't loop seamlessly?

Post by Interkarma »

Great work sticking with that and delivering, Nash! I'll listen through everything and merge when I can. If I hear any issues, will let you know.

User avatar
Nash
Posts: 11
Joined: Fri Jun 08, 2018 11:19 am
Location: Kuala Lumpur, Malaysia
Contact:

Re: Music doesn't loop seamlessly?

Post by Nash »

Someone on Discord mentioned that apparently the original HMI files had custom loop points. I don't know the validity of this claim. Are you aware of such things, Interkarma?
Nash Muhandes

User avatar
Interkarma
Posts: 7236
Joined: Sun Mar 22, 2015 1:51 am

Re: Music doesn't loop seamlessly?

Post by Interkarma »

I don't know enough about the HMI format to comment.

In any case, that would be incompatible with allowing music replacement from other formats like ogg. There's no point worrying about a format specific feature when nobody uses or has access to that format anymore. HMI is basically the Betamax/HDDVD of MIDI. There's no value in getting caught up over what it did better when it doesn't exist anymore. :)

User avatar
Nash
Posts: 11
Joined: Fri Jun 08, 2018 11:19 am
Location: Kuala Lumpur, Malaysia
Contact:

Re: Music doesn't loop seamlessly?

Post by Nash »

Fully agreed. Whatever system that is already in-place now is fine for general usage. :)
Nash Muhandes

Dalebvr
Posts: 44
Joined: Wed May 22, 2019 9:52 pm

Re: Music doesn't loop seamlessly?

Post by Dalebvr »

Interkarma wrote: Sat Jun 09, 2018 2:58 am I'm not sure if any of the songs loop from a point other than the start. Does the .mid format itself support addition of loop points?

The MIDI synth in Daggerfall Unity is built on the open source and cross platform C# Synth Project adapted for Unity starting from the information here with a few very minor tweaks of my own. If .mid supports loop points, there's a good chance the synthesizer will simply use them as intended. I haven't really dived deeply into the synth code as music formats aren't a speciality at all.
Some of them have different loop points, depending on how complex the track is instrumentally. I have the hmi player from long ago, which shows the beat, bar and tick count. The slower, less full tracks do seem to loop back to 00 time, as there are long pauses in the music for that 'spooky' feel. Things like winter2.hmi starts at bar 00, then loops back and skips forward to bar 02. Most of them that loop back to 00 work fine, but the ones that start further along really leap out at you.

Dalebvr
Posts: 44
Joined: Wed May 22, 2019 9:52 pm

Re: Music doesn't loop seamlessly?

Post by Dalebvr »

Nash wrote: Wed Aug 21, 2019 1:40 pm Someone on Discord mentioned that apparently the original HMI files had custom loop points. I don't know the validity of this claim. Are you aware of such things, Interkarma?
That was one of the features of hmi, which was specifically intended for game usage.

Post Reply