站内导读
中文 Guitar 是一个网页版虚拟吉他应用,可粘贴整页吉他谱并尽量解析加载,按键在指板上弹奏音符,点击指板录音,中键触发推弦。支持选择音阶高亮,适合想练习吉他的开发者与爱好者。合成算法来自 guitar-synth,音频效果使用 tuna,谱面解析器已独立成模块。录音暂不记录时值与推弦,移动端支持仍在完善。
日本語 Guitar はブラウザで動く仮想ギターです。ギタータブ譜を含むウェブページを貼り付けると可能な範囲で読み込み、キー入力で指板上の音を鳴らせます。指板をクリックすると録音でき、中クリックはベンドです。音階のハイライト機能があり、ギターを学びたい人や開発者に向きます。音声合成は guitar-synth、エフェクトは tuna を使用し、タブ譜パーサは独立モジュールとして公開されています。録音は音の長さやベンドを未対応です。
한국어 Guitar는 브라우저에서 동작하는 가상 기타입니다. 기타 탭이 포함된 웹페이지를 붙여넣으면 가능한 범위에서 불러오고, 키를 눌러 지판에서 소리를 냅니다. 지판을 클릭해 녹음하며 가운데 버튼은 벤딩입니다. 음계를 골라 강조 표시할 수 있어 기타를 배우려는 사람과 개발자에게 적합합니다. 합성은 guitar-synth, 오디오 효과는 tuna를 쓰며 탭 파서는 별도 모듈로 공개되어 있습니다. 녹음은 길이와 벤딩을 아직 저장하지 않습니다.
English Guitar is a browser-based virtual guitar. Paste a webpage containing guitar tabs and it loads what it can; press keys to play notes on the fretboard, click to record, and use the middle mouse button to bend. A scale-highlighting option supports learning the instrument. Synthesis comes from guitar-synth and audio effects from tuna; the tablature parser is released as a separate module. Recording does not yet store timing or bends, and mobile support is still limited.
README · 详细文档
来源 · 查看原文
Guitar ======
It's a virtual guitar record-a-synthesize-amatronic web application.
[
][app]
[Try it out here.][app]
You can copy and paste entire webpages containing guitar tabs and it'll try to load all it can.
Play back notes by pressing "almost any" key (at least on US keyboards), with the fretboard focused (or no control focused). You can rock back and forth between different fingers on different keys, or just pick one, whatever feels natural.
Record notes by clicking on the fretboard. Secondary click is a shortcut to an open string. You can do this easily in real life from any position, so it makes sense to be able to do it from any position on the virtual guitar too. Tertiary mouse button (middle mouse button) does a bend, although bends are not recorded yet. Timing is also not recorded yet. So it's not very useful for recording tabs, although you could certainly use it as an interactive chart at least.
You can choose any scale to highlight, a feature I first implemented in [Tri-Chromatic Keyboard][]. It should be much more useful here, since you can learn how to play the guitar with it! (as opposed to an instrument that virtually no-one has, including me)
Uses [tuna][] audio effects library. The guitar synthesis algorithm is from guitar-synth.
The tablature parser created for the app is available separately as a module [here][tablature-parser].
Development
npm install
npm run watch
npx live-server
The watch task compiles CoffeeScript when it changes.
live-server is a web server that reloads the page when files change. You can use any web server, alternatively.
Deployment
This app is deployed to GitHub Pages using the gh-pages module.
npm run build
npm run deploy
TODO
- Better mobile support
- Play back recorded notes with a button
- Multitouch
- Make web application self-explanatory and test accessibility
- Make bending (MMB) less ridiculous
- Record chords
(with multitouch or a modifier key, maybe also have some sort of toggle)
- Strum chords in playback, maybe have up/down arrows for up/down strumming
- Source mapping, so you can see and keep the rhythm, articulations, and comments as context
- Record, parse, and play back articulations
such as slides, bends, vibratos, hammer-ons, and pull-offs
- Different sound for sliding than for plucking/picking
- Different sound in general, ha, since it's not great...
- Support for different tunings
- Allow configuring the effects chain
(at least toggle distortion on/off)
- Clear way set focus to the fretboard for playback (unfocusing the tablature editor), via the keyboard
- Tablature editor
- Scroll with the playback position
- Make the playback position indicator different while playing, so it's clearer whether its showing what's playing or what's next
- Set the position in the song when you click in the tablature editor
- Handle multi-digit numbers when highlighting notes
- Insert and overwrite notes with the virtual guitar fretboard (as opposed to just appending (which is a specific form of inserting))
- Multi-String Cursor mode
+ Shift+click to select from the existing selection anchor
+ Disable or override double-click and triple-click... and quad-click (yeah, for real)
+ Why does the selection style change on mouseup?
- Clearer overwrite mode cursor
- Custom syntax highlighting
+ Highlight tablature with articulations and everything
+ Highlight << misalignment markers as erroneous
- Maybe add some padding with renderer.setPadding?
- Paste from contentEditable to detect a <pre> containing the tabs? Just to eliminate noise, and if it keeps surrounding text (context) while editing, extra output in what you might save / the work in removing it.
- MusicXML? MIDI?
[app]: https://1j01.github.io/guitar/ [tuna]: https://github.com/Dinahmoe/tuna [tablature-parser]: https://github.com/1j01/tablature-parser [Tri-Chromatic Keyboard]: https://github.com/1j01/tri-chromatic-keyboard