Page 1 of 1

Fun with pc speaker

PostPosted: Mon Aug 31, 2015 10:06 am
by Ayr3s
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

Re: Fun with pc speaker

PostPosted: Tue Sep 01, 2015 1:55 am
by pretentious
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:

Re: Fun with pc speaker

PostPosted: Wed Sep 02, 2015 1:25 pm
by ghostheadx2
what language is that?

Re: Fun with pc speaker

PostPosted: Wed Sep 02, 2015 5:22 pm
by ghost107
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

Re: Fun with pc speaker

PostPosted: Wed Sep 02, 2015 11:28 pm
by Ayr3s
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?

Re: Fun with pc speaker

PostPosted: Thu Sep 03, 2015 10:49 am
by -Ninjex-
Haha, very interesting indeed. I will be playing with this, hell maybe I'll even make my own tunes
+1