Re: [gentoo-user] Typewriter sound
-BEGIN PGP SIGNED MESSAGE- Hash: SHA1 2010-08-17 21:34 keltezéssel, Albert Hopkins írta: On Tue, 2010-08-17 at 20:43 +0200, meino.cra...@gmx.de wrote: Bill Longman bill.long...@gmail.com [10-08-17 20:16]: On 08/17/2010 10:56 AM, Albert Hopkins wrote: On Tue, 2010-08-17 at 19:20 +0200, meino.cra...@gmx.de wrote: Hi, on YouTube there was a Blender-2.5 tutorial with audio. There was an interesting detail: While there were spoken instructions one can hear one typing on its keyboard. Each hit on one of the keys made the sound of an old typewriter (no, it was not the sound of the legendary IBM Model M keyboard ;) ). How can I achieve this? What software can I use to make this geeky feature to come true. Unfortunately I have no idea, how to name this kind of what(?) ... Thank you very much for any hint in advance! Best regards, mcc There probably a number of ways to do this. A cheap and easy way would be to use xev to monitor a window and then pipe the stderr to a a program that waits for a keypress event and then plays an apropriate. A less cheap way would be to have our program do what xev does instead of using a pipe. Or you could set your X keyclick using xset. Hi, thanks a lot for your replies! :) Is there any program already, which does this? A daemon or...insert missing words here Best regards, mcc Well I found out that when you pass window id to xev it does not trap keyboard presses per-sé. But there is another way... Anway the following is a quick hack (in python). It pretty much works except it also seems to trap mouse presses. I got the .wav file at http://www.soundjay.com/typewriter-sounds.html I tried using 'xset c' but it basically does nothing for me. My guess is that it does work it basically sends the a BELL to the console. --- 8 CUT HERE --- import sys import subprocess soundfile = 'typewriter-key-1.wav' def main(): window_id = sys.argv[1] cmd = ['xev', '-id', window_id] p1 = subprocess.Popen(cmd, stdout=subprocess.PIPE) while True: line = p1.stdout.readline() if line.find('atom 0x14d') -1: subprocess.Popen(['aplay', soundfile], stderr=open('/dev/null', 'w')) if __name__ == '__main__': main() Guys, this is awesome :) Let's make an ebuild and put in portage :) L: -BEGIN PGP SIGNATURE- Version: GnuPG v2.0.17 (GNU/Linux) Comment: Using GnuPG with Mozilla - http://enigmail.mozdev.org/ iQEcBAEBAgAGBQJOXlDCAAoJECu/a/sBwapoXS0IAMKolA55zV/mAQqlwe/qvk1w HyVpirrOYYYQOsdJChnvYfpgWBUT0F8uwEaO1pLGdlACrN0VHYJMk45nC8PBtKkL gkrnR0Q0Ew6bZ1DeXjd2x+jZEN5Am6vQCHxLd85OJfTvIM7Ahc+FdJWtfhcaO8IF hXppxITOQ9hCH+iEhel6TTq4wAQjX/i0C6RsF9RTGbocAzCdpZSs/RPffQiHuScv IBrKOxLCQ2TACmdYmbK47vCKH6rgsNDENWD19g9zVouHHtXLeBnavG42wV46qCUW OmNoKFA00ZXmuVUhpyUhhLSv6D4n5w7TFKdNXFof6Whf6/9X82oVe4yQCgbC+E8= =R2iT -END PGP SIGNATURE-
Re: [gentoo-user] Typewriter sound
Am Mittwoch 31 August 2011, 17:18:26 schrieb Space Cake: 2010-08-17 21:34 keltezéssel, Albert Hopkins írta: On Tue, 2010-08-17 at 20:43 +0200, meino.cra...@gmx.de wrote: Bill Longman bill.long...@gmail.com [10-08-17 20:16]: On 08/17/2010 10:56 AM, Albert Hopkins wrote: On Tue, 2010-08-17 at 19:20 +0200, meino.cra...@gmx.de wrote: Hi, on YouTube there was a Blender-2.5 tutorial with audio. There was an interesting detail: While there were spoken instructions one can hear one typing on its keyboard. Each hit on one of the keys made the sound of an old typewriter (no, it was not the sound of the legendary IBM Model M keyboard ;) ). How can I achieve this? What software can I use to make this geeky feature to come true. Unfortunately I have no idea, how to name this kind of what(?) ... Thank you very much for any hint in advance! Best regards, mcc There probably a number of ways to do this. A cheap and easy way would be to use xev to monitor a window and then pipe the stderr to a a program that waits for a keypress event and then plays an apropriate. A less cheap way would be to have our program do what xev does instead of using a pipe. Or you could set your X keyclick using xset. Hi, thanks a lot for your replies! :) Is there any program already, which does this? A daemon or...insert missing words here Best regards, mcc Well I found out that when you pass window id to xev it does not trap keyboard presses per-sé. But there is another way... Anway the following is a quick hack (in python). It pretty much works except it also seems to trap mouse presses. I got the .wav file at http://www.soundjay.com/typewriter-sounds.html I tried using 'xset c' but it basically does nothing for me. My guess is that it does work it basically sends the a BELL to the console. --- 8 CUT HERE --- import sys import subprocess soundfile = 'typewriter-key-1.wav' def main(): window_id = sys.argv[1] cmd = ['xev', '-id', window_id] p1 = subprocess.Popen(cmd, stdout=subprocess.PIPE) while True: line = p1.stdout.readline() if line.find('atom 0x14d') -1: subprocess.Popen(['aplay', soundfile], stderr=open('/dev/null', 'w')) if __name__ == '__main__': main() Guys, this is awesome :) Let's make an ebuild and put in portage :) L: why? man xset really guys. Why do it the long, hard and stupid way if there have been simple, built in solutions for longer than some of you live? -- #163933
Re: [gentoo-user] Typewriter sound
On 2011. aug. 31., szerda, 17.54.15 CEST, Volker Armin Hemmann wrote: Am Mittwoch 31 August 2011, 17:18:26 schrieb Space Cake: 2010-08-17 21:34 keltezéssel, Albert Hopkins írta: On Tue, 2010-08-17 at 20:43 +0200, meino.cra...@gmx.de wrote: Bill Longman bill.long...@gmail.com [10-08-17 20:16]: On 08/17/2010 10:56 AM, Albert Hopkins wrote: On Tue, 2010-08-17 at 19:20 +0200, meino.cra...@gmx.de wrote: Hi, on YouTube there was a Blender-2.5 tutorial with audio. There was an interesting detail: While there were spoken instructions one can hear one typing on its keyboard. Each hit on one of the keys made the sound of an old typewriter (no, it was not the sound of the legendary IBM Model M keyboard ;) ). How can I achieve this? What software can I use to make this geeky feature to come true. Unfortunately I have no idea, how to name this kind of what(?) ... Thank you very much for any hint in advance! Best regards, mcc There probably a number of ways to do this. A cheap and easy way would be to use xev to monitor a window and then pipe the stderr to a a program that waits for a keypress event and then plays an apropriate. A less cheap way would be to have our program do what xev does instead of using a pipe. Or you could set your X keyclick using xset. Hi, thanks a lot for your replies! :) Is there any program already, which does this? A daemon or...insert missing words here Best regards, mcc Well I found out that when you pass window id to xev it does not trap keyboard presses per-sé. But there is another way... Anway the following is a quick hack (in python). It pretty much works except it also seems to trap mouse presses. I got the .wav file at http://www.soundjay.com/typewriter-sounds.html I tried using 'xset c' but it basically does nothing for me. My guess is that it does work it basically sends the a BELL to the console. --- 8 CUT HERE --- import sys import subprocess soundfile = 'typewriter-key-1.wav' def main(): window_id = sys.argv[1] cmd = ['xev', '-id', window_id] p1 = subprocess.Popen(cmd, stdout=subprocess.PIPE) while True: line = p1.stdout.readline() if line.find('atom 0x14d') -1: subprocess.Popen(['aplay', soundfile], stderr=open('/dev/null', 'w')) if __name__ == '__main__': main() Guys, this is awesome :) Let's make an ebuild and put in portage :) L: why? man xset really guys. Why do it the long, hard and stupid way if there have been simple, built in solutions for longer than some of you live? I can't achieve the same with xset :) but this solution is working very well, this is a really important project showing the power of opensource :) L:
Re: [gentoo-user] Typewriter sound
Am 18.08.2010 01:44, schrieb Albert Hopkins: On Tue, 2010-08-17 at 19:41 -0400, Albert Hopkins wrote: Here is my edit of his Python script. ... which I actually forgot to attach :| funny stuff. Unfortunately I get # ./keypress.py Traceback (most recent call last): File ./keypress.py, line 11, in module from Xlib.display import Display ImportError: No module named Xlib.display What should I emerge?? ;-) thx, s
Re: [gentoo-user] Typewriter sound
Paul Hartman paul.hartman+gen...@gmail.com [10-08-18 17:12]: On Tue, Aug 17, 2010 at 5:47 PM, meino.cra...@gmx.de wrote: By the way (the same way! ;)) I am in search of such an model m IBM-keyboard. A colleque yesterday calls me and said, that he found one for me in the PC-junk at the basement of the building he is working in. Hopefully it is one which is 1.) fully working and 2.) with german keyboard layout. Fingers crossed. Unicomp owns the patent from the original IBM/Lexmark Model M keyboards, they still make sell modern versions (with USB and Windows keys, if you want, also versions with PS/2 or without windows keys are available). And you can buy it with German configuration. You can even buy it with quiet keys, but what is the point of that?? ;) They are made in the USA but can be shipped worldwide. This is the model I have (in black with grey keys): http://pckeyboards.stores.yahoo.net/customizer.html It is the same size and weight like the old keyboards, very heavy, each key cap can be removed, it is loud clicks nicely and is very awesome. For USD$69 I think it is a bargain, I type on the computer every day and this keyboard is simply perfect to me. After using cheap $5 and $10 keyboards for so many years, now I will never go back to those. Their website is http://www.pckeyboard.com and they have other keyboard variations such as a Linux keyboard. I highly recommend it for anyone who likes a huge and loud keyboard that feels incredible. :) Hi Paul, yes, I saw the sites/homepages of both sellers before. Unfortunately shipping costs to germany is high and payment is complex. If they only would have a distributor here in germany... But with little luck, next week a colleque will give me one of those really old, sturdy, heavy, loud and WONDERFUL original IBM keyboards. Fingers crossed that is a Model M with buckling springs, german layout and all functional! Happy hacking! Best regards, mcc
Re: [gentoo-user] Typewriter sound
Paul Hartman paul.hartman+gen...@gmail.com [10-08-18 00:20]: On Tue, Aug 17, 2010 at 12:20 PM, meino.cra...@gmx.de wrote: Hi, on YouTube there was a Blender-2.5 tutorial with audio. There was an interesting detail: While there were spoken instructions one can hear one typing on its keyboard. Each hit on one of the keys made the sound of an old typewriter (no, it was not the sound of the legendary IBM Model M keyboard ;) ). How can I achieve this? I have not tried it, but a Google search showed me this: http://github.com/colszowka/linux-typewriter BTW - I have Unicomp keyboards (modern version of IBM Model M) and they are loud and awesome ;) Hi, I am still searching for a specific typewriter sound -- the one I heard in the background of the video of the blender tutorial. It sounds like a pure mechanical typewriter. And it sounds like one is typeing onto a paper, which was put into the typewriter with a little gap between the paper and the rubber platen roller (hopefully I got these words right...), so each hit onto one of the keys is followed with a little PENG! (or should I call it BANG!) when the type hits the paper and hammers it against the roller. Little literarty shoots somehow. The incarnation of rhetorical power in some way...;) Does someone know of more typewrite sounds? I searched the net and found another source but the sound wasn't there... Keep hacking! Best regards, mcc
Re: [gentoo-user] Typewriter sound
Albert Hopkins mar...@letterboxes.org [10-08-18 04:16]: On Tue, 2010-08-17 at 19:41 -0400, Albert Hopkins wrote: Here is my edit of his Python script. ... which I actually forgot to attach :| -a #!/usr/bin/env python ## A tiny, nifty script for playing musical notes on each keypress. ## ## Copyright Sayan Riju Chakrabarti (sayanriju) 2009 ## me[at]sayanriju[dot]co[dot]cc ## ## Released under WTFPL Version 2 ## (DO WHAT THE FUCK YOU WANT TO PUBLIC LICENSE) ## Copy of license text can be found online at ## http://sam.zoy.org/wtfpl/COPYING ## http://rants.sayanriju.co.cc/script-to-make-tick-tick-sound-on-keypress from Xlib.display import Display import subprocess import time KEYPRESSFILE = 'typewriter-key-1.wav' RETURNFILE = 'typewriter-line-break-1.wav' notes=[440,494,523,587,659,698,784] ZERO,SHIFT,ALT,CTL=[],[],[],[] ENTER = [0, 0, 0, 0, 16, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0] for i in range(0,32): ZERO.append(0) if i==6: SHIFT.append(4) else: SHIFT.append(0) if i==4: CTL.append(32) else: CTL.append(0) if i==8: ALT.append(1) else: ALT.append(0) ignorelist=[ZERO,ALT,SHIFT,CTL] def main(): disp = Display()# connect to display while 1:#event loop keymap = disp.query_keymap() if keymap not in ignorelist: filename = RETURNFILE if keymap == ENTER else KEYPRESSFILE subprocess.Popen(['aplay', filename], stderr=open('/dev/null', 'w')) time.sleep(0.1) if __name__ == '__main__': main() Hi, I checked the script -- it works :) But it is to slow (my computer is to slow, I am too fast?) I can press twice the number of keys which got sounded by the script. Or is something wrong with the setup of my sound interface? My computer is a Athlon XP2 64 (32 bit Gentoo) 3800+, so I think, that it is not /that/ slow :) Any ideas? Best regards, mcc
Re: [gentoo-user] Typewriter sound
On Wed, 2010-08-18 at 18:20 +0200, meino.cra...@gmx.de wrote: I checked the script -- it works :) But it is to slow (my computer is to slow, I am too fast?) I can press twice the number of keys which got sounded by the script. Or is something wrong with the setup of my sound interface? My computer is a Athlon XP2 64 (32 bit Gentoo) 3800+, so I think, that it is not /that/ slow :) Any ideas? Best regards, mcc I can't say. It works fine on the two machines I tested on (not super-fast machines but modern). -a
Re: [gentoo-user] Typewriter sound
Am 18.08.2010 17:10, schrieb Peter Ruskin: python-xlib thank you, works now, it's fun (for a while ... ;-) ) S
[gentoo-user] Typewriter sound
Hi, on YouTube there was a Blender-2.5 tutorial with audio. There was an interesting detail: While there were spoken instructions one can hear one typing on its keyboard. Each hit on one of the keys made the sound of an old typewriter (no, it was not the sound of the legendary IBM Model M keyboard ;) ). How can I achieve this? What software can I use to make this geeky feature to come true. Unfortunately I have no idea, how to name this kind of what(?) ... Thank you very much for any hint in advance! Best regards, mcc
Re: [gentoo-user] Typewriter sound
On Tue, 2010-08-17 at 19:20 +0200, meino.cra...@gmx.de wrote: Hi, on YouTube there was a Blender-2.5 tutorial with audio. There was an interesting detail: While there were spoken instructions one can hear one typing on its keyboard. Each hit on one of the keys made the sound of an old typewriter (no, it was not the sound of the legendary IBM Model M keyboard ;) ). How can I achieve this? What software can I use to make this geeky feature to come true. Unfortunately I have no idea, how to name this kind of what(?) ... Thank you very much for any hint in advance! Best regards, mcc There probably a number of ways to do this. A cheap and easy way would be to use xev to monitor a window and then pipe the stderr to a a program that waits for a keypress event and then plays an apropriate. A less cheap way would be to have our program do what xev does instead of using a pipe.
Re: [gentoo-user] Typewriter sound
On 08/17/2010 10:56 AM, Albert Hopkins wrote: On Tue, 2010-08-17 at 19:20 +0200, meino.cra...@gmx.de wrote: Hi, on YouTube there was a Blender-2.5 tutorial with audio. There was an interesting detail: While there were spoken instructions one can hear one typing on its keyboard. Each hit on one of the keys made the sound of an old typewriter (no, it was not the sound of the legendary IBM Model M keyboard ;) ). How can I achieve this? What software can I use to make this geeky feature to come true. Unfortunately I have no idea, how to name this kind of what(?) ... Thank you very much for any hint in advance! Best regards, mcc There probably a number of ways to do this. A cheap and easy way would be to use xev to monitor a window and then pipe the stderr to a a program that waits for a keypress event and then plays an apropriate. A less cheap way would be to have our program do what xev does instead of using a pipe. Or you could set your X keyclick using xset.
Re: [gentoo-user] Typewriter sound
Bill Longman bill.long...@gmail.com [10-08-17 20:16]: On 08/17/2010 10:56 AM, Albert Hopkins wrote: On Tue, 2010-08-17 at 19:20 +0200, meino.cra...@gmx.de wrote: Hi, on YouTube there was a Blender-2.5 tutorial with audio. There was an interesting detail: While there were spoken instructions one can hear one typing on its keyboard. Each hit on one of the keys made the sound of an old typewriter (no, it was not the sound of the legendary IBM Model M keyboard ;) ). How can I achieve this? What software can I use to make this geeky feature to come true. Unfortunately I have no idea, how to name this kind of what(?) ... Thank you very much for any hint in advance! Best regards, mcc There probably a number of ways to do this. A cheap and easy way would be to use xev to monitor a window and then pipe the stderr to a a program that waits for a keypress event and then plays an apropriate. A less cheap way would be to have our program do what xev does instead of using a pipe. Or you could set your X keyclick using xset. Hi, thanks a lot for your replies! :) Is there any program already, which does this? A daemon or...insert missing words here Best regards, mcc
Re: [gentoo-user] Typewriter sound
On Tue, 2010-08-17 at 20:43 +0200, meino.cra...@gmx.de wrote: Bill Longman bill.long...@gmail.com [10-08-17 20:16]: On 08/17/2010 10:56 AM, Albert Hopkins wrote: On Tue, 2010-08-17 at 19:20 +0200, meino.cra...@gmx.de wrote: Hi, on YouTube there was a Blender-2.5 tutorial with audio. There was an interesting detail: While there were spoken instructions one can hear one typing on its keyboard. Each hit on one of the keys made the sound of an old typewriter (no, it was not the sound of the legendary IBM Model M keyboard ;) ). How can I achieve this? What software can I use to make this geeky feature to come true. Unfortunately I have no idea, how to name this kind of what(?) ... Thank you very much for any hint in advance! Best regards, mcc There probably a number of ways to do this. A cheap and easy way would be to use xev to monitor a window and then pipe the stderr to a a program that waits for a keypress event and then plays an apropriate. A less cheap way would be to have our program do what xev does instead of using a pipe. Or you could set your X keyclick using xset. Hi, thanks a lot for your replies! :) Is there any program already, which does this? A daemon or...insert missing words here Best regards, mcc Well I found out that when you pass window id to xev it does not trap keyboard presses per-sé. But there is another way... Anway the following is a quick hack (in python). It pretty much works except it also seems to trap mouse presses. I got the .wav file at http://www.soundjay.com/typewriter-sounds.html I tried using 'xset c' but it basically does nothing for me. My guess is that it does work it basically sends the a BELL to the console. --- 8 CUT HERE --- import sys import subprocess soundfile = 'typewriter-key-1.wav' def main(): window_id = sys.argv[1] cmd = ['xev', '-id', window_id] p1 = subprocess.Popen(cmd, stdout=subprocess.PIPE) while True: line = p1.stdout.readline() if line.find('atom 0x14d') -1: subprocess.Popen(['aplay', soundfile], stderr=open('/dev/null', 'w')) if __name__ == '__main__': main()
Re: [gentoo-user] Typewriter sound
On Tuesday 17 August 2010 20:34:05 Albert Hopkins wrote: On Tue, 2010-08-17 at 20:43 +0200, meino.cra...@gmx.de wrote: Bill Longman bill.long...@gmail.com [10-08-17 20:16]: On 08/17/2010 10:56 AM, Albert Hopkins wrote: On Tue, 2010-08-17 at 19:20 +0200, meino.cra...@gmx.de wrote: Hi, on YouTube there was a Blender-2.5 tutorial with audio. There was an interesting detail: While there were spoken instructions one can hear one typing on its keyboard. Each hit on one of the keys made the sound of an old typewriter (no, it was not the sound of the legendary IBM Model M keyboard ;) ). How can I achieve this? What software can I use to make this geeky feature to come true. Unfortunately I have no idea, how to name this kind of what(?) ... Thank you very much for any hint in advance! Best regards, mcc There probably a number of ways to do this. A cheap and easy way would be to use xev to monitor a window and then pipe the stderr to a a program that waits for a keypress event and then plays an apropriate. A less cheap way would be to have our program do what xev does instead of using a pipe. Or you could set your X keyclick using xset. Hi, thanks a lot for your replies! :) Is there any program already, which does this? A daemon or...insert missing words here Best regards, mcc Well I found out that when you pass window id to xev it does not trap keyboard presses per-sé. But there is another way... Anway the following is a quick hack (in python). It pretty much works except it also seems to trap mouse presses. I got the .wav file at http://www.soundjay.com/typewriter-sounds.html I tried using 'xset c' but it basically does nothing for me. My guess is that it does work it basically sends the a BELL to the console. --- 8 CUT HERE --- import sys import subprocess soundfile = 'typewriter-key-1.wav' def main(): window_id = sys.argv[1] cmd = ['xev', '-id', window_id] p1 = subprocess.Popen(cmd, stdout=subprocess.PIPE) while True: line = p1.stdout.readline() if line.find('atom 0x14d') -1: subprocess.Popen(['aplay', soundfile], stderr=open('/dev/null', 'w')) if __name__ == '__main__': main() xset b on or xset c on do not work here either. -- Regards, Mick signature.asc Description: This is a digitally signed message part.
Re: [gentoo-user] Typewriter sound
On Tue, Aug 17, 2010 at 12:20 PM, meino.cra...@gmx.de wrote: Hi, on YouTube there was a Blender-2.5 tutorial with audio. There was an interesting detail: While there were spoken instructions one can hear one typing on its keyboard. Each hit on one of the keys made the sound of an old typewriter (no, it was not the sound of the legendary IBM Model M keyboard ;) ). How can I achieve this? I have not tried it, but a Google search showed me this: http://github.com/colszowka/linux-typewriter BTW - I have Unicomp keyboards (modern version of IBM Model M) and they are loud and awesome ;)
Re: [gentoo-user] Typewriter sound
Paul Hartman paul.hartman+gen...@gmail.com [10-08-18 00:20]: On Tue, Aug 17, 2010 at 12:20 PM, meino.cra...@gmx.de wrote: Hi, on YouTube there was a Blender-2.5 tutorial with audio. There was an interesting detail: While there were spoken instructions one can hear one typing on its keyboard. Each hit on one of the keys made the sound of an old typewriter (no, it was not the sound of the legendary IBM Model M keyboard ;) ). How can I achieve this? I have not tried it, but a Google search showed me this: http://github.com/colszowka/linux-typewriter BTW - I have Unicomp keyboards (modern version of IBM Model M) and they are loud and awesome ;) Hi, thanks a lot for all your help! :) I will try it out all ! :)) By the way (the same way! ;)) I am in search of such an model m IBM-keyboard. A colleque yesterday calls me and said, that he found one for me in the PC-junk at the basement of the building he is working in. Hopefully it is one which is 1.) fully working and 2.) with german keyboard layout. Fingers crossed. Currently I am using a Cherry MX 1000 G80 keyboard -- since 15 years now without any kind misfunctional behaviour (I mean: the keyboard shows no misfunction... ;). It is one with a big roung AT-connector (pre PS2-era). The typewriter sound project is just kind of joke: I am imaging the face of people on the phone, when I say: Oh, wait a moment...I will look into the database... and then: clack, clackclack, clack, clackclackclack -- they will here a typewriter grin. Happy hacking! best regards, mcc PS: Here is a nice description of the buckling spring mechanism in action: http://www.plope.com/Members/chrism/25_years_of_the_model_m
Re: [gentoo-user] Typewriter sound
On 08/17/2010 02:44 PM, Mick wrote: On Tuesday 17 August 2010 20:34:05 Albert Hopkins wrote: On Tue, 2010-08-17 at 20:43 +0200, meino.cra...@gmx.de wrote: Bill Longman bill.long...@gmail.com [10-08-17 20:16]: On 08/17/2010 10:56 AM, Albert Hopkins wrote: On Tue, 2010-08-17 at 19:20 +0200, meino.cra...@gmx.de wrote: Hi, on YouTube there was a Blender-2.5 tutorial with audio. There was an interesting detail: While there were spoken instructions one can hear one typing on its keyboard. Each hit on one of the keys made the sound of an old typewriter (no, it was not the sound of the legendary IBM Model M keyboard ;) ). How can I achieve this? What software can I use to make this geeky feature to come true. Unfortunately I have no idea, how to name this kind of what(?) ... Thank you very much for any hint in advance! Best regards, mcc There probably a number of ways to do this. A cheap and easy way would be to use xev to monitor a window and then pipe the stderr to a a program that waits for a keypress event and then plays an apropriate. A less cheap way would be to have our program do what xev does instead of using a pipe. Or you could set your X keyclick using xset. Hi, thanks a lot for your replies! :) Is there any program already, which does this? A daemon or...insert missing words here Best regards, mcc Well I found out that when you pass window id to xev it does not trap keyboard presses per-sé. But there is another way... Anway the following is a quick hack (in python). It pretty much works except it also seems to trap mouse presses. I got the .wav file at http://www.soundjay.com/typewriter-sounds.html I tried using 'xset c' but it basically does nothing for me. My guess is that it does work it basically sends the a BELL to the console. My thinking was that you could enable the system bell through the sound system (there's a kernel setting for it) and then just change the sound to whatever the typewriter sound is. Kinda cruddy, but it might be worth trying
Re: [gentoo-user] Typewriter sound
On Tue, 2010-08-17 at 17:14 -0500, Paul Hartman wrote: I have not tried it, but a Google search showed me this: http://github.com/colszowka/linux-typewriter BTW - I have Unicomp keyboards (modern version of IBM Model M) and they are loud and awesome ;) This is a weird script. It's a ruby script that creates a web server, but the web server listens for... It runs a python script that uses python-xlib to listen for key presses, and when a key is pressed it uses curl to open the connection to the ruby script.. when the ruby script receives a request it plays a sound. So really it's the Python script that's doing all the work... If you can just try downloading the python script[1] and replacing 'curl http://localhost:4567/key' with 'aplay myfile.wav' [1] http://github.com/colszowka/linux-typewriter/blob/master/bin/keypress.py
Re: [gentoo-user] Typewriter sound
On Tue, 2010-08-17 at 19:17 -0400, Albert Hopkins wrote: This is a weird script. It's a ruby script that creates a web server, but the web server listens for... It runs a python script that uses python-xlib to listen for key presses, and when a key is pressed it uses curl to open the connection to the ruby script.. when the ruby script receives a request it plays a sound. So really it's the Python script that's doing all the work... If you can just try downloading the python script[1] and replacing 'curl http://localhost:4567/key' with 'aplay myfile.wav' [1] http://github.com/colszowka/linux-typewriter/blob/master/bin/keypress.py Here is my edit of his Python script. Basically the original author was making the wrong Python call to call aplay and, instead of looking up the documentation, he decided to create a ruby script that creates a web server to he can connect to it and play audio files :S Anyway this version seems to work for me. I modified it a bit to play a different file when the ENTER key is pressed and to mask aplay's output. Again, I acquired the wav files from: http://www.soundjay.com/typewriter-sounds.html -a
Re: [gentoo-user] Typewriter sound
On Tue, 2010-08-17 at 19:41 -0400, Albert Hopkins wrote: Here is my edit of his Python script. ... which I actually forgot to attach :| -a #!/usr/bin/env python ## A tiny, nifty script for playing musical notes on each keypress. ## ## Copyright Sayan Riju Chakrabarti (sayanriju) 2009 ## me[at]sayanriju[dot]co[dot]cc ## ## Released under WTFPL Version 2 ## (DO WHAT THE FUCK YOU WANT TO PUBLIC LICENSE) ## Copy of license text can be found online at ## http://sam.zoy.org/wtfpl/COPYING ## http://rants.sayanriju.co.cc/script-to-make-tick-tick-sound-on-keypress from Xlib.display import Display import subprocess import time KEYPRESSFILE = 'typewriter-key-1.wav' RETURNFILE = 'typewriter-line-break-1.wav' notes=[440,494,523,587,659,698,784] ZERO,SHIFT,ALT,CTL=[],[],[],[] ENTER = [0, 0, 0, 0, 16, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0] for i in range(0,32): ZERO.append(0) if i==6: SHIFT.append(4) else: SHIFT.append(0) if i==4: CTL.append(32) else: CTL.append(0) if i==8: ALT.append(1) else: ALT.append(0) ignorelist=[ZERO,ALT,SHIFT,CTL] def main(): disp = Display()# connect to display while 1:#event loop keymap = disp.query_keymap() if keymap not in ignorelist: filename = RETURNFILE if keymap == ENTER else KEYPRESSFILE subprocess.Popen(['aplay', filename], stderr=open('/dev/null', 'w')) time.sleep(0.1) if __name__ == '__main__': main()
Re: [gentoo-user] Typewriter sound
On Tue, Aug 17, 2010 at 5:47 PM, meino.cra...@gmx.de wrote: By the way (the same way! ;)) I am in search of such an model m IBM-keyboard. A colleque yesterday calls me and said, that he found one for me in the PC-junk at the basement of the building he is working in. Hopefully it is one which is 1.) fully working and 2.) with german keyboard layout. Fingers crossed. Unicomp owns the patent from the original IBM/Lexmark Model M keyboards, they still make sell modern versions (with USB and Windows keys, if you want, also versions with PS/2 or without windows keys are available). And you can buy it with German configuration. You can even buy it with quiet keys, but what is the point of that?? ;) They are made in the USA but can be shipped worldwide. This is the model I have (in black with grey keys): http://pckeyboards.stores.yahoo.net/customizer.html It is the same size and weight like the old keyboards, very heavy, each key cap can be removed, it is loud clicks nicely and is very awesome. For USD$69 I think it is a bargain, I type on the computer every day and this keyboard is simply perfect to me. After using cheap $5 and $10 keyboards for so many years, now I will never go back to those. Their website is http://www.pckeyboard.com and they have other keyboard variations such as a Linux keyboard. I highly recommend it for anyone who likes a huge and loud keyboard that feels incredible. :)
Re: [gentoo-user] Typewriter sound
Paul Hartman wrote: On Tue, Aug 17, 2010 at 5:47 PM,meino.cra...@gmx.de wrote: By the way (the same way! ;)) I am in search of such an model m IBM-keyboard. A colleque yesterday calls me and said, that he found one for me in the PC-junk at the basement of the building he is working in. Hopefully it is one which is 1.) fully working and 2.) with german keyboard layout. Fingers crossed. Unicomp owns the patent from the original IBM/Lexmark Model M keyboards, they still make sell modern versions (with USB and Windows keys, if you want, also versions with PS/2 or without windows keys are available). And you can buy it with German configuration. You can even buy it with quiet keys, but what is the point of that?? ;) They are made in the USA but can be shipped worldwide. This is the model I have (in black with grey keys): http://pckeyboards.stores.yahoo.net/customizer.html It is the same size and weight like the old keyboards, very heavy, each key cap can be removed, it is loud clicks nicely and is very awesome. For USD$69 I think it is a bargain, I type on the computer every day and this keyboard is simply perfect to me. After using cheap $5 and $10 keyboards for so many years, now I will never go back to those. Their website is http://www.pckeyboard.com and they have other keyboard variations such as a Linux keyboard. I highly recommend it for anyone who likes a huge and loud keyboard that feels incredible. :) I think I got a old IBM AT/XT keyboard out in my shop. It has the wrong connector tho. Those things are pretty loud. You are right, they are heavy tho. Hmmm, could buy a adapter I guess. Oh, I threw out the old 14 hard drives a while back. I had two of those too. o_O Dale :-) :-)