diff options
Diffstat (limited to 'content/projects/guitar-hero')
-rw-r--r-- | content/projects/guitar-hero/index.md | 39 |
1 files changed, 35 insertions, 4 deletions
diff --git a/content/projects/guitar-hero/index.md b/content/projects/guitar-hero/index.md index c69c71b..b91d51f 100644 --- a/content/projects/guitar-hero/index.md +++ b/content/projects/guitar-hero/index.md @@ -5,10 +5,9 @@ mermaid: true draft: false --- -One of my University classes tasked me with creating a custom pcb remote as -well as a GUI software that interfaced with it. I decided to create a *Guitar -Hero* clone capable of reading files created for the similar project *Clone -Hero* using C++ and QT. +One of my University classes tasked me with creating a custom remote as +well as a C++ GUI (using QT) that interfaces with it. I decided to create a *Guitar +Hero* clone compatible with the similar project *Clone Hero* file format. The goal of this class was to teach Computer Science students about GUI design as well as teach electrical engineers about PCB design. Both type of students @@ -207,6 +206,7 @@ classDiagram -album : string -year : string -charter : string + +timestamps : TimeStamp[] +easy : Chord[] +medium : Chord[] +hard : Chord[] @@ -226,14 +226,38 @@ classDiagram -noteNB : int } + class TimeStamp { + -time: long int + -tick: int + -nbpm: int + } + + class QGraphicsRectItem { + } + class Note { -Fret : int } + QGraphicsRectItem --|> Note Note "1..5" o-- Chord Chord o-- Song + TimeStamp o-- Song {{</mermaid>}} +The timestamp list in a song is only used as a tool to then parse different +difficulties. Once all difficulties have been parsed, it is no longer needed. + +As you might see, a given difficulty doesn't contain a list of notes but a list +of chords instead. The reason behind this choice is that many notes are meant +to be played together (as a chord). This means that all those notes have the +same start and duration. You can therefore save memory by grouping notes +together. Afterwards, a single note can be thought of as a single note chord. +Another benefit to this approach is that QT offers the option to animate +objects in parallel. This means that a single animation call can be made to the +QT engine for every chord, and we're sure that all notes appear in sync on +screen while playing. + # GUI Design # PCB and Guitar Design @@ -251,3 +275,10 @@ classDiagram [1]: https://clonehero.net/ + +1. Parse generic info from the `[Song]` section +2. Generate a timestamp table noting when ticks change duration (and to what value) +3. Read the file line by line until a supported difficulty header is encountered +4. Parse all notes using the timestamp table to know their specific time +5. Merge notes with identical start/end time into chords +6. Convert all time values from nanoseconds to milliseconds |