-
Notifications
You must be signed in to change notification settings - Fork 5
/
Copy pathindex.html
330 lines (307 loc) · 18.1 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
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
303
304
305
306
307
308
309
310
311
312
313
314
315
316
317
318
319
320
321
322
323
324
325
326
327
328
329
330
<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="UTF-8">
<meta name="description" content='Chordetect is a tool for detecting, learning piano chords and staves recognition. Chordetect是一个用于检测、学习钢琴和弦和五线谱识别的工具'>
<meta name="keywords" content="Chordetect,tool,piano,guitar,chord,stave,detect,recognition,钢琴,和弦,五线谱,识别,工具">
<meta name="baidu-site-verification" content="code-1OcMwE5sWp" />
<meta name="google-site-verification" content="wn8mOuIxFFhFf6ycXQxopDNNA9yJAto_wBtqf_g0Nxc" />
<meta name="msvalidate.01" content="1827425E98D77F38B09A4893A299A851" />
<title>Chordetect</title>
<link rel="apple-touch-icon" sizes="180x180" href="img/apple-touch-icon.png">
<link rel="icon" type="image/png" sizes="32x32" href="img/favicon-32x32.png">
<link rel="icon" type="image/png" sizes="16x16" href="img/favicon-16x16.png">
<link rel="manifest" href="img/site.webmanifest">
<link rel="stylesheet" type="text/css" href="css/piano.css" />
<link rel="stylesheet" type="text/css" href="css/iview.css" />
<link rel="stylesheet" type="text/css" href="css/chord_namer.css" />
<script src="js/webmidi.js"></script>
<script src="js/vue.js"></script>
<script src="js/vexflow.js"></script>
<script src="js/MIDI.js"></script>
<script src="js/base64-binary.js"></script>
<script src="js/iview.min.js"></script>
<script src="i18n/i18nMessages.js"></script>
<script src="js/vue-i18n.min.js"></script>
<script src="js/chordlibs.js"></script>
<script src="js/chord_name.js"></script>
<script src="js/gtform.js"></script>
<script src="js/vue-metronome.js"></script>
</head>
<body>
<div id="app">
<div class="nav">
<img class="logo" src="img/logo.png" />
<i-button class="settings" type="text" shape="circle" icon="md-settings" size="large" @click="modalSetting = true"></i-button>
</div>
<Modal v-model="modalSetting" draggable sticky scrollable :mask="false" :title="$t('settings')" :footer-hide="true">
<i-tabs type="card">
<i-tab-pane :label="$t('display')" name="tab1">
<span>{{ $t('keyColor') }}</span>:
{{ $t('releaseSustain') }}
<i-color-picker class="iColorPicker" v-model="keyColorReleaseSustain" format="hsl"></i-color-picker>
{{ $t('holdSustain') }}
<i-color-picker class="iColorPicker" v-model="keyColorHoldSustain" format="hsl"></i-color-picker>
<Checkbox class="iCheckbox" v-model="colorfulCheckbox" border>{{ $t('colorful') }}</Checkbox>
<br>
<span>{{ $t('keySignature') }}</span>:
<i-select class="iSelect" v-model="modelKeySignature" style="width: auto" @on-change="keySignatureChange($event)">
<i-option v-for="item in keyList" :value="item" :key="item">{{ item }}</i-option>
</i-select>
<br>
<span>{{ $t('accidental') }}</span>:
<i-select class="iSelect" v-model="modelAccidental" style="width: auto">
<i-option v-for="item in accidentalList" :value="item.value" :key="item.value">{{ item.label }}</i-option>
</i-select>
<br>
<span>{{ $t('language') }}</span>:
<i-select class="iSelect" v-model="modelLanguage" style="width: auto" @on-change="languageChange($event)">
<i-option v-for="item in languageList" :value="item.value" :key="item.value">{{ item.label }}</i-option>
</i-select>
<br>
<span>{{ $t('chordDic') }}</span>:
<i-switch class="iSwitch" v-model="switchChordDic" @on-change="changeSwitchChordDic">
<Icon type="md-checkmark" slot="open"></Icon>
<Icon type="md-close" slot="close"></Icon>
</i-switch>
<br>
<span>{{ $t('guitarPanel') }}</span>:
<i-switch class="iSwitch" v-model="switchGuitarPanel" @on-change="changeSwitchGuitarPanel">
<Icon type="md-checkmark" slot="open"></Icon>
<Icon type="md-close" slot="close"></Icon>
</i-switch>
<br>
<Row class="iSliderRow">
<i-col span="6">
<span>{{ $t('staffScale') }}</span>:
</i-col>
<i-col span="17">
<Slider class="iSlider" v-model="scorePanelScale" :step="0.1" :min="0.7" :max="2.5" @on-input="scorePanelScaleChange()"></Slider>
</i-col>
</Row>
<br>
</i-tab-pane>
<i-tab-pane label="MIDI" name="tab2">
<span>{{ $t('midiInput') }}</span>:
<i-select class="iSelect" v-model="selectedMidiInputId" style="width: auto">
<i-option v-for="input in WebMidi.inputs" :value="input.id" :key="input.id">{{ input.name }}</i-option>
</i-select>
</i-tab-pane>
<i-tab-pane :label="$t('audio')" name="tab3">
<span>{{ $t('metronome') }}</span>:
<i-switch class="iSwitch" v-model="switchMetronomePanel" @on-change="changeSwitchMetronomePanel">
<Icon type="md-checkmark" slot="open"></Icon>
<Icon type="md-close" slot="close"></Icon>
</i-switch>
<br>
<span>{{ $t('soundLibrary') }}</span>:
<i-select class="iSelect" v-model="modelSoundLibrary" style="width: auto" @on-change="soundLibraryChange($event)">
<i-option v-for="item in soundLibraryList" :value="item.value" :key="item.value">{{ item.label }}</i-option>
</i-select>
<br>
<Row class="iSliderRow">
<i-col span="3">
<span>{{ $t('volume') }}</span>:
</i-col>
<i-col span="14">
<Slider class="iSlider" v-model="volumeSlider" :step="1" :min="0" :max="100"></Slider>
</i-col>
<i-col span="6">
<Checkbox class="iCheckbox" v-model="muteCheckbox" border @on-change="muteCheckboxChange()">{{ $t('mute') }}</Checkbox>
</i-col>
</Row>
</i-tab-pane>
<i-tab-pane :label="$t('other')" name="tab4">
<div>
<span>{{ $t('github') }}</span>:
<Tooltip :content="$t('githubHint')" placement="right">
<i-button class="otherBtn" shape="circle" icon="logo-github" to="https://github.com/huangxd-/chordetect.git" target="_blank"></i-button>
</Tooltip>
</div>
<br>
<div>
<span>{{ $t('helpDoc') }}</span>:
<Tooltip content="WIKI" placement="right">
<i-button class="otherBtn" shape="circle" icon="md-help-circle" to="https://github.com/huangxd-/chordetect/wiki" target="_blank"></i-button>
</Tooltip>
</div>
<br>
<div>
<span>{{ $t('donate') }}</span>:
<Tooltip :content="$t('donateHint')" placement="right">
<i-button class="otherBtn" shape="circle" icon="logo-bitcoin" @click="modalDonate = true"></i-button>
</Tooltip>
</div>
<br>
<div>
<span>{{ $t('wechatGroup') }}</span>:
<Tooltip :content="$t('wechatGroupHint')" placement="right">
<i-button class="otherBtn" shape="circle" icon="ios-chatbubbles" @click="modalGroup = true"></i-button>
</Tooltip>
</div>
</i-tab-pane>
</i-tabs>
</Modal>
<Modal id="inchord" v-model="modalChordDic" draggable sticky scrollable :mask="false" :title="$t('chordDic')" :footer-hide="true" @on-visible-change="changeModalChordDic">
<i-input id="chordname" v-model="chordInput" size="large" :placeholder="$t('pleaseInputChord')" clearable @on-clear="clearChordInput"></i-input>
<span id="ignored">{{ $t('incorrectChordMark') }}<span id="ignoredstr"></span></span>
<br>
<Divider></Divider>
<span>{{ $t('root') }}</span>:
<i-select id="root" class="iSelect" v-model="modelRoot" style="width: auto" @on-change="rootChange">
<i-option v-for="item in keyNames" :value="item" :key="item">{{ item }}</i-option>
</i-select>
<span>{{ $t('slashChord') }}</span>:
<Checkbox class="slashCheckbox" v-model="slashChord" border @on-change="rootChange">on</Checkbox>
<i-select id="onroot" class="iSelect" v-model="modelOnRoot" style="width: auto" @on-change="rootChange">
<i-option v-for="item in keyNames" :value="item" :key="item">{{ item }}</i-option>
</i-select>
<br>
<Divider>{{ $t('properties') }}</Divider>
<Checkbox class="chordCheckbox" v-model="chordMin" border>m</Checkbox>
<Checkbox class="chordCheckbox" v-model="chordDim" border>dim</Checkbox>
<Divider :dashed="true" ></Divider>
<Checkbox class="chordCheckbox" v-model="chordSix" border>6</Checkbox>
<Checkbox class="chordCheckbox" v-model="chordSeven" border>7</Checkbox>
<Checkbox class="chordCheckbox" v-model="chordMajSeven" border>M7</Checkbox>
<Checkbox class="chordCheckbox" v-model="chordAug" border>+5 / aug</Checkbox>
<Checkbox class="chordCheckbox" v-model="chordMinusFive" border>-5</Checkbox>
<Divider :dashed="true" ></Divider>
<Checkbox class="chordCheckbox" v-model="chordAddTwo" border>add2</Checkbox>
<Checkbox class="chordCheckbox" v-model="chordNine" border>(9) / add9</Checkbox>
<Checkbox class="chordCheckbox" v-model="chordMinusNine" border>(-9)</Checkbox>
<Checkbox class="chordCheckbox" v-model="chordAddNine" border>(+9)</Checkbox>
<Checkbox class="chordCheckbox" v-model="chordEleven" border>(11)</Checkbox>
<Checkbox class="chordCheckbox" v-model="chordAddEleven" border>(+11)</Checkbox>
<Checkbox class="chordCheckbox" v-model="chordThirteen" border>(13)</Checkbox>
<Checkbox class="chordCheckbox" v-model="chordMinusThirteen" border>(-13)</Checkbox>
<Divider :dashed="true" ></Divider>
<Checkbox class="chordCheckbox" v-model="chordSusTwo" border>sus2</Checkbox>
<Checkbox class="chordCheckbox" v-model="chordSusFour" border>sus4</Checkbox>
<Checkbox class="chordCheckbox" v-model="chordOmitThree" border>omit3</Checkbox>
<Checkbox class="chordCheckbox" v-model="chordOmitFive" border>omit5</Checkbox>
</Modal>
<Modal v-model="modalGuitarPanel" draggable sticky scrollable :mask="false" :title="$t('guitarPanel')" :footer-hide="true" @on-visible-change="changeModalGuitarPanel">
<div class="gtform content_wrap">
<div id="chord_template" class="chord">
<table class="onko">
<tr><td></td><td></td><td></td><td></td></tr><tr><td></td><td></td><td></td><td></td></tr>
<tr><td></td><td></td><td></td><td></td></tr><tr><td></td><td></td><td></td><td></td></tr>
<tr><td></td><td></td><td></td><td></td></tr>
</table>
<div class="point">1</div>
<div class="min">1</div>
</div>
<div id="chforms"></div>
<Divider style="background-color: white"></Divider>
</div>
</Modal>
<Modal v-model="modalMetronomePanel" draggable sticky scrollable :mask="false" :title="$t('metronome')" :footer-hide="true" @on-visible-change="changeModalMetronomePanel">
<metronome-view id="metronomeView" :intf="intf"></metronome-view>
<metronome ref="metronome"
:gain="gain" :tempo="tempo" :beat="beat" :mute="mute" :pause="pause"
@start="metronome_startHandler"
@stop="metronome_stopHandler"></metronome>
<Divider>{{ $t('configure') }}</Divider>
<Row class="iSliderRow">
<i-col span="3">
<span>{{ $t('beat') }}</span>:
</i-col>
<i-col span="20">
<Slider class="iSlider" v-model="beat" :step="1" :min="0" :max="7" @on-input="$refs.metronome.reset()" show-tip="always" :show-stops="true"></Slider>
</i-col>
</Row>
<Row class="iSliderRow">
<i-col span="3">
<span>{{ $t('volume') }}</span>:
</i-col>
<i-col span="14">
<Slider class="iSlider" v-model="gain" :step="1" :min="-50" :max="0" show-tip="always"></Slider>
</i-col>
<i-col span="6">
<Checkbox class="iCheckbox" v-model="mute" border>{{ $t('mute') }}</Checkbox>
</i-col>
</Row>
<Row class="iSliderRow">
<i-col span="3">
<span>{{ $t('tempo') }}</span>:
</i-col>
<i-col span="20">
<Slider class="iSlider" v-model="tempo" :step="1" :min="0" :max="300" @on-input="$refs.metronome.reset()" show-tip="always" :show-input="true"></Slider>
</i-col>
</Row>
<i-button id="metronomeBtn" type="primary" shape="circle" v-bind:icon="metronomeBtnIcon" @click="start_clickHandler">
<span>{{ playing? $t('stop') : $t('start') }}</span>
</i-button>
</Modal>
<Modal v-model="modalDonate" draggable sticky scrollable :mask="false" :title="$t('donate')" :footer-hide="true" align="center">
<img class="payImage" src="img/wechatpay.jpeg"/>
<img class="payImage" src="img/alipay.jpeg"/>
</Modal>
<Modal v-model="modalGroup" draggable sticky scrollable :mask="false" :title="$t('wechatGroup')" :footer-hide="true" align="center">
<img class="payImage" src="img/wechatgroup.jpeg"/>
<br>
<span>{{ $t('invalidGroupHint') }}</span>
</Modal>
<div v-if="errorMessage" class="error">
<Alert type="error" show-icon>{{ errorMessage }}</Alert>
</div>
<div v-else-if="midiInput == null">
<Alert type="warning" show-icon>{{ $t('lookingForMidi') }}</Alert>
</div>
<div id="scoreWrap" :style="{margin: scoreMarginLeft}">
<div id="scorePanel"></div>
<div id="chordPanel" :style="{width: chordPanelWidth, height: chordPanelHeight}">
<span v-if="chordNames&&chordNames.length>0" class="preferChord" :style="{'font-size': preferChordFontSize}">
{{ chordNames[0].name }}<span class="preferChordRoma" :style="{'font-size': preferChordRomaFontSize}">[{{ chordNames[0].romaName }}]</span>
</span>
<span v-else class="preferChord" :style="{'font-size': preferChordFontSize}"> </span>
<span v-if="chordNames&&chordNames.length>1" class="secondaryChord" :style="{'font-size': secondaryChordFontSize}">
{{ chordNames[1].name }}<span class="secondaryChordRoma" :style="{'font-size': secondaryChordRomaFontSize}">[{{ chordNames[1].romaName }}]</span>
</span>
<span v-else class="secondaryChord" :style="{'font-size': secondaryChordFontSize}"> </span>
<span v-if="chordNames&&chordNames.length>2" class="secondaryChord" :style="{'font-size': secondaryChordFontSize}">
{{ chordNames[2].name }}<span class="secondaryChordRoma" :style="{'font-size': secondaryChordRomaFontSize}">[{{ chordNames[2].romaName }}]</span>
</span>
<span v-else class="secondaryChord" :style="{'font-size': secondaryChordFontSize}"> </span>
<span v-if="chordNames&&chordNames.length>3" class="secondaryChord" :style="{'font-size': secondaryChordFontSize}">
{{ chordNames[3].name }}<span class="secondaryChordRoma" :style="{'font-size': secondaryChordRomaFontSize}">[{{ chordNames[3].romaName }}]</span>
</span>
<span v-else class="secondaryChord" :style="{'font-size': secondaryChordFontSize}"> </span>
<span v-if="chordNames&&chordNames.length>4" class="secondaryChord" :style="{'font-size': secondaryChordFontSize}">
{{ chordNames[4].name }}<span class="secondaryChordRoma" :style="{'font-size': secondaryChordRomaFontSize}">[{{ chordNames[4].romaName }}]</span>
</span>
<span v-else class="secondaryChord" :style="{'font-size': secondaryChordFontSize}"> </span>
</div>
</div>
<div id="p-wrapper">
<i-button id="resetBtn" type="warning" icon="ios-refresh" size="small" @click="clearKey()" v-show="showResetBtn">{{ $t('reset') }}</i-button>
<div id="sustainPanel">
<div id="sustainCircle" :style="{backgroundColor: sustainCircleColor}"></div>
<span id="sustainText">{{ $t('sustain') }}</span>
</div>
<ul id="pianoNote">
<li v-for="(key, index) in keys" :style="{width: liWidth}">
<span v-if="isBlackKey(index)" class="key" :style="{width: blackLiWidth, left: blackLiLeft}">
<div class="blackKey" :style="velocityCss(key.velocity, index, 'name')">{{ key.name }}</div>
</span>
<div v-else class="key anchor">
<div class="whiteKey" :style="velocityCss(key.velocity, index, 'name')">{{ key.name }}</div>
</div>
</li>
</ul>
<ul id="piano">
<li v-for="(key, index) in keys" :style="{width: liWidth}">
<span v-if="isBlackKey(index)" class="key" :style="{width: blackLiWidth, left: blackLiLeft}">
<div class="blackKey" :style="velocityCss(key.velocity, index, 'color')" @mousedown="touchKey(index, true)"></div>
</span>
<div v-else class="key anchor">
<div class="whiteKey" :style="velocityCss(key.velocity, index, 'color')" @mousedown="touchKey(index, true)"></div>
</div>
</li>
</ul>
</div>
</div>
<script src="js/app.js"></script>
</body>
</html>