Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Distinct sound for keys #24

Closed
orhun opened this issue Oct 3, 2023 · 11 comments · Fixed by #44
Closed

Distinct sound for keys #24

orhun opened this issue Oct 3, 2023 · 11 comments · Fixed by #44
Assignees
Labels
enhancement New feature or request

Comments

@orhun
Copy link
Owner

orhun commented Oct 3, 2023

Is your feature request related to a problem? Please describe.

For the default preset, having a distinct sound for each key press would be an interesting feature. Maybe it might even sound more realistic.

Describe the solution you'd like

n/a
Ideas welcome.

Describe alternatives you've considered

n/a

Additional context

https://www.reddit.com/r/linux/comments/16xu9ek/comment/k37m3qj/?utm_source=share&utm_medium=web2x&context=3

@orhun orhun added the enhancement New feature or request label Oct 3, 2023
@orhun orhun self-assigned this Oct 3, 2023
@Xenira
Copy link
Sponsor Contributor

Xenira commented Oct 14, 2023

While I like this idea and this seems to be more of a fun project I think it is worth to consider the security implications of this.

With this active it would be possible to figure out passwords (and other inputs) based on the sounds played.

For more realism it might be possible to randomly alter pitch and speed by a little bit.

@orhun
Copy link
Owner Author

orhun commented Oct 14, 2023

Yup, you are definitely right.

For more realism it might be possible to randomly alter pitch and speed by a little bit.

Sounds good! Are you interested in raising a PR? 🐻

@orhun orhun removed their assignment Oct 14, 2023
@Xenira
Copy link
Sponsor Contributor

Xenira commented Oct 14, 2023

I will try, but not sure how to do this yet. Haven't done any sound processing in rust yet.

@orhun
Copy link
Owner Author

orhun commented Oct 14, 2023

Got it, let me know when you have progress! I can hop in to help if needed.

@Xenira
Copy link
Sponsor Contributor

Xenira commented Oct 14, 2023

Sure, Ill create a draft for config/cli interface first and then see how well I can manage the rest.

@Xenira
Copy link
Sponsor Contributor

Xenira commented Oct 14, 2023

Got volume and speed running without much of a problem. There seems to be no option for pitch though.

Any feedback on what I've got so far would be appreciated.

Will do docu and cleanup once everything else is in place.

@orhun
Copy link
Owner Author

orhun commented Oct 15, 2023

Thanks! Do you think we can use an external library for changing the pitch? Maybe process the audio at runtime before feeding it into the sink?

@Xenira
Copy link
Sponsor Contributor

Xenira commented Oct 15, 2023

Guess that is highly dependent on the audio formats we want to support.

Also performance might be a consideration. If there is one that can do this using streams I am all for it.

@orhun
Copy link
Owner Author

orhun commented Oct 15, 2023

I think we're only supporting MP3 for now. I will look into if possible to do so.

@Xenira
Copy link
Sponsor Contributor

Xenira commented Oct 15, 2023

After some research I think it might not be worth the effort to add the pitch shift option. In fact the speed option should already modify the pitch. Time independent pitch shifting seems to be a little more on the complex side. But I have basically no knowledge on music theory.

There are no big libraries (as far as I could tell) that implement those algorithms.

My proposal would be to either

  1. Drop pitch entirely
  2. Create mp3's that are already pitch shifted and add them to the preset

@Xenira
Copy link
Sponsor Contributor

Xenira commented Oct 16, 2023

Removed pitch (#44 (comment))

@orhun orhun closed this as completed in #44 Oct 18, 2023
orhun added a commit that referenced this issue Oct 18, 2023
* feat(sound): Add random variation on each keypress

* refactor(sound): remove pitch, change default and improve cli

* docs(readme): add example for variation

* docs(readme): use snake case for key config

---------

Co-authored-by: mergify[bot] <37929162+mergify[bot]@users.noreply.github.com>
Co-authored-by: Orhun Parmaksız <orhunparmaksiz@gmail.com>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature or request
Projects
None yet
Development

Successfully merging a pull request may close this issue.

2 participants