首页 > 百科知识 正文

让我们使用PC键盘在终端演奏钢琴(电脑上能不能用钢琴小键盘)

时间:2023-11-22 08:06:41 阅读:498 作者:也曾孤浪

让我们使用PC键盘在终端演奏钢琴(电脑上能不能用钢琴小键盘)-第1张

编译自: https://www.ostechnix.com/let-us-play-piano-terminal-using-pc-keyboard/

作者: Sk

译者: lujun9972

厌倦了工作?那么来吧,让我们弹弹钢琴!是的,你没有看错,根本不需要真的钢琴。我们可以用 PC 键盘在命令行下就能弹钢琴。向你们介绍一下 piano-rs —— 这是一款用 Rust 语言编写的,可以让你用 PC 键盘在终端弹钢琴的简单工具。它自由开源,基于 MIT 协议。你可以在任何支持 Rust 的操作系统中使用它。

piano-rs:使用 PC 键盘在终端弹钢琴安装

确保系统已经安装了 Rust 编程语言。若还未安装,运行下面命令来安装它。

curl https://sh.rustup.rs -sSf | sh

(LCTT 译注:这种直接通过 curl 执行远程 shell 脚本是一种非常危险和不成熟的做法。)

安装程序会问你是否默认安装还是自定义安装还是取消安装。我希望默认安装,因此输入 1 (数字一)。

info: downloading installer

Welcome to Rust!

This will download and install the official compiler for the Rust programming

Piano-rs 使用与 multiplayerpiano.com[1] 一样的音符和按键。另外,你可以使用这些音符[2]来学习弹指各种流行歌曲。

要查看帮助。输入:

$ ./target/release/piano-rs -h

piano-rs 0.1.0

Ritiek Malhotra <ritiekmalhotra123@gmail.com>

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)

我必须承认这是个超级酷的项目。对于那些买不起钢琴的人,很推荐使用这款应用。

祝你周末愉快!!

此致敬礼!


via: https://www.ostechnix.com/let-us-play-piano-terminal-using-pc-keyboard/

作者:SK[3] 译者:lujun9972 校对:wxy

本文由 LCTT 原创编译,Linux中国 荣誉推出

点击“了解更多”可访问文内链接

版权声明:该问答观点仅代表作者本人。如有侵犯您版权权利请告知 cpumjj@hotmail.com,我们将尽快删除相关内容。