仕事で退屈しませんか?さあ、ピアノを弾きましょう!ええ、あなたはそれを正しく読んだ。誰が本物のピアノを必要としますか?これで、PCキーボードを使用して、コマンドラインからピアノを演奏または演奏する方法を学ぶことができます。 ピアノ-rsに会う -Rustプログラミング言語で記述されたシンプルなユーティリティで、PCキーボードを使用してターミナルでピアノを演奏できます。これは無料のオープンソースであり、MITライセンスの下でライセンスされています。 Rustをサポートするすべてのオペレーティングシステムで使用できます。
Piano-rs:PCキーボードを使用してターミナルでピアノを演奏する
インストール
システムにRustプログラミング言語がインストールされていることを確認してください。 Rustをまだインストールしていない場合は、次のコマンドを実行してインストールします。
curl https://sh.rustup.rs -sSf | sh
インストーラーは、デフォルト値でインストールを続行するか、インストールをカスタマイズするか、インストールをキャンセルするかを尋ねます。デフォルト値でインストールしたいので、 1と入力しました (ナンバーワン)。
info: downloading installer Welcome to Rust! This will download and install the official compiler for the Rust programming language, and its package manager, Cargo. It will add the cargo, rustc, rustup and other commands to Cargo's bin directory, located at: /home/sk/.cargo/bin This path will then be added to your PATH environment variable by modifying the profile files located at: /home/sk/.profile /home/sk/.bash_profile You can uninstall at any time with rustup self uninstall and these changes will be reverted. Current installation options: default host triple: x86_64-unknown-linux-gnu default toolchain: stable modify PATH variable: yes 1) Proceed with installation (default) 2) Customize installation 3) Cancel installation 1 info: syncing channel updates for 'stable-x86_64-unknown-linux-gnu' 223.6 KiB / 223.6 KiB (100 %) 215.1 KiB/s ETA: 0 s info: latest update on 2017-10-12, rust version 1.21.0 (3b72af97e 2017-10-09) info: downloading component 'rustc' 38.5 MiB / 38.5 MiB (100 %) 459.3 KiB/s ETA: 0 s info: downloading component 'rust-std' 56.7 MiB / 56.7 MiB (100 %) 220.6 KiB/s ETA: 0 s info: downloading component 'cargo' 3.7 MiB / 3.7 MiB (100 %) 173.5 KiB/s ETA: 0 s info: downloading component 'rust-docs' 4.1 MiB / 4.1 MiB (100 %) 224.0 KiB/s ETA: 0 s info: installing component 'rustc' info: installing component 'rust-std' info: installing component 'cargo' info: installing component 'rust-docs' info: default toolchain set to 'stable' stable installed - rustc 1.21.0 (3b72af97e 2017-10-09) Rust is installed now. Great! To get started you need Cargo's bin directory ($HOME/.cargo/bin) in your PATH environment variable. Next time you log in this will be done automatically. To configure your current shell run source $HOME/.cargo/env
システムをログアウトまたは再起動して、PATH変数の貨物のbinディレクトリを更新します。
Rustが正しくインストールされているかどうかを確認します:
$ rustc --version rustc 1.21.0 (3b72af97e 2017-10-09)
素晴らしい! Rustが正常にインストールされました。ピアノ-rsアプリケーションを構築する時間です。
次のコマンドを使用して、Piano-rsリポジトリのクローンを作成します。
git clone https://github.com/ritiek/piano-rs
上記のコマンドは、現在の作業ディレクトリに「piano-rs」というディレクトリを作成し、その中のすべてのコンテンツをダウンロードします。そのディレクトリに移動します:
cd piano-rs
最後に、次のコマンドを実行してPiano-rsをビルドします。
cargo build --release
コンパイルプロセスにはしばらく時間がかかります。
使用法
コンパイルプロセスが終了したら、ピアノ-rsから次のコマンドを実行します ディレクトリ:
./target/release/piano-rs
これがターミナルのピアノキーボードです!いくつかのノートを演奏する時が来ました。キーを押してノートを再生します。 左/右を使用します 再生中に音符の周波数を調整するための矢印キー。そして、 UP / Downを使用します 再生中に音符の長さを調整するための矢印。
Piano-rsは、 multiplayerpiano.comと同じ音符とキーバインディングを使用します 。または、これらのメモを使用します さまざまなポピュラー曲の演奏を学ぶ。
ヘルプセクションを表示します。タイプ:
$ ./target/release/piano-rs -h
piano-rs 0.1.0 Ritiek Malhotra <[email protected]> Play piano in the terminal using PC keyboard. USAGE: piano-rs [OPTIONS] FLAGS: -h, --help Prints help information -V, --version Prints version information OPTIONS: -c, --color <COLOR> Color of block to generate when a note is played (Default: "red") -d, --duration <DURATION> Duration to play each note for, where 0 means till the end of note (Default: 0) -s, --sequence <SEQUENCE> Frequency sequence from 0 to 5 to begin with (Default: 2)
私はそれがとてもクールなプロジェクトであることを認めなければなりません。ピアノを買う余裕がなかった人は、このアプリケーションを使用してください。
楽しく幸せな週末を!
乾杯!