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

Randomized samples + new recordings of full QWERTZ layout, 3 samples for each key #56

Open
wants to merge 5 commits into
base: master
Choose a base branch
from
Open

Conversation

vain
Copy link
Contributor

@vain vain commented Jun 18, 2017

I gave it a shot.

Some keys do indeed sound pretty different compared to your keyboard. And I don't have keys for 0x5b and 0x7d.

CC #54

vain added 3 commits June 18, 2017 10:33
Postproc, read "Pk lev dB" and then apply gain:

    $ sox *.wav -n stats
    $ for i in *; do sox "$i" "$i.norm.wav" gain 6; mv "$i.norm.wav" "$i"; done

Couldn't record "Pause" using rec.c, so I had to do that using Audacity.
We now assume that a key either has MAX_NUM_SAMPLES samples or just one
sample.
@zevv
Copy link
Owner

zevv commented Jun 18, 2017 via email

vain added 2 commits June 18, 2017 16:34
The key has some "slack", so it always sounds as little bit
"heavy"/"noisy". :/

Also tried to filter out that high-pitched noise. It's part of the real
thing but quite annoying, yes.
@vain
Copy link
Contributor Author

vain commented Jun 18, 2017

Yeah, that space bar is noisy. The key cap doesn't sit tight anymore and there's quite some "wiggle room" (is that a word?), so there's a lot of vibrations going on. Can't really do anything about it, expect applying less force when pressing the key. That, however, doesn't fit the rest of the recordings. %)

That 12 kHz squeek is nasty. It's present in a lot of keys. I can try to filter it out.

I'll push some alternative versions. (You/I should probably rebase and squash if you decide to merge this PR, to avoid having duplicate recordings in the repo.)

@zevv
Copy link
Owner

zevv commented Jun 18, 2017 via email

@vain
Copy link
Contributor Author

vain commented Jun 18, 2017

What about if we just keep multiple sample sets? [...] Check my 'samplesets' branch

Yeah, sure, why not. :-)

(I wonder if more people are going to do some recordings.)

for the purist we'll document the exact keyboard type with serial number for each sample set [...] Mine is a IBM Model M space saver, part number 1391403, manufacturing date 1989-06-29

Funny, mine was built on the same day.

https://dump.uninformativ.de/v/Weemd-Bient-87/model-m-numbers.jpg

@zevv
Copy link
Owner

zevv commented Jun 18, 2017 via email

@vain
Copy link
Contributor Author

vain commented Jun 19, 2017

Okay, I'm sorry, there's something wrong. After a while, buckle exits with this message:

source generation
AL lib: (EE) alc_cleanup: 1 device not closed

I guess that there are too many AL sources now. I naively assumed that we can safely use 512 * 3 of them.

I'll look into this later today. Sorry.

@zevv
Copy link
Owner

zevv commented Jun 19, 2017 via email

@vain
Copy link
Contributor Author

vain commented Jun 19, 2017

You're probably right.

It appears the maximum number of sources depends on the implementation/platform. This thread gives some ideas on how to "query" it. It probably boils down to "try allocating sources until it fails".

Or maybe just limit the number to about 8, because it's rather unlikely that a person hits more than 8 keys at once while typing normally. :-)

(Both options feel a little weird, if you ask me. There has got to be a way to properly query that value.)

@zevv
Copy link
Owner

zevv commented Jun 19, 2017 via email

@zevv
Copy link
Owner

zevv commented Jun 19, 2017 via email

@vain
Copy link
Contributor Author

vain commented Jun 20, 2017

No, I wasn't working on it yet, you beat me to it. :-)

Your recent commit works fine for me, except for one thing: I think a source should always be stopped before rebinding it.

diff --git a/main.c b/main.c
index a908fb5..8b569bc 100644
--- a/main.c
+++ b/main.c
@@ -376,6 +376,7 @@ int play(int code, int press)
 	}
 
 	/* Find a free source for the buffer. For now we just use round robin */
+	alSourceStop(src[src_idx]);
 
 	double x = find_key_loc(code);
 	alSource3f(src[src_idx], AL_POSITION, -x, 0, (100 - opt_stereo_width) / 100.0);

This isn't required when typing normally, but some password managers generate artificial key events to enter passwords. Let's say the password is 64 characters in length, then there will be 64 events delivered to buckle almost at the same time. Buckle then aborts with the following message if the source has not been stopped:

OpenAL error at buffer binding
AL lib: (EE) alc_cleanup: 1 device not closed

@zevv
Copy link
Owner

zevv commented Jun 20, 2017 via email

@blinry
Copy link
Contributor

blinry commented Oct 19, 2017

I'd love to see this merged! :)

@zevv
Copy link
Owner

zevv commented Oct 19, 2017 via email

@returnDanilo
Copy link
Contributor

To give you some feedback:

I liked the new samples. I wouldn't say they are objectively better than the old ones, tough; it's a matter of taste. Personally, I prefer the old ones, even when taking into account the sample randomization.

What about if we just keep multiple sample sets? Don't replace the
original recordings, just create a new dir and let the user choose.

I'd include both sets of samples, letting the user decide which to use.

(I wonder if more people are going to do some recordings.)

It'd be fun if in the future people submitted patches with samples from all sorts of old keyboards ;)

By the way, @vain appears to have abandoned this account, so I wouldn't expect to be hearing back from them, if not emailing them directly.

@returnDanilo
Copy link
Contributor

Also, before merging this, remember to add the missing samples:

And I don't have keys for 0x5b and 0x7d.

When I press the left win key I get a Failed to open file error.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

4 participants