Author Topic: "Perfect" BGM looping in Danmakufu (This could be a paper!)  (Read 7543 times)

Helepolis

  • Charisma!
  • *
  • O-ojousama!?
"Perfect" BGM looping in Danmakufu (This could be a paper!)
« on: October 17, 2010, 12:01:32 PM »
Introduction
On IRC we had another huge test and brainstorming session about editing music files in order to make them loop them correctly in Danmakufu. But we have not yet found a solid and reliable method for making this happen but we got really close (before as well).

Now I know that few people succeeded in getting perfect or somewhat extremely well looping BGM files before. But mostly they fiddled around with audacity adding/removing silence until it somewhat loops correctly.


Related literature
According to Iryan et al. (2010), Danmakufu needs a silence section to round it up to an integer of a second. Meaning if a song lasts 1m and 34,5s, it requires 0,5s of silence to round it up to 1m 35s. How ever Blargel et al. (2010) claims that adding to any track a silence of 1 second is sufficient. But he also explains that he used silence in front of the BGM track.

Now if we for example examine Mitori's theme (Unknown et al, 2010):  The Kappa Way as Said ~ One way Accelerator, we can note the music file immediately starts playing and has a tiny bit of silence at the end. (~0,027s). This music file loops like perfect in Danmakufu.


Research approach
For this research I took my Uwabami Breakers 3rd boss track, Lemuria, and cut away the song so only like 1-2seconds remain (for fast listening). Then I added the following amount of silences: +0,027s and +1,0s and added the amount of silence until the total length of the track becomes +1,128s,  +0,768s, +0,512s. Which Iryan has proposed.


Results
adding regular +0,027s silence did not work and you could hear a clear choke + repeating of outro being mixed into the intro.
length of +1,0s silence gave a small noticeable silence in the track before it looped.
length of +1,128s gave even greater noticeable silence.
length of +0,768s gave a small choke of outro being mixed into the intro
length of +0,512s gave a noticeable choke of outro being mixed into intro (repeating)


Conclusion, discussion and further research
As we can see by this research, extending the silence around ~1,0s, and keeping in mind Iryan's theory, creates a better looping BGM. Personally I have concluded that adding silence untill it reaches X,768s has a better chance of looping than the other tests.

For further research the silence in the beginning has to be added and tested out.


Grumskiz

  • Likes Tyrian and Cave...also there is Touhou
  • Danmaku without programming or gaming skill
    • My Youtube Channel - German Let's Play Videos
Re: "Perfect" BGM looping in Danmakufu (This could be a paper!)
« Reply #1 on: October 19, 2010, 07:59:19 PM »
Good Job, guys! I can imagine it took you all a long time to try out these things and I appreciate that! (and I hope so do other people who weren't involved like me...)
In fact, I think it is good to write down some experiences and knowledge about this annoying loop-bahaviour Danmakufu has.
What I ask myself now is, if Danmakufu has loop-differences when you use extremly long/short songs or different formats.(btw, which formats are useable in Danmakufu and which are commonly used?)
I mean, ~1 sec of tollerance at the end sounds cool and it is good to know, but when we don't know about differences from song to song, it doesn't really help...

I think, I will try to make a good loop with my songs later, too. So, if you want me to I can write my results in this thread.

P.S.:
Where can I get that famous literature I never heard about xD
And I want the paper...I think I print it for myself and hand it to everyone in school...

Chronojet ⚙ Dragon

  • The Oddity
  • 今コソ輝ケ、我ガ未来、ソノ可能性!!
Re: "Perfect" BGM looping in Danmakufu (This could be a paper!)
« Reply #2 on: October 19, 2010, 08:28:50 PM »
P.S.:
Where can I get that famous literature I never heard about xD
And I want the paper...I think I print it for myself and hand it to everyone in school...
:V You actually believe it exists?
> Title: "(This could be a paper!)"

.... Yeah.

Grumskiz

  • Likes Tyrian and Cave...also there is Touhou
  • Danmaku without programming or gaming skill
    • My Youtube Channel - German Let's Play Videos
Re: "Perfect" BGM looping in Danmakufu (This could be a paper!)
« Reply #3 on: October 19, 2010, 08:38:46 PM »
Probably my irony was not obvoius enough  :V

Helepolis

  • Charisma!
  • *
  • O-ojousama!?
Re: "Perfect" BGM looping in Danmakufu (This could be a paper!)
« Reply #4 on: October 19, 2010, 09:59:49 PM »
Probably my irony was not obvoius enough  :V
Was pretty noticeable for me but yea, Mew is one of our serious members sometimes reading things wrong :V

About your comment on the length of the song. I actually did the tests with a 2 second sample as well. To avoid listening to the entire song all over again and the same I did for Mitori's theme as well. There were no distinctive differences from the full song I used for Lemuria. I don't think the actual length will involve the testing, but t he amount of silence being added is currently unknown.

It is not 1 second exact for sure, neither rounded up to the nearest second. It is something else but god knows.

GenericTouhouFailure

  • WHAT DO YOU MEAN IT'S NOT CALLED UNL? *boom*
Re: "Perfect" BGM looping in Danmakufu (This could be a paper!)
« Reply #5 on: October 20, 2010, 09:16:49 AM »
Ever experimented with a direct rip from the early games?
REALLY IDIOTIC THEORY NUMBER (9)
Since Danmakufu is pretty much an EoSD PCB engine, maybe the creator used the rips as a refrence?

Remilia's theme direct rip is 2:44.769615 long
It has 2.427276 seconds of silence that comes with it.

Flan's theme also has a similar length of silence at the beginning. (around 2.443 seconds)
it is 2:08.359909 long.
Not tested whether these particular lengths loop properly or not.
The song itself does not loop properly. Obvious, due to ABRUPT-EN(ry
remember that these are WAV files :p

Helepolis

  • Charisma!
  • *
  • O-ojousama!?
Re: "Perfect" BGM looping in Danmakufu (This could be a paper!)
« Reply #6 on: October 20, 2010, 11:30:18 AM »
Sample I used is a direct rip from Uwabami breakers. That isn't really the issue.

Also the original touhou songs have either fadeout or different forms of endings. But that is because ZUN uses certain flags in the songs to indicate the looping area. But that is because ZUN's engine can handle these loop regions.

If you read my previous post I said the length of the sound file has probably no influence on the amount of silence required. Because if I use a sample of 2s or 2m, and add 1s of silence, the outcome is the same.

I am just not getting why Mitori's theme has 0.027s silence while we suspect the required silence is around ~0.768

GenericTouhouFailure

  • WHAT DO YOU MEAN IT'S NOT CALLED UNL? *boom*
Re: "Perfect" BGM looping in Danmakufu (This could be a paper!)
« Reply #7 on: October 20, 2010, 12:26:40 PM »
I am just not getting why Mitori's theme has 0.027s silence while we suspect the required silence is around ~0.768
because danmakufu *BRICK'D*

Helepolis

  • Charisma!
  • *
  • O-ojousama!?
Re: "Perfect" BGM looping in Danmakufu (This could be a paper!)
« Reply #8 on: October 20, 2010, 01:01:53 PM »
because danmakufu *BRICK'D*
You are not being useful for the thread.

Grumskiz

  • Likes Tyrian and Cave...also there is Touhou
  • Danmaku without programming or gaming skill
    • My Youtube Channel - German Let's Play Videos
Re: "Perfect" BGM looping in Danmakufu (This could be a paper!)
« Reply #9 on: October 20, 2010, 08:08:38 PM »
But waht about different formats?
I mean is there a difference in Danmakufu when it loops wave instead of midi or whatever it supports??

GenericTouhouFailure

  • WHAT DO YOU MEAN IT'S NOT CALLED UNL? *boom*
Re: "Perfect" BGM looping in Danmakufu (This could be a paper!)
« Reply #10 on: October 20, 2010, 10:40:28 PM »
But waht about different formats?
I mean is there a difference in Danmakufu when it loops wave instead of midi or whatever it supports??
somehow, midi format seems to loop better.
For me, at least.

Grumskiz

  • Likes Tyrian and Cave...also there is Touhou
  • Danmaku without programming or gaming skill
    • My Youtube Channel - German Let's Play Videos
Re: "Perfect" BGM looping in Danmakufu (This could be a paper!)
« Reply #11 on: October 20, 2010, 10:51:36 PM »
You mean it loops faster than other formats and so you don't need to use silence or cutoff or whatever to prevent chokes or breaks between every loop?
That would make sense to me, since midi files only have instruments saved in them which are played by a synthesizer other than most audio formats like wave or mp3 which have the soundwaves saved in them. But actually I still only have theories why Danmakufu is better in looping midi...

However, the problem is:
Most people who use Danmakufu don't make their own music, so they will probably use their favourite waves or mp3s for their scripts, since there is no easy way to reformat a wave/mp3/whatever to a midi file.


Infy♫

  • Demonic★Moe
  • *
Re: "Perfect" BGM looping in Danmakufu (This could be a paper!)
« Reply #12 on: October 21, 2010, 10:13:28 AM »
the amount of silence either depends on the length of the track or the length of the track must equal a multiple of a number. i think.
this explains why adding 0.027s of silence did not work.
it might have something to do with file format as well. when i used OGG files danmakufu would play the first second of the track and then return to silence.

also: I tried to make danmakufu play the midi of remilia's theme. it played fine, but the drums werent played.

GenericTouhouFailure

  • WHAT DO YOU MEAN IT'S NOT CALLED UNL? *boom*
Re: "Perfect" BGM looping in Danmakufu (This could be a paper!)
« Reply #13 on: October 21, 2010, 01:27:07 PM »
also: I tried to make danmakufu play the midi of remilia's theme. it played fine, but the drums werent played.
Its worse when you try the MIDI version of 百花繚乱 ~ Outskirts of the Battle
Half the instruments are not played.
If you use something from PoFV like Cirno's theme, it will not play at all.

Re: "Perfect" BGM looping in Danmakufu (This could be a paper!)
« Reply #14 on: October 21, 2010, 02:13:22 PM »
Are you guys using your OSes' default softsynth ?

Grumskiz

  • Likes Tyrian and Cave...also there is Touhou
  • Danmaku without programming or gaming skill
    • My Youtube Channel - German Let's Play Videos
Re: "Perfect" BGM looping in Danmakufu (This could be a paper!)
« Reply #15 on: October 22, 2010, 12:25:48 AM »
k guys I finally made some tests, too.
I used my Lunatic Princess mp3 and I made a silent second in front and at the end of the song.
The  result is the following s***
Danmakufu starts and plays the song without any problems and in good sound quality! So far so good...
But in the end it completely messes up everything! It just jumps over the last 4 (!) seconds ans then there is VERY short break ans it also jumps ~0.5 seconds of the song beginning!
I will try to fix that and I will write my results again.
Btw, how did you get your numbers that accurate?????

€dit:
Ok, got it a little better.
There is no longer silence at the end. Instead I rounded the song up.
Also I shortend the silence in the beginning of the song from 1.130 to 0.130 and now it...works...kinda.
It still doesn't sound right, 'cause it is not smooth enough, but at least there is no enormous cut-off anymore.
I'm happy with that....
« Last Edit: October 22, 2010, 12:41:20 AM by Grumskiz »

Helepolis

  • Charisma!
  • *
  • O-ojousama!?
Re: "Perfect" BGM looping in Danmakufu (This could be a paper!)
« Reply #16 on: October 22, 2010, 04:22:29 AM »
With Audacity at the bottom you can change the time code from  hh:mm:ss to  hh:mm:ss:msmsms. Same goes when adding silence, just use the dropdown button to change the timecode.

Grumskiz

  • Likes Tyrian and Cave...also there is Touhou
  • Danmaku without programming or gaming skill
    • My Youtube Channel - German Let's Play Videos
Re: "Perfect" BGM looping in Danmakufu (This could be a paper!)
« Reply #17 on: October 22, 2010, 03:41:03 PM »
Yeah, I alreay found it out myselves, but thanks anyway ;3