From bbb672551ad690bd601ec60acce0a84208efba12 Mon Sep 17 00:00:00 2001 From: Benjamin Chausse Date: Fri, 9 Aug 2024 16:19:01 -0400 Subject: Update --- content/projects/guitar-hero/index.md | 39 +++++++++++++++++++++++++++++++---- hugo.toml | 3 +++ themes/cranky/config.toml | 20 +++++++----------- 3 files changed, 45 insertions(+), 17 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 {{}} +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 diff --git a/hugo.toml b/hugo.toml index a35b660..f0e5361 100644 --- a/hugo.toml +++ b/hugo.toml @@ -2,3 +2,6 @@ baseURL = 'https://dev.chausse.xyz/' languageCode = 'en-us' title = 'Chausse Benjamin' theme = 'cranky' +[markup.highlight] + style='onedark' + tabWidth=2 diff --git a/themes/cranky/config.toml b/themes/cranky/config.toml index db48f1f..e268b78 100644 --- a/themes/cranky/config.toml +++ b/themes/cranky/config.toml @@ -2,18 +2,12 @@ title = "Website Name" baseURL = 'https://example.org' languageCode = 'en-us' -[markup] - [markup.highlight] - style='onedark' - lineNos = true - tabWidth=2 - [markup.goldmark] - [markup.goldmark.extensions] - [markup.goldmark.extensions.passthrough] - enable = true - [markup.goldmark.extensions.passthrough.delimiters] - block = [['\\[', '\\]']] - inline = [['$$', '$$']] +[markup.goldmark.extensions] + [markup.goldmark.extensions.passthrough] + enable = true + [markup.goldmark.extensions.passthrough.delimiters] + block = [['\\[', '\\]']] + inline = [['$$', '$$']] [params] # "relatedtext" is the text that appears above the tag list at the bottom of pages. @@ -29,5 +23,5 @@ languageCode = 'en-us' taglist = true showrss = true - #enable math by default + #enable mathjax by default math = true -- cgit v1.2.3