Jump to content
Sign in to follow this  
AutoProgramming

[BEEP] ProMusiX

Recommended Posts

AutoProgramming

Hey,

this is my first script that I am sharing, but I think it is quite usefull :)

How does it work?

Well, first you compose your music, using the notes from c up to cc (c, d, e, f, g, a, h [=b], cc)

song=c;d;e;f;g;g;a;a;a;a;g;a;a;a;a;g;f;f;f;f;e;e;d;d;d;d;c
leng=1;1;1;1;1.5;1.5;1;1;1;1;2;1;1;1;1;2;1;1;1;1;1.5;1.5;1;1;1;1;2

Then you run the script.

Source Codes

frequ.ini

[basic]
c=523.251138958747
d=587.329551469869
e=659.255138395397
f=698.456492615316
g=783.990913704086
a=880.000056222671
h=987.766676138032
cc=1046.5023447779

songs.ini

[songs]
song=c;d;e;f;g;g;a;a;a;a;g;a;a;a;a;g;f;f;f;f;e;e;d;d;d;d;c
leng=1;1;1;1;1.5;1.5;1;1;1;1;2;1;1;1;1;2;1;1;1;1;1.5;1.5;1;1;1;1;2

proMusiX.au3

#cs
                             _____             .______  ___
    _____________  ____  /   \  __ __  _____|__\   \/  /
    \____ \_  __ \/  _ \   /  \ /  \|  |  \/  ___/  |\   / 
    |  |_> >  | \(  <_> ) / Y   \  |  /\___ \|  |/   \ 
    |   __/|__|   \____/  \____|__  /____//____  >__/___/\  \
    |__|                          \/           \/        \_/
    
    by AutoProgramming aka Agraf!x
    Version 1.0
#ce

#include<Array.au3>

#cs
Main Programm
#ce
; Parse Songs.ini
$song = IniRead("songs.ini", "songs", "song", "c;d;e")
$leng = IniRead("songs.ini", "songs", "leng", "1;2;3")

; Explode
$aParts = StringSplit($song, ";")
$aLeng = StringSplit($leng, ";")

For $i = 1 To UBound($aParts)
    _PlayTune($aParts[$i], $aLeng[$i]*1000)
Next

#cs
Functions
#ce
; Installation
Func _Install()
    FileInstall("frequ.ini", "frequ.ini")
    FileInstall("songs.ini", "songs.ini")
EndFunc

; Play a Note
Func _PlayTune($tune, $length=1000) 
    $freq = IniRead("frequ.ini", "basic", $tune, 440)
    Sleep(200)
    Beep($freq, $length)
EndFunc

Download

The compiled .exe: proMusiX.exe

The Source: proMusiX.au3

Greez,

AP


[u]My OpenSource Projects:[/u]- [BEEP] proMusiX- Search autorun.inf

Share this post


Link to post
Share on other sites
dryper

Autoit Error

|-------------------------------------------------------------------------------------------------------------------|

|Line-1: |

| |

|Error: Array variable has incorrect number of subscripts or subscript dimension range exceeded |

| |

|-------------------------------------------------------------------------------------------------------------------|

Share this post


Link to post
Share on other sites

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now
Sign in to follow this  

×