Skip to content

Commit

Permalink
Chart progress, minor toolkit stuff
Browse files Browse the repository at this point in the history
- Set up a bunch more BTBAM projects (rest of TGM and P1, half of P2)
- Some sections for RS charts + shortcut text event format for them
- Blast Off RS convert
- Onyx CLI command to make new project with computed audio md5/frames
- Start drums for The Jungle
  • Loading branch information
mtolly committed Nov 5, 2020
1 parent 1baa65f commit 3dee4b8
Show file tree
Hide file tree
Showing 28 changed files with 338 additions and 2 deletions.
53 changes: 51 additions & 2 deletions haskell/src/CommandLine.hs
Original file line number Diff line number Diff line change
Expand Up @@ -15,10 +15,12 @@ module CommandLine
) where

import qualified Amplitude.PS2.Ark as AmpArk
import Audio (applyPansVols, fadeEnd,
fadeStart, runAudio)
import Audio (Audio (Input), applyPansVols,
audioLength, audioMD5,
fadeEnd, fadeStart, runAudio)
import Build (loadYaml, shakeBuildFiles)
import Config
import Control.Monad.Codec.Onyx.JSON (toJSON, yamlEncodeFile)
import Control.Monad.Extra (filterM, forM, forM_, guard,
when)
import Control.Monad.IO.Class
Expand All @@ -34,6 +36,7 @@ import Data.Char (isAlphaNum, isAscii, isDigit,
isUpper, toLower)
import qualified Data.Conduit.Audio as CA
import Data.Conduit.Audio.Sndfile (sinkSnd, sourceSndFrom)
import Data.Default.Class (def)
import qualified Data.Digest.Pure.MD5 as MD5
import Data.DTA.Lex (scanStack)
import Data.DTA.Parse (parseStack)
Expand Down Expand Up @@ -1072,6 +1075,52 @@ commands =
_ -> fatal "Expected 2 args (folder to pack, .hdr)"
}

, Command
{ commandWord = "import-audio"
, commandDesc = ""
, commandUsage = ""
, commandRun = \args opts -> case args of
audios@(_ : _) -> do
pairs <- forM audios $ \audio -> inside ("audio file: " <> audio) $ do
md5 <- audioMD5 audio >>= maybe (fatal "Couldn't compute audio hash") return
len <- audioLength audio >>= maybe (fatal "Couldn't compute audio length") return
return (md5, len)
dir <- outputFile opts $ return "."
stackIO $ Dir.createDirectoryIfMissing False dir
stackIO $ yamlEncodeFile (dir </> "song.yml") $ toJSON (SongYaml
{ _metadata = def
, _global = def
, _audio = HM.fromList $ flip map (zip [1..] pairs) $ \(i, (md5, len)) -> let
ainfo = AudioFile AudioInfo
{ _md5 = Just $ T.pack md5
, _frames = Just len
, _filePath = Nothing
, _commands = []
, _rate = Nothing
, _channels = 2 -- TODO real channel count from audio
}
in (T.pack $ "audio-" <> show (i :: Int), ainfo)
, _jammit = HM.empty
, _plans = HM.singleton "plan" Plan
{ _song = Just PlanAudio
{ _planExpr = Input $ Named "audio-1"
, _planPans = []
, _planVols = []
}
, _countin = Countin []
, _planParts = Parts HM.empty
, _crowd = Nothing
, _planComments = []
, _tuningCents = 0
, _fileTempo = Nothing
}
, _targets = HM.empty
, _parts = Parts HM.empty
} :: SongYaml FilePath)
return [dir]
_ -> fatal "Expected at least 1 arg (flac or wav files)"
}

]

runDolphin
Expand Down
16 changes: 16 additions & 0 deletions haskell/src/Rocksmith/MIDI.hs
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,9 @@ module Rocksmith.MIDI
import Control.Applicative (liftA2, (<|>))
import Control.Monad (forM, guard, when)
import Control.Monad.Codec
import Control.Monad.Trans.Class (lift)
import Control.Monad.Trans.StackTrace
import Control.Monad.Trans.State.Strict (modify)
import Data.Char (isDigit)
import qualified Data.EventList.Absolute.TimeBody as ATB
import qualified Data.EventList.Relative.TimeBody as RTB
Expand Down Expand Up @@ -280,6 +282,20 @@ instance ParseTrack RocksmithTrack where
ToneC -> ["tone", "c"]
ToneD -> ["tone", "d"]
rsBends <- rsBends =. commandMatch' parseBend unparseBend
-- short notation for phrase/section combinations
Codec
{ codecIn = lift $ modify $ \mt -> mt
{ midiCommands = let
f = \case
["riff", x] -> [["section", "riff"], ["phrase", x]]
["ng" ] -> [["section", "noguitar"], ["phrase", "NG"]]
["start" ] -> [["phrase", "default"]]
["end" ] -> [["section", "noguitar"], ["phrase", "END"]]
x -> [x]
in RTB.flatten $ f <$> midiCommands mt
}
, codecOut = const $ return ()
}
rsPhrases <- rsPhrases =. commandMatch'
(\case
["phrase", x] -> Just x
Expand Down
Binary file not shown.
31 changes: 31 additions & 0 deletions songs-grinnz/between-the-buried-and-me/astral-body/song.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,31 @@
metadata:
title: Astral Body
file-include: "../../../albums/the-parallax-ii.yml"
track-number: 2
author: Grinnz, HellAshes
parts:
drums:
drums:
kicks: 2
guitar:
grybo: {}
plans:
plan:
parts: {}
song:
concatenate:
- fade:
- start
- 4.351
- take: [end, 4.351, album-goodbye]
- fade:
- end
- 0.414
- album-astral
audio:
album-goodbye:
md5: 0f3ac95948e963cd81d9b65bcfff9c31
frames: 4382952
album-astral:
md5: 782249dfefc0f42d5340f8b94191abf3
frames: 13301148
Binary file not shown.
28 changes: 28 additions & 0 deletions songs-grinnz/between-the-buried-and-me/augment-of-rebirth/song.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,28 @@
metadata:
title: Augment of Rebirth
file-include: "../../../albums/the-parallax.yml"
track-number: 2
author: Grinnz
parts:
drums:
drums:
kicks: 2
plans:
plan:
song:
concatenate:
- fade:
- start
- 4.635
- take: [end, 4.635, album-specular]
- fade:
- end
- 2.984
- take: [10:18.825, album-augment]
audio:
album-augment:
md5: 2245c4f41e1f122e3adc183aa17a2cfe
frames: 27314952
album-specular:
md5: 90d55b07d5d9be3b9e8cc74f6b0ea8a2
frames: 30034452
Binary file not shown.
29 changes: 29 additions & 0 deletions songs-grinnz/between-the-buried-and-me/desert-of-song/song.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,29 @@
metadata:
title: Desert of Song
file-include: "../../../albums/the-great-misdirect.yml"
track-number: 5
author: Grinnz
parts:
drums:
drums:
kicks: 1
plans:
plan:
parts: {}
song:
concatenate:
- fade:
- start
- 2.040
- take: [end, 2.040, album-fossil]
- fade:
- end
- 1.66
- album-desert
audio:
album-fossil:
md5: 3076093303750e6e3387835f0ba70143
frames: 32228280
album-desert:
md5: 9d91553c5ba8560e0a82cded6db8a0b2
frames: 14704704
Binary file not shown.
19 changes: 19 additions & 0 deletions songs-grinnz/between-the-buried-and-me/extremophile-elite/song.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,19 @@
metadata:
title: Extremophile
file-include: "../../../albums/the-parallax-ii.yml"
track-number: 5
author: Grinnz, HellAshes
parts:
drums:
drums:
kicks: 2
guitar:
grybo: {}
plans:
album:
song:
pad: [4.507, album-track]
audio:
album-track:
md5: 8242b704f6f3048fc348eeba2bde4d9c
frames: 26400024
Binary file not shown.
Original file line number Diff line number Diff line change
@@ -0,0 +1,19 @@
metadata:
title: Lay Your Ghosts to Rest
file-include: "../../../albums/the-parallax-ii.yml"
track-number: 3
author: Grinnz, HellAshes
parts:
drums:
drums:
kicks: 2
guitar:
grybo: {}
plans:
plan:
song:
pad: [4.412, album-track]
audio:
album-track:
md5: 4b9b73b3bb43f43e4418aab6fa51e977
frames: 26567016
Binary file not shown.
26 changes: 26 additions & 0 deletions songs-grinnz/between-the-buried-and-me/lunar-wilderness/song.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,26 @@
metadata:
title: Lunar Wilderness
file-include: "../../../albums/the-parallax.yml"
track-number: 3
author: Grinnz
parts:
drums:
drums:
kicks: 2
plans:
plan:
parts: {}
song:
concatenate:
- fade:
- start
- 5.753
- take: [end, 5.753, album-augment]
- album-lunar
audio:
album-lunar:
md5: 668a08677837b580e9187e3fadaa813a
frames: 22140552
album-augment:
md5: 2245c4f41e1f122e3adc183aa17a2cfe
frames: 27314952
Binary file not shown.
Original file line number Diff line number Diff line change
@@ -0,0 +1,24 @@
metadata:
title: Specular Reflection
file-include: "../../../albums/the-parallax.yml"
track-number: 1
author: Grinnz, HellAshes
parts:
drums:
drums:
kicks: 2
guitar:
grybo: {}
plans:
plan:
song:
pad:
- 2.821
- fade:
- end
- 3.551
- take: [10:47.070, album-track]
audio:
album-track:
md5: 90d55b07d5d9be3b9e8cc74f6b0ea8a2
frames: 30034452
Binary file not shown.
25 changes: 25 additions & 0 deletions songs-grinnz/between-the-buried-and-me/swim-to-the-moon/song.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,25 @@
metadata:
title: Swim to the Moon
file-include: "../../../albums/the-great-misdirect.yml"
track-number: 6
author: Grinnz
parts:
drums:
drums:
kicks: 2
plans:
plan:
song:
concatenate:
- fade:
- start
- 2.091
- take: [end, 2.091, album-desert]
- album-swim
audio:
album-desert:
md5: 9d91553c5ba8560e0a82cded6db8a0b2
frames: 14704704
album-swim:
md5: a90107f8ec26e03c52daef773fca0a46
frames: 47345172
Binary file not shown.
32 changes: 32 additions & 0 deletions songs-grinnz/between-the-buried-and-me/telos/song.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,32 @@
metadata:
title: Telos
file-include: "../../../albums/the-parallax-ii.yml"
track-number: 8
author: Grinnz
parts:
drums:
drums:
kicks: 2
plans:
plan:
song:
concatenate:
- fade:
- start
- 3.828
- take: [end, 3.828, album-black-box]
- album-telos
- fade:
- end
- 0.163
- take: [0.342, album-bloom]
audio:
album-black-box:
md5: cee12e61677d18f62b63472f5b2be989
frames: 5770044
album-telos:
md5: 6502770419901af4c5446eb59a793edd
frames: 25816140
album-bloom:
md5: 19a60eefd22fdad77614c4eff93af65f
frames: 9215136
Binary file not shown.
32 changes: 32 additions & 0 deletions songs-grinnz/between-the-buried-and-me/the-black-box/song.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,32 @@
metadata:
title: The Black Box
file-include: "../../../albums/the-parallax-ii.yml"
track-number: 7
author: Grinnz
parts:
drums:
drums:
kicks: 2
plans:
plan:
song:
concatenate:
- fade:
- start
- 2.883
- take: [end, 2.883, album-parallax]
- album-black-box
- fade:
- end
- 0.54
- take: [0.633, album-telos]
audio:
album-parallax:
md5: 651f3c30e58ce67913e85eaffa2d8095
frames: 3326904
album-black-box:
md5: cee12e61677d18f62b63472f5b2be989
frames: 5770044
album-telos:
md5: 6502770419901af4c5446eb59a793edd
frames: 25816140
Binary file modified songs-grinnz/dream-theater/stream-of-consciousness/notes.mid
Binary file not shown.
Binary file modified songs/nova-collective/ripped-apart-and-reassembled/notes.mid
Binary file not shown.
Binary file modified songs/sungazer/sequence-start/notes.mid
Binary file not shown.
Binary file modified songs/trioscapes/blast-off/notes.mid
Binary file not shown.
6 changes: 6 additions & 0 deletions songs/trioscapes/blast-off/song.yml
Original file line number Diff line number Diff line change
Expand Up @@ -48,6 +48,8 @@ parts:
tuning:
base: bass-5
difficulty: 7
tones:
file-tone-base: ../../../tones/ViolationDrive.tone2014.xml
targets:
rb3:
game: rb3
Expand All @@ -61,3 +63,7 @@ targets:
ps:
game: ps
loading-phrase: "Part of Onyxite's Jazz Pack 4. Recommended 5-fret part: Keys (sax), though Bass also has a solo."
rs:
game: rs
arrangements:
- [bonus-rhythm, bass]
Binary file modified songs/trioscapes/the-jungle/notes.mid
Binary file not shown.

0 comments on commit 3dee4b8

Please sign in to comment.