|
From: Tapio V. <aa...@us...> - 2010-08-03 11:36:47
|
Module: performous
Branch: joinmenu
Commit: 57e1b19e6bc1f9d06f3856996371520e706f3530
Author: Vincent Le Ligeour <yo...@us...>
Date: Fri Jul 16 17:10:17 2010 +0200
Fixed (workaround) midi golden and freestyle vocal notes
---
game/songparser-ini.cc | 24 +++++++++++++++++-------
1 files changed, 17 insertions(+), 7 deletions(-)
diff --git a/game/songparser-ini.cc b/game/songparser-ini.cc
index 9437e77..1b5a686 100644
--- a/game/songparser-ini.cc
+++ b/game/songparser-ini.cc
@@ -176,13 +176,9 @@ void SongParser::iniParse() {
n.end = midi.get_seconds(it2->end)+s.start;
n.notePrev = n.note = it2->note;
n.type = n.note > 100 ? Note::SLEEP : Note::NORMAL;
- if(n.note == 116 || n.note == 103)
- // n.type = Note::GOLDEN;
- continue; // not yet managed by midi parser
- else if(n.note == 124)
- // n.type = Note::GOLDEN;
- continue; // not yet managed by midi parser
- else if(n.note > 100)
+ if(n.note == 116 || n.note == 103 || n.note == 124)
+ continue; // managed in the next loop (GOLDEN/FREESTYLE notes)
+ else if(n.note > 100) // is it always 105 ?
n.type = Note::SLEEP;
else
n.type = Note::NORMAL;
@@ -245,6 +241,20 @@ void SongParser::iniParse() {
vocal.notes.push_back(n);
}
}
+ for (MidiFileParser::Lyrics::const_iterator it2 = it->lyrics.begin(); it2 != it->lyrics.end(); ++it2) {
+ if(it2->note == 116 || it2->note == 103 || it2->note == 124) {
+ for(Notes::iterator it3 = vocal.notes.begin() ; it3 != vocal.notes.end(); ++it3) {
+ if(it3->begin == midi.get_seconds(it2->begin)+s.start && it3->type == Note::NORMAL) {
+ if(it2->note == 124) {
+ it3->type = Note::FREESTYLE;
+ } else {
+ it3->type = Note::GOLDEN;
+ }
+ break;
+ }
+ }
+ }
+ }
if (!vocal.notes.empty()) break;
}
// Figure out if we have BRE in the song
|