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

KEY DOWN / KEY UP sounds #21

Open
mrender opened this issue Sep 2, 2020 · 5 comments
Open

KEY DOWN / KEY UP sounds #21

mrender opened this issue Sep 2, 2020 · 5 comments
Labels
enhancement New feature or request !stale Prevent bot from marking as stale

Comments

@mrender
Copy link

mrender commented Sep 2, 2020

One thing that sounds strange is that we hear the whole key trajectory sound, going down and getting back up, although we did not release the key.

It would be interesting to have 2 sounds: one for down, one other for up.

@hainguyents13
Copy link
Owner

I thought of that in the very beginning, but there will be a lot of problems with it. but I will try when I have time

@mefleacuzimtiny
Copy link

A suggestion for the sound effects to be more efficient so there's a seamless connection between the sounds:
Maybe there can be three versions of each sounds:
On click, On release, and Full
On full would play if the button has been held for < 0.5 ms or some other arbitrary small amount of time. If it exceeds this, then only the on click sound effect could be played, and then, when the release event occurs, then the on release sound effect could be played.

@NotLazy NotLazy added the !stale Prevent bot from marking as stale label Feb 19, 2024
@rivmi
Copy link

rivmi commented Feb 23, 2024

This feature not only would be nice, but I'd say it is kind of necessary..
There are multiple ways to make this work, like:

Having multiple audio files assigned to a specific state of keypress
ie: "1": "down.wav", "up.wav"
And add a toggle for the function, so that if you don't want to use it, it plays down and up sequentially like if it was a single file.

To a more involved one, like still mantaining a single audio file but with the user stating in the config when the down state ends.
ie: "1": "down.wav" "x",
'X' would be in ms, and you would need to specify only when the down state ends.
Just use the start of the audio file for the start of key down until 'x' and use 'x' as the start of the up state

Another option is to get that value without changing configs at all
Just take the whole length of the audio file and use the first half for key down and second half for key up.

Thing is, properly documenting it in a 'how to' for creating a sound pack would also be necessary.

Also, and I can't stress this enough, I do not know how this could be accomplished by code, I mean, I don't know anything, this is just me saying stuff

@NotLazy
Copy link
Collaborator

NotLazy commented Feb 24, 2024

@rivmi Thanks for your feedback. I've already made plans about how to structure the next (couple) versions of configs, including abstracting sounds into a number of configurable files and clips, with both being supported within one pack.

Here's a shorter version of what I have so far, that covers your concerns:

{
	"sounds": {
		// play a clip of the file
		"keydown": {
			"file": "#/sound.ogg", // #/ marks the root of the soundpack
			"clip": [2186, 281], // ["start", "length"]
		},
		"keyup": {
			"file": "#/sound.ogg",
			"clip": [3251, 281],
		},

		// play the whole file
		"key_down": {
			"file": "#/sound2.ogg",
		},
		"key_up": {
			"file": "#/sound2_up.ogg",
		},
	}

	// key definitions
	"defines": {
		// format
		"keyCode": ["keyDown", "keyUp"]
		// definitions

		// define one sound for key down only
		"1": ["keydown"],

		// define two sounds for key down and key up
		"2": ["key_down", "keyup"],
	}
}

While I can't promise, when exactly this will be implemented, I can assure you it's being thought of and is planned to be added.

Copy link

This issue has been automatically marked as stale because it has not had any activity in the last 60 days. It will be closed in 7 days if no further activity occurs. Please feel free to leave a comment if you believe the issue is still relevant.

@github-actions github-actions bot added the stale This issue is stale and will be closed soon label Apr 24, 2024
@NotLazy NotLazy removed the stale This issue is stale and will be closed soon label Apr 29, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature or request !stale Prevent bot from marking as stale
Projects
None yet
Development

No branches or pull requests

5 participants