Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

2 changes: 1 addition & 1 deletion LibForge/ForgeToolGUI/Inspectors/SongDataInspector.cs
Original file line number Diff line number Diff line change
Expand Up @@ -43,7 +43,7 @@ public void UpdateValues(LibForge.SongData.SongData data)
vocalPartsTextBox.Text = data.VocalParts.ToString();
vocalGenderTextBox.Text = data.VocalGender.ToString();
mediumTextBox.Text = data.Medium;
freestyleCheckBox.Checked = data.HasFreestyleVocals;
freestyleCheckBox.Checked = data.HasMarkup;
fakeCheckBox.Checked = data.Fake;
shortnameTextBox.Text = data.Shortname;
}
Expand Down
16 changes: 14 additions & 2 deletions LibForge/LibForge/RBSong/RBSongConverter.cs
Original file line number Diff line number Diff line change
Expand Up @@ -74,6 +74,18 @@ public static RBSongResource MakeRBSong(DtxCS.DataTypes.DataArray array, MidiFil
.Replace("sfx", "fusion/patches")
.Replace("_bank.milo", ".fusion")
?? "fusion/patches/kit01.fusion";
var animtempo = array.Array("anim_tempo")?.Any(1)
switch
{
"kTempoSlow" or "16" => "slow",
"kTempoMedium" or "32" => "medium",
"kTempoFast" or "64" => "fast",
_ => "medium" // in the case of unusual values ​​created by the community
};
var animpercussion = array.Array("bank")?.Any(1)
.Replace("sfx/", "fusion/patches/vox_perc_")
.Replace("_bank.milo", ".fusion")
?? "fusion/patches/vox_perc_tambourine.fusion";
var animations = ExtractVenuePropAnimsFromMidi(mf);
return new RBSongResource
{
Expand Down Expand Up @@ -105,12 +117,12 @@ public static RBSongResource MakeRBSong(DtxCS.DataTypes.DataArray array, MidiFil
Unknown2 = 4,
Props = new[]
{
new Property("tempo", new SymbolValue("medium")),
new Property("tempo", new SymbolValue(animtempo)),
new Property("vocal_tonic_note", new LongValue(array.Array("vocal_tonic_note")?.Int(1) ?? 0)),
new Property("vocal_track_scroll_duration_ms", new LongValue(array.Array("song_scroll_speed")?.Int(1) ?? 2300)),
new Property("global_tuning_offset", new FloatValue(array.Array("tuning_offset_cents")?.Number(1) ?? 0)),
new Property("band_fail_sound_event", new SymbolValue("")),
new Property("vocal_percussion_patch", new ResourcePathValue("fusion/patches/vox_perc_tambourine.fusion")),
new Property("vocal_percussion_patch", new ResourcePathValue(animpercussion)),
new Property("drum_kit_patch", new ResourcePathValue(drumBank)),
new Property("improv_solo_patch", new SymbolValue("gtrsolo_amer_03")),
new Property("dynamic_drum_fill_override", new IntValue(10)),
Expand Down
4 changes: 2 additions & 2 deletions LibForge/LibForge/SongData/SongData.cs
Original file line number Diff line number Diff line change
Expand Up @@ -28,9 +28,9 @@ public class SongData
public bool Cover;
public byte VocalGender;
public string Medium;
public bool HasFreestyleVocals;
public bool HasMarkup;
public int VocalParts;
public int Flags;
public int Solos;
public bool Fake;
public string Shortname;
}
Expand Down
18 changes: 15 additions & 3 deletions LibForge/LibForge/SongData/SongDataConverter.cs
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
using System;
using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
Expand All @@ -12,8 +12,20 @@ public static SongData ToSongData(DataArray songDta)
{
var songId = songDta.Array("song_id");
var art = songDta.Array("album_art").Any(1);
string markup = songDta.Array("markup")?.Any(1) ?? string.Empty;
var shortName = songDta.Array("song").Array("name").Any(1).Split('/').Last();
var songIdNum = (shortName.GetHashCode() & 0xFFFFFF) + 90000000;
int solosValue = 0;
var soloArray = songDta.Array("solo");
if (soloArray != null)
{
var soloStr = soloArray.ToString();
if (soloStr.Contains("drum")) solosValue |= 1;
if (soloStr.Contains("guitar")) solosValue |= 2;
if (soloStr.Contains("bass")) solosValue |= 4;
if (soloStr.Contains("keys")) solosValue |= 32;
}

return new SongData
{
AlbumArt = art == "1" || art == "TRUE",
Expand All @@ -30,10 +42,10 @@ public static SongData ToSongData(DataArray songDta)
VocalsRank = songDta.Array("rank").Array("vocals").Int(1),
Cover = false,
Fake = false,
Flags = 0,
Solos = solosValue,
GameOrigin = songDta.Array("game_origin")?.Any(1) ?? "ugc_plus",
Genre = songDta.Array("genre").Symbol(1).ToString(),
HasFreestyleVocals = false,
HasMarkup = markup == "1" || markup == "TRUE",
Medium = "",
Name = songDta.Array("name").String(1),
OriginalYear = songDta.Array("year_released").Int(1),
Expand Down
4 changes: 2 additions & 2 deletions LibForge/LibForge/SongData/SongDataReader.cs
Original file line number Diff line number Diff line change
Expand Up @@ -41,9 +41,9 @@ public override SongData Read()
Cover = Bool(),
VocalGender = Byte(),
Medium = String(16),
HasFreestyleVocals = Bool().Then(Skip(3)),
HasMarkup = Bool().Then(Skip(3)),
VocalParts = Int(),
Flags = Int(),
Solos = Int(),
Fake = Bool(),
Shortname = String(256)
};
Expand Down
4 changes: 2 additions & 2 deletions LibForge/LibForge/SongData/SongDataWriter.cs
Original file line number Diff line number Diff line change
Expand Up @@ -39,10 +39,10 @@ public override void WriteStream(SongData r)
Write(r.Cover);
Write(r.VocalGender);
Write(r.Medium, 16);
Write(r.HasFreestyleVocals);
Write(r.HasMarkup);
s.Position += 3;
Write(r.VocalParts);
Write(r.Flags);
Write(r.Solos);
Write(r.Fake);
Write(r.Shortname, 256);
s.WriteByte(0);
Expand Down