Fun with pc speaker

Share any hilarious IRC quotes, pictures, jokes, and more here!
Forum rules
- NO nudity/pornography. NO racism. NO offensive material.
- Posting these may result in warnings and/or possible ban!
- Please abide by the rules: viewtopic.php?f=126&t=4355

Fun with pc speaker

Post by Ayr3s on Mon Aug 31, 2015 10:06 am
([msg=89614]see Fun with pc speaker[/msg])

Yesterday I decided I wanted to play music with the pc speaker in my new file server, so I installed 'beep' that makes controlling the pc speaker easy. After that I just made a simple awk one-liner that reads a file containing the notes. :D

Here is the awk 'player':

Code: Select all
#!/bin/sh
awk '{print "beep -f " $1 " -l " $2}' $1 | sh


and the first song I made is the star wars theme:

Code: Select all
261     1000   C
392     1000   G
349     172     F
329     172     E
294     172     D
523     1000    C5
392     500     G
349     172     F
329     172     E
294     172     D
523     1000    C5
392     500     G
349     172     F
329     172     E
349     172     F
294     1000   D
196     250     G3
196     250     G3
261     1000    C
392     1000    G
349     172     F
329     172     E
294     172     D
523     1000    C5
392     500     G
349     172     F
329     172     E
294     172     D
523     1000    C5
392     500     G
349     172     F
329     172     E
349     172     F
294     1000    D
196     250     G3
196     250     G3
220     375     A3
220     250     A3
349     250     F
329     250     E
294     250     D
261     250     C
261     172     C
294     172     D
329     172     E
294     250     D
246     500     B3
196     250     G3
196     250     G3
220     375     A3
220     250     A3
349     250     F
329     250     E
294     250     D
261     250     C
392     500     G
294     1000   D
196     250     G3
196     250     G3
220     375     A3
220     250     A3
349     250     F
329     250     E
294     250     D
261     250     C
261     172     C
294     172     D
329     172     E
294     250     D
246     500     B3
392     250     G
392     250     G
523     250     C5
466     250     Bb
415     250     Ab
392     250     G
349     250     F
311     250     Eb
294     250     D
261     250     C


Now I want to make a simple 'compiler' to write only the note names and lenghts in a symbolic way and later convert it to this format to make writing easier.
Maybe later I'll go and make the speaker tell me info via morse code xD
User avatar
Ayr3s
New User
New User
 
Posts: 29
Joined: Mon Feb 02, 2015 2:34 pm
Blog: View Blog (0)


Re: Fun with pc speaker

Post by pretentious on Tue Sep 01, 2015 1:55 am
([msg=89617]see Re: Fun with pc speaker[/msg])

This is pretty sweet. I just installed beep and can't get any audio for some reason but I'll figure it out.
audio processing isn't something I've had much success with in the past but I just had a thought. You could get a music file, maybe remove vocals if possible and sample its frequency at x milliseconds, use like 10 different frequency thresholds and create your music tabs :)

I wonder what tamagotchi skrillex would sound like :lol:
Goatboy wrote:Oh, that's simple. All you need to do is dedicate many years of your life to studying security.

IF you feel like exchanging ASCII arrays, let me know ;)
Can you say brainwashing It's a non stop disco
User avatar
pretentious
Addict
Addict
 
Posts: 1202
Joined: Wed Mar 03, 2010 12:48 am
Blog: View Blog (0)


Re: Fun with pc speaker

Post by ghostheadx2 on Wed Sep 02, 2015 1:25 pm
([msg=89623]see Re: Fun with pc speaker[/msg])

what language is that?
ghostheadx2
Contributor
Contributor
 
Posts: 728
Joined: Wed Nov 19, 2014 1:19 am
Blog: View Blog (0)


Re: Fun with pc speaker

Post by ghost107 on Wed Sep 02, 2015 5:22 pm
([msg=89624]see Re: Fun with pc speaker[/msg])

ghostheadx2 wrote:what language is that?

Its a command language called Shell, available on linux(similar to Batch command language on windows), also try too look into bash their both scripting languages.
https://www.youtube.com/watch?v=nVt3Rst ... E693D8E790
User avatar
ghost107
Poster
Poster
 
Posts: 321
Joined: Wed Jul 02, 2008 7:57 am
Blog: View Blog (0)


Re: Fun with pc speaker

Post by Ayr3s on Wed Sep 02, 2015 11:28 pm
([msg=89627]see Re: Fun with pc speaker[/msg])

what language is that?

it is in a shell script, but all the work is actually done by awk. :)
This is pretty sweet. I just installed beep and can't get any audio for some reason but I'll figure it out.
audio processing isn't something I've had much success with in the past but I just had a thought. You could get a music file, maybe remove vocals if possible and sample its frequency at x milliseconds, use like 10 different frequency thresholds and create your music tabs :)

I wonder what tamagotchi skrillex would sound like :lol:

that sounds like it would be neat, but I'm guessing that any polyphonic part would break thigs... have you tried anything like that before?
User avatar
Ayr3s
New User
New User
 
Posts: 29
Joined: Mon Feb 02, 2015 2:34 pm
Blog: View Blog (0)


Re: Fun with pc speaker

Post by -Ninjex- on Thu Sep 03, 2015 10:49 am
([msg=89634]see Re: Fun with pc speaker[/msg])

Haha, very interesting indeed. I will be playing with this, hell maybe I'll even make my own tunes
+1
image
For those that know
K: 0x2CD8D4F9
User avatar
-Ninjex-
Moderator
Moderator
 
Posts: 1691
Joined: Sun Sep 02, 2012 8:02 pm
Blog: View Blog (0)



Return to LULZ

Who is online

Users browsing this forum: No registered users and 0 guests