-
Notifications
You must be signed in to change notification settings - Fork 1
/
index.html
178 lines (138 loc) · 6.57 KB
/
index.html
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
<!DOCTYPE html>
<html>
<head>
<meta charset='utf-8'>
<meta http-equiv="X-UA-Compatible" content="chrome=1">
<meta name="description" content="RhythmTrainer : An application to help you practice sight-reading rhythms">
<link rel="stylesheet" type="text/css" media="screen" href="stylesheets/stylesheet.css">
<title>RhythmTrainer</title>
</head>
<body>
<!-- HEADER -->
<div id="header_wrap" class="outer">
<header class="inner">
<a id="forkme_banner" href="https://github.com/cpe305/fall2016-project-dsabsay">View on GitHub</a>
<h1 id="project_title">RhythmTrainer</h1>
<h2 id="project_tagline">An application to help you practice sight-reading rhythms</h2>
<section id="downloads">
<a class="zip_download_link" href="https://github.com/cpe305/fall2016-project-dsabsay/zipball/master">Download this project as a .zip file</a>
<a class="tar_download_link" href="https://github.com/cpe305/fall2016-project-dsabsay/tarball/master">Download this project as a tar.gz file</a>
</section>
</header>
</div>
<!-- MAIN CONTENT -->
<div id="main_content_wrap" class="outer">
<section id="main_content" class="inner">
<h1>
<a id="rhythmtrainer" class="anchor" href="#rhythmtrainer" aria-hidden="true"><span aria-hidden="true" class="octicon octicon-link"></span></a>RhythmTrainer</h1>
<p><a href="https://travis-ci.org/cpe305/fall2016-project-dsabsay"><img src="https://travis-ci.org/cpe305/fall2016-project-dsabsay.svg?branch=master" alt="Build Status"></a></p>
<p>RhythmTrainer is an application that will help you practice sight-reading rhythms.</p>
<p>More documentation here: <a href="https://cpe305.github.io/fall2016-project-dsabsay/">https://cpe305.github.io/fall2016-project-dsabsay/</a></p>
<h2>
<a id="description" class="anchor" href="#description" aria-hidden="true"><span aria-hidden="true" class="octicon octicon-link"></span></a>Description</h2>
<p>RhythmTrainer presents rhythms in standard music notation. You can then record yourself performing the rhythms using the microphone in your computer. You can perform the rhythm by clapping, snapping, tapping a pencil on a desk, or doing anything else that produces distinct attacks. RhythmTrainer will then grade your performance and give you a score.</p>
<p><img src="https://raw.githubusercontent.com/cpe305/fall2016-project-dsabsay/master/images/RhythmTrainer%20Screenshot.png" alt="RhythmTrainer Screenshot"></p>
<h2>
<a id="dependencies" class="anchor" href="#dependencies" aria-hidden="true"><span aria-hidden="true" class="octicon octicon-link"></span></a>Dependencies</h2>
<ul>
<li>JavaFX</li>
<li>Music notation is rendered with VexFlow (<a href="https://github.com/0xfe/vexflow">https://github.com/0xfe/vexflow</a>) and VexTab (<a href="https://github.com/0xfe/vextab">https://github.com/0xfe/vextab</a>).</li>
<li>The open-source (AGPL-3.0) Essentia library is used for the audio analysis. More information about Essentia can be found here: <a href="http://essentia.upf.edu">http://essentia.upf.edu</a>
</li>
</ul>
<h2>
<a id="architecture" class="anchor" href="#architecture" aria-hidden="true"><span aria-hidden="true" class="octicon octicon-link"></span></a>Architecture</h2>
<p>RhythmTrainer has a layered architecture and (loosely) employs the model-view-controller design pattern.
<img src="https://raw.githubusercontent.com/cpe305/fall2016-project-dsabsay/master/images/RhythmTrainer%20Architecture.png" alt="Architecture Diagram"></p>
<h2>
<a id="design-patterns" class="anchor" href="#design-patterns" aria-hidden="true"><span aria-hidden="true" class="octicon octicon-link"></span></a>Design Patterns</h2>
<ul>
<li>
<p><strong>Singleton Pattern:</strong> MainController</p>
<ul>
<li>
<p>Only one instance of MainController for the entire application. Using the Singleton Pattern eliminates the need to pass around a reference to the MainController instance.</p>
<pre><code>public class MainController {
private static MainController instance = null;
...
public static MainController createInstance(Stage primaryStage,
PerformanceRecordRepo recordRepo) {
instance = new MainController(primaryStage, recordRepo);
return instance;
}
public static MainController getInstance() throws ControllerException {
if (instance == null) {
throw new ControllerException("The MainController has not been instantiated.");
}
return instance;
}
...
}
</code></pre>
</li>
</ul>
</li>
<li>
<strong>Command Pattern:</strong> Recorder
<ul>
<li>Recorder has an enclosed class RecordAudio that implements Runnable. This is used to capture audio in a separate thread.</li>
</ul>
</li>
<li>
<p><strong>Factory Method Pattern:</strong> PerformanceScore</p>
<ul>
<li>
<p>PerformanceScore has an abstract method that creates a PerformanceRecord object.</p>
<pre><code>public abstract class PerformanceScore {
...
public abstract PerformanceRecord createPerformanceRecord();
...
}
</code></pre>
<p>The subclasses of PerformanceScore implement this factory method.</p>
<pre><code>public PerformanceRecord createPerformanceRecord() {
RhythmRecord record = new RhythmRecord(this.getExercise().getId(), this.getExercise().getType(),
this.getExercise().getName(), this.getScore(), this.getScore(),
new Date(), 0);
return (PerformanceRecord) record;
}
</code></pre>
</li>
</ul>
</li>
<li>
<strong>Facade Pattern:</strong> Exercise
<ul>
<li>The Exercise class only defines high-level information about the underlying exercise. This allows the application's controller to deal with various types of exercise objects in the same way.</li>
</ul>
</li>
<li>
<p><strong>Strategy Pattern:</strong> PerformanceGrader</p>
<ul>
<li>
<p>The grading algorithms implement PerformanceGrader. A grading algorithm can be passed as an object to the PracticeController. This allows the PracticeController to use any grading algorithm without much modification.</p>
<pre><code>public interface PerformanceGrader {
public PerformanceScore evaluatePerformance(...);
}
public abstract class RhythmGrader implements PerformanceGrader {
...
}
public class SimpleRhythmGrader extends RhythmGrader {
public PerformanceScore evaluatePerformance(...);
}
</code></pre>
</li>
</ul>
</li>
</ul>
</section>
</div>
<!-- FOOTER -->
<div id="footer_wrap" class="outer">
<footer class="inner">
<p class="copyright">RhythmTrainer maintained by <a href="https://github.com/cpe305">cpe305</a></p>
<p>Published with <a href="https://pages.github.com">GitHub Pages</a></p>
</footer>
</div>
</body>
</html>