A Rust CLI that makes mechanical keyboard sound effects on every key press

Overview

Rustyvibes

A Rust CLI that makes mechanical keyboard sound effects on every key press

Rustyvibes.mp4

Installation

macOS:

brew install kb24x7/rustyvibes/rustyvibes

Windows / Linux:

cargo install rustyvibes

Usage

rustyvibes 
   

   

Download Soundpacks: Here


Mechvibes vs. Rustyvibes

How does Rustyvibes compare to its competitors like Mechvibes? Mechvibes uses Electron and Chromium which is very resource intensive. Rustyvibes on the other hand is made with Rust and can be upto 10x-100x more resource efficient.

Mechvibes Soundpacks: Here

Certain custom soundpacks may not work with Rustyvibes, you can use this tool to fix those


Privacy and Permissions

Rustyvibes is a fully open-sourced project and never uses any network activity at all. macOS by default will ask you for input monitoring permissions when you start the app for the first time, if you were unable to enable it the first time, you'll need to add your default terminal you're using in the allowed input monitoring apps

image

Contribute to this project

buymeacoffee

Comments
  • Add volume support to cli

    Add volume support to cli

    rustyvibes <volume> <soundpack_path>

    Maybe need to update the readme too? Either update the source in cargo or instruction to build it locally.

    opened by aasutossh 5
  • Installation failed on Ubuntu 21.10

    Installation failed on Ubuntu 21.10

    I tried to install rustyvibes on my Ubuntu 21.10 system with cargo install rustyvibes but the installation failed with the warning and error messages: warning: build failed, waiting for other jobs to finish... error: failed to compile `rustyvibes v1.0.8`, intermediate artifacts can be found at `/tmp/cargo-installgSvcr6`

    Any fixes to this? (Entire installation error screenshot attached)

    Screenshot from 2022-04-22 17-31-11

    opened by ameya-deshmukh 5
  • Split sound into keydown and keyup portions

    Split sound into keydown and keyup portions

    I wanted to put a draft PR up since this has bigger changes in functionality, and will require pre-processing of soundpacks in order to support the new format.

    What this PR does:

    • Introduces a new utility script to iterate through a soundpack, analyze the ogg files, split them into the key-up and key-down portions, trim silent whitespace off the front edge (to further reduce delay), and then save out as wav files.
    • Modify the main rustyvibes driver to play the appropriate key down and key up sounds at the right time.

    Gaps/deficiencies in this current PR

    • Rust ogg encoder crates are few and far between, so here for simplicity I'm writing out to wav instead.
    • I need to clean up and improve the conversion script to also modify the config.json as well, and delete the original ogg files.
    • The usage of up.wav extension is a bit of a hack, but avoids me from having to do more major surgery to the config schema.

    I'd like to know if this is a direction I should keep pursuing before continuing though. So what do you think?

    In trying it out, I think it's pretty flippin' sweet to hear an accurate key down and key up sound at the right times. Really makes it feel realistic. But that's just my $0.02.

    opened by binarybana 5
  • Cant get sound to work on macOS big Sur

    Cant get sound to work on macOS big Sur

    I installed the CLI via brew, followed the usage instructions writing it like this rustyvibes /Users/.../Downloads/Soundpacks/cherrymx-black-abs which is where the sound files are located, the program started running but no sound is working, the first time I ran it it asked for permissions on accesability I clicked open accesibility preferences but nothing appeared, so i searched for the rustyvibes executable which was found in /usr/local/bin/rustyvibes and I dropped it on the accesibility panel, even then it still didnt work, any ideas on how to get it to work? I downloaded MechVibes just to check it out and I enjoy it BUT its really resource intensive

    opened by aaSchcolnik 5
  • Improve latency and reduce memory usage

    Improve latency and reduce memory usage

    By using a threadpool, we can reduce thread startup times (minimal impact) and more importantly: cache rodio OutputStream creation which costs about 10-20ms per keypress. And all around reduce allocation.

    We also cache file reading in a global hashmap.

    Ironically, this caching seems to reduce memory usage in my testing (MacOSX looking at private and total).

    hacktoberfest-accepted 
    opened by binarybana 4
  • Volume support and better command parser

    Volume support and better command parser

    Changes

    • clap library is used to parse commands instead of manually parsing.
    • volume support is added by sending the filename and the volume value to the worker.
    opened by riyuzenn 3
  • seems to be using the published crate for rodio instead of the git repo?

    seems to be using the published crate for rodio instead of the git repo?

    which makes most soundpacks fail to work because of the wav error

    https://github.com/kb24x7/rustyvibes/blob/38b6b9e16a8085f2c6e14dd29ad4347b56dba600/Cargo.toml#L19

    opened by somebody1234 2
  • Unable to install on Ubuntu 22.04, missing 'alsa

    Unable to install on Ubuntu 22.04, missing 'alsa"?

    This is the error my terminal showed when doing cargo install rustyvibes:

    ❯ cargo install rustyvibes
        Updating crates.io index
      Installing rustyvibes v1.0.9
       Compiling libc v0.2.139
       Compiling proc-macro2 v1.0.49
       Compiling quote v1.0.23
       Compiling unicode-ident v1.0.6
       Compiling syn v1.0.107
       Compiling autocfg v1.1.0
       Compiling pkg-config v0.3.26
       Compiling cfg-if v1.0.0
       Compiling version_check v0.9.4
       Compiling bitflags v1.3.2
       Compiling scopeguard v1.1.0
       Compiling thiserror v1.0.38
       Compiling lock_api v0.4.9
       Compiling memoffset v0.6.5
       Compiling proc-macro-error-attr v1.0.4
       Compiling io-lifetimes v1.0.3
       Compiling alsa-sys v0.3.1
       Compiling parking_lot_core v0.8.6
    error: failed to run custom build command for `alsa-sys v0.3.1`
    
    Caused by:
      process didn't exit successfully: `/tmp/cargo-installj00Po2/release/build/alsa-sys-4ca086f333ea3780/build-script-build` (exit status: 101)
      --- stdout
      cargo:rerun-if-env-changed=ALSA_NO_PKG_CONFIG
      cargo:rerun-if-env-changed=PKG_CONFIG_x86_64-unknown-linux-gnu
      cargo:rerun-if-env-changed=PKG_CONFIG_x86_64_unknown_linux_gnu
      cargo:rerun-if-env-changed=HOST_PKG_CONFIG
      cargo:rerun-if-env-changed=PKG_CONFIG
      cargo:rerun-if-env-changed=ALSA_STATIC
      cargo:rerun-if-env-changed=ALSA_DYNAMIC
      cargo:rerun-if-env-changed=PKG_CONFIG_ALL_STATIC
      cargo:rerun-if-env-changed=PKG_CONFIG_ALL_DYNAMIC
      cargo:rerun-if-env-changed=PKG_CONFIG_PATH_x86_64-unknown-linux-gnu
      cargo:rerun-if-env-changed=PKG_CONFIG_PATH_x86_64_unknown_linux_gnu
      cargo:rerun-if-env-changed=HOST_PKG_CONFIG_PATH
      cargo:rerun-if-env-changed=PKG_CONFIG_PATH
      cargo:rerun-if-env-changed=PKG_CONFIG_LIBDIR_x86_64-unknown-linux-gnu
      cargo:rerun-if-env-changed=PKG_CONFIG_LIBDIR_x86_64_unknown_linux_gnu
      cargo:rerun-if-env-changed=HOST_PKG_CONFIG_LIBDIR
      cargo:rerun-if-env-changed=PKG_CONFIG_LIBDIR
      cargo:rerun-if-env-changed=PKG_CONFIG_SYSROOT_DIR_x86_64-unknown-linux-gnu
      cargo:rerun-if-env-changed=PKG_CONFIG_SYSROOT_DIR_x86_64_unknown_linux_gnu
      cargo:rerun-if-env-changed=HOST_PKG_CONFIG_SYSROOT_DIR
      cargo:rerun-if-env-changed=PKG_CONFIG_SYSROOT_DIR
    
      --- stderr
      thread 'main' panicked at '`"pkg-config" "--libs" "--cflags" "alsa"` did not exit successfully: exit status: 1
      error: could not find system library 'alsa' required by the 'alsa-sys' crate
    
      --- stderr
      Package alsa was not found in the pkg-config search path.
      Perhaps you should add the directory containing `alsa.pc'
      to the PKG_CONFIG_PATH environment variable
      No package 'alsa' found
      ', /home/fsevenm/.cargo/registry/src/github.com-1ecc6299db9ec823/alsa-sys-0.3.1/build.rs:13:18
      note: run with `RUST_BACKTRACE=1` environment variable to display a backtrace
    warning: build failed, waiting for other jobs to finish...
    error: failed to compile `rustyvibes v1.0.9`, intermediate artifacts can be found at `/tmp/cargo-installj00Po2`
    

    I have alsa installed.

    ❯ which alsa
    /usr/sbin/alsa
    
    opened by fsevenm 1
  • Caches a worker thread and audio context but discards after 20s of inactivity

    Caches a worker thread and audio context but discards after 20s of inactivity

    I figured out where the extra CPU was coming from in my previous PR (#10) with threadpools: an active rodio::OutputStream will constantly service callback requests for data from CoreAudio, and the more threads that have an active context, the more CPU usage we'll use. So to tackle that:

    1. I found that the threadpool (with more than one thread) was unnecessary in the first place, because using rodio::Sinks enables queuing up multiple sounds on a single OutputStream.
    2. In addition, because CoreAudio itself uses a lot of CPU when you have any contexts open at a single time, then I implemented logic to terminate the worker thread (and discard it's rodio context) after 20 seconds of inactivity and start it up again fresh the next time the user pushes a key.
    opened by binarybana 1
  • Fix thread panic on un-mapped keys

    Fix thread panic on un-mapped keys

    Issue: Some keys such as "ControlRight", "PageDown" , "PageUp" and "media controls" are not given a key-code. The code that handles the "None" branch will cause the spawned thread to panic and no sound will be played.

    Solution: To keep the user immersed, un-mapped Keys will fallback to "a".

    Additional refactoring: Removed code duplication

    hacktoberfest-accepted 
    opened by B0ney 1
  • Debounce keystrokes so we don't keep playing on held down keys

    Debounce keystrokes so we don't keep playing on held down keys

    Later, I want to actually split the audio file into the downward key press and the release, and then play them separately, but this will at least prevent repeated sounds while holding down a key.

    opened by binarybana 0
  • [Wayland] Works only with Electron (or web) apps

    [Wayland] Works only with Electron (or web) apps

    Hello! I tried Rustyvibes on Arch Linux with Wayland (SwayWM) and for first time when I ran in terminal (of course after compiling from source code) I thought sound doesn't work, but when I switched to Discord window I heard sounds. I just didn't hear anything in terminal, I heard sounds only in Discord window.

    opened by anton2007 0
Releases(v1.0.9)
Add path effects to open glyphs in a UFO file

ufostroker Add path effects to open contours in a UFO file Given a glyph with open contours: You can apply a noodle effect: ufostroker -i Open.ufo -o

Simon Cozens 5 Jun 28, 2021
Crunch is a command-line interface (CLI) to claim staking rewards every X hours for Substrate-based chains

crunch · crunch is a command-line interface (CLI) to claim staking rewards every X hours for Substrate-based chains. Why use crunch To automate payout

null 39 Dec 8, 2022
A simple interactive OSC (Open Sound Control) debugger for terminal

oscd, a simple interactive OSC debugger for the terminal by using nom as a lexer/parser, oscd offers auto type casting and support sending multiple osc arguments.

Karnpapon Boonput 5 Oct 19, 2022
Detects Linux input, notifies with bell sound

Keypress Notifier keypress-notifier는 리눅스에서 동작하는 입력 이벤트 감지 및 벨 소리 알림 프로젝트입니다. 소개 keypress-notifier는 Rust 언어로 개발되었으며, 키패드, 마우스 등의 입력 이벤트를 감지하고, 벨 소리로 사용

인준 4 Feb 15, 2024
Rust-advent - Learning Rust by solving advent of code challenges (Streaming live on Twitch every Monday)

Rust advent ?? ?? Learning Rust by implementing solutions for Advent of Code problems. ?? HEY, we are live-streaming our attempts to solve the exercis

Luciano Mammino 20 Nov 11, 2022
A Rust-based shell script to create a folder structure to use for a single class every semester. Mostly an excuse to use Rust.

A Rust Course Folder Shell Script PROJECT IN PROGRESS (Spring 2022) When completed, script will create a folder structure of the following schema: [ro

Sebastián Romero Cruz 1 Apr 10, 2022
Warp is a blazingly fast, Rust-based terminal that makes you and your team more productive at running, debugging, and deploying code and infrastructure.

Warp is a blazingly fast, Rust-based terminal that makes you and your team more productive at running, debugging, and deploying code and infrastructure.

Warp 10.4k Jan 4, 2023
👀Little program I made in 🦀Rust that reminds me every 20 minutes to look away from my computer 🖥screen.

?? eye break Little program I made in ?? Rust that reminds me every 20 minutes to look away from my computer ?? screen. I stay way too long on the com

Goldy 3 Apr 9, 2023
procs makes it easy to find and manage system processes

procs procs makes it easy to find and manage system processes. Right now, the main usage is finding processes by the ports it is listening on, but mor

Kurt Wolf 3 Aug 29, 2022
A tool that makes writing WebAssembly Text files easier.

Silly WAT Linker SWL is a tool that makes writing WebAssembly Text files easier. It is future-proof and simple because it doesn’t actually understand

Surma 27 Feb 17, 2023
A small program which makes a rofi game launcher menu possible by creating .desktop entries for games

rofi-games A small program which makes a `rofi` game launcher menu possible by creating `.desktop` entries for games Installation Manual Clone repo: g

Rolv Apneseth 20 May 4, 2023
A little application that makes it possible to display mpv's subs anywhere you want.

Mpv Subs Popout A little application that makes it possible to display mpv's subs anywhere you want. Why? You can now watch shows in foreign languages

sdaqo 4 Jul 14, 2023
A diff-based data management language to implement unlimited undo, auto-save for games, and cloud-apps which needs to retain every change.

Docchi is a diff-based data management language to implement unlimited undo, auto-save for games, and cloud-apps which needs to save very often. User'

juzy 21 Sep 19, 2022
CIEBII - Check if every bit is intact

CIEBII Checks If Every Byte Is Intact CIEBII is an image file format that checks if every single byte is intact. What does it do if it finds that a by

Codingsquirrel 2 Oct 7, 2022
Same procedure as every year… right?

Advent of Code 2022 solutions What this repository is This repository contains solutions to Eric Wastls Advent of Code 2022. Thank you, Eric! While th

Patrick 3 Dec 15, 2022
Uses the cardano mini-protocols to receive every block and transaction, and save them to a configurable destination

cardano-slurp Connects to one or more cardano-node's, streams all available transactions, and saves them to disk (or to S3) in raw cbor format. Usage

Pi Lanningham 16 Jan 31, 2023
This library contains collection of all sorts of useful information for every country.

Keshvar This library contains collection of all sorts of useful information for every country. Package | Documentation | Repository Demo use keshvar::

Pouriya 11 Apr 2, 2023
Generate perfect Vyper compatible code headers every time.

headers-vy Generate perfect Vyper-compatible code headers every time. Build You need Rust and Cargo installed on your machine. See the installation gu

t11s 15 Feb 12, 2023
That program use on platform windows. And if you write any text on uncorrect keyboard layout, that program for that.

?? This program is designed to translate text into the correct layout when typing is incorrect. ?? Example ghbdtn -> привет Just (by default) pressing

Gest Se 5 Jan 26, 2023