Jump to content

Another beep song UPDATED!


Paulie
 Share

Recommended Posts

  • 1 month later...

What doesn't work?

Interesting that you had to ask, that makes me think something might be wrong on my end. I copied/pasted the code from the "Latest GUI" thread into Scite and hit F5 to run. I get the following error:

C:\Program Files\AutoIt3\Include\GuiListView.au3(5816,55) : ERROR: _ArraySort() called with wrong number of args.

_ArraySort($a_lv, $b_desc, 0, 0, $columns + 1, $iCol)

~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~^

C:\Program Files\AutoIt3\Include\Array.au3(883,89) : REF: definition of _ArraySort().

Func _ArraySort(ByRef $avArray, $iDescending = 0, $iStart = 0, $iEnd = 0, $iSubItem = 0)

~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~^

C:\Documents and Settings\...\test.au3 - 1 error(s), 0 warning(s)

Link to comment
Share on other sites

Interesting that you had to ask, that makes me think something might be wrong on my end. I copied/pasted the code from the "Latest GUI" thread into Scite and hit F5 to run. I get the following error:

Test the latest Release Candidate, runs fine for me :)

Edit: After fixing the includes that is

Edited by monoceres

Broken link? PM me and I'll send you the file!

Link to comment
Share on other sites

  • 1 month later...

I made the Empire's March from Star Wars =P:

#cs
Title: Empire's March
Composer: HypercamJ
Key Signature: D
#ce
Beep(554.365, 700);C#5  -  53
Beep(554.365, 700);C#5  -  53
Beep(554.365, 700);C#5  -  53
Beep(440.000, 700);A5  -  49
Beep(659.255, 250);E5  -  56
Beep(554.365, 700);C#5  -  53
Beep(440.000, 700);A5  -  49
Beep(659.255, 150);E5  -  56
Beep(554.365, 1200);C#5  -  53
Beep(830.609, 700);G#5  -  60
Beep(830.609, 700);G#5  -  60
Beep(830.609, 700);G#5  -  60
Beep(880.000, 700);A6  -  61
Beep(622.254, 150);D#5  -  55
Beep(523.251, 700);C5  -  52
Beep(440.000, 700);A5  -  49
Beep(659.255, 150);E5  -  56
Beep(554.365, 700);C#5  -  53
Beep(1108.73, 700);C#6  -  65
Beep(554.365, 500);C#5  -  53
Beep(554.365, 200);C#5  -  53
Beep(1108.73, 700);C#6  -  65
Beep(1046.50, 500);C6  -  64
Beep(987.767, 200);B6  -  63
Beep(932.328, 200);A#6  -  62
Beep(880.000, 200);A6  -  61
Beep(932.328, 500);A#6  -  62
Sleep(250);Rest
Beep(554.365, 500);C#5  -  53
Beep(739.989, 700);F#5  -  58
Beep(698.456, 700);F5  -  57
Beep(659.255, 700);E5  -  56
Beep(622.254, 350);D#5  -  55
Beep(587.330, 250);D5  -  54
Beep(622.254, 700);D#5  -  55
Sleep(250);Rest
Beep(415.305, 700);G#4  -  48
Beep(493.883, 400);B5  -  51
Beep(415.305, 250);G#4  -  48
Sleep(100);Rest
Beep(415.305, 250);G#4  -  48
Beep(659.255, 400);E5  -  56
Beep(554.365, 700);C#5  -  53
Beep(440.000, 500);A5  -  49
Beep(659.255, 200);E5  -  56
Beep(554.365, 1500);C#5  -  53

btw, about the freeze thing, I managed to unfreeze it by minimizing it to the taskbar then restoring it witout losing any data.

Prove, and I will believe...
Link to comment
Share on other sites

ummm...i have a question is it possible change the electronic or robotic sound of beep on ur software?

i am asking because i want make a little app for play acordions so...i want reply accordions sounds but that electronic sound is so ....unreal.... so if u have a advice or something to tell me.....i will heard it :)

thanks

sorry my bad english.

Link to comment
Share on other sites

  • 2 months later...

*THIS POST IS REFERENCED TO MY LAST POST READ IT FIRST*

Ok it isn´t so easy as it seems to be...

I tried to convert it, but i failed, here is what I have:

;#NoTrayIcon
Opt("MustDeclareVars",1)

; --------- SONG --------
Const $SONG = "c8 c8 d c f e p4 c8 c8 d c g f p4 c8 c8 a g f8 f8 e d g8 a8 g d e f p1" ;from song.lst
Const $BPM  = 100 ; from tempo.lst
; -----------------------

; -------- TEMPO --------
Enum $SIXTEENTH,$EIGHTH,$FOURTH,$HALF,$FULL
Dim $TEMPI[5]
$TEMPI[$FOURTH]    = 60000/$BPM        ; Delay-Time = 1minute/bpm = 60000/bpm
$TEMPI[$EIGHTH]    = $TEMPI[$FOURTH]/2
$TEMPI[$SIXTEENTH] = $TEMPI[$EIGHTH]/2
$TEMPI[$HALF]      = $TEMPI[$FOURTH]*2
$TEMPI[$FULL]      = $TEMPI[$HALF]*2

Const $TEMPI_STR[5] = _ 
[                     _ 
"16","8","4","2","1"  _ 
]
; ------------------------

; -------- NOTE ----------
Const $NOTES[12] = _
[                  _ 
"c","d",           _ 
"e","f",           _ 
"g","a",           _
"b",               _
"c+/d-","d+/e-",   _
"f+/g-","g+/a-",   _
"a+/b-"            _ ; b = real(h)
] 

Const $FREQUENCIES[12] = _ 
[                        _
1046.50,1174.66,         _
1318.51,1396.91,         _
1567.98,1760.00,         _
1975.53,                 _
1108.73,1244.51,         _
1479.98,1661.22,         _
1864.66                  _
]
; ------------------------

main()
Func main()
    Local $splitted,$line,$octave
    
    $octave = 0
    $splitted = StringSplit($SONG," ")
    For $i=1 To $splitted[0] Step 1
        
        $line = $splitted[$i]
        Switch StringLeft($line,1)
            
            Case "<"
                $octave -= 2
            
            Case ">"
                $octave += 2
             
            Case "p"
                ConsoleWrite("Sleep("&parseTempo($line,1)&")"&@CRLF)
                
            Case "m"
                If StringRight($line,1) == "l" Then
                    ConsoleWrite("Staccato start"&@CRLF)
                Else
                    ConsoleWrite("Staccato end"&@CRLF)
                EndIf
                
            Case Else
                
                parseLine($line,$octave)

        EndSwitch
    Next
EndFunc

Func parseLine($line,$octave)
    Local $punctuation,$halfnote,$tempo,$frequency
    
    If StringInStr($line,".") <> 0 Then
        $punctuation = 1.5
    Else
        $punctuation = 1
    EndIf
    
    If StringInStr($line,"+") <> 0 Then
        $halfnote = "+"
    ElseIf StringInStr($line,"-") <> 0 then
        $halfnote = "-"
    Else
        $halfnote = ""
    EndIf
    
    $tempo = parseTempo($line,$punctuation)
    $frequency = parseNote(StringLeft($line,1),$halfnote,$octave)
    ConsoleWrite("Beep("&$frequency&","&$tempo&")"&@CRLF)
    
EndFunc

Func parseTempo($line,$punctuation)
    Local $len
    
    $len = UBound ($TEMPI)-1
    For $i=0 To $len Step 1
        If StringInStr($line,$TEMPI_STR[$i]) <> 0 Then
            Return $punctuation*$TEMPI[$i]
        EndIf
    Next
    Return $punctuation*$TEMPI[$FOURTH]

EndFunc

Func parseNote($note,$halfnote,$octave)
    Local $len 
    
    $note &= $halfnote
    $len = UBound($NOTES)-1
    For $i=0 To $len Step 1
        If StringInStr($NOTES[$i],$note) <> 0 Then
            If $octave == 0 Then
                Return $FREQUENCIES[$i]
            ElseIf $octave > 0 Then
                Return $FREQUENCIES[$i]*$octave
            ElseIf $octave < 0 Then
                Return $FREQUENCIES[$i]/$octave
            EndIf
        EndIf
    Next
EndFunc

The only help I used is a little description from the author of this app, here it is:

CODE

> Octave up

< Octave down

. punctuation

- deeper Halfnote

+ higher Halfnote

ms Staccato start

ml Binding start

mn Staccato/Binding end

p Pause

[NOTE][HALFNOTE][TEMPO][PUNCTUATION]

Example:

C16 sixteenths C

G2 half G

G-16 sixteenths Ges

F+8 eighth Fis

The problem is that i don´t know how to solve a staccato...

and i don´t know what´s a binding.

Hope somebody can help me

Edited by bluelamp
Link to comment
Share on other sites

  • 2 months later...

Hi! Merry Xmas!

Has anyone coded any new beep music Xmas songs, by any chance?

Thanks! <g>

Hi, and Happy Holidays; belated Merry Xmas!

Thought I'd give it one last try to see if anyone had seen anything other than Deck the Halls ... even if in regular "Beep Music" and not in Paulie's great system.

Cheers!

<g>

Link to comment
Share on other sites

Hi, and Happy Holidays; belated Merry Xmas!

Thought I'd give it one last try to see if anyone had seen anything other than Deck the Halls ... even if in regular "Beep Music" and not in Paulie's great system.

Cheers!

<g>

Happy Holidays

Link to comment
Share on other sites

Happy Holidays

Likewise!! <vbg>

Well, this was painful because Paulie's GUI has never worked for me. I only realized today what it might be. I'm guessing that it might be a piano-like keyboard which outputs to _Piano.au3 beep music format (?) Anyway, I'll pursue that error later, I think, to see if that's the case.

I've spent the last long since I posted trying to figure out how to make a song in this system. I used Bleeper Music Maker as a warm up because it's so very easy to use with a keyboard that outputs to a text-file note system when saved, and since I stopped playing any instrument _decades_ ago and am very rusty <g>. I came up with God Rest Ye Merry Gentlemen. It turned out to be too hard to try to figure out how to "translate" that into Paulie-style beep music code, though. But by then I was warmed up enough to try to code this from scratch by hand straight into _Piano.au3 code. Wow, was that ever a chore and very time-consuming. Here are the results. It works even if my ear tells me it's not exactly right on every note <g>.:

#Include <_Piano.au3>

; Xmas carol:  "God Rest Ye Merry Gentlemen"
; ------------------------------------------
$i=0     ; repeats twice, as per "$i = 2", below.
Do
_40(300)
_40(375)
_47(300)
_47(300)
_45(300)
_43(300)
_42(300)
_40(300)
_38(300)
_40(300)
_42(300)
_43(300)
_45(300)
_47(750)
$i =$i+1
Until $i = 2

_R(20)

_47(300)
_48(300)
_45(300)
_47(300)
_48(300)
_50(300)
_52(300)
_47(300)
_45(300)
_43(300)
_40(300)
_42(300)
_43(300)
_45(500)

_R(20)

_43(300)
_45(300)
_47(500)
_48(300)
_47(300)
_47(300)
_45(300)
_43(300)
_42(300)
_40(500)
_43(200)
_42(200)
_40(200)
_45(500)

_R(20)

_43(300)
_45(300)
_47(300)
_48(300)
_50(300)
_52(300)
_47(300)
_45(300)
_43(300)
_42(300)
_40(1250)

Good enough for an intro that I have for a seasonal reminder I have.

Cheers! <g>

Link to comment
Share on other sites

  • 3 weeks later...

Awww i wish I could use this :) That would be so retro... I did that stuff like 25 years ago in GWBasic - even wrote a full graphical note bar system to go with it. That brings back memories...

Too bad my internal speaker hasnt worked for years. Neither of my two soundcards (cr. sb x-fi .1 gamer edition and m-audio revo 5.1) is able to convert the system beeps into any audible sound.

I stumbled upon this topic because I had this weird science-fiction idea of controlling major functions in windows by my midi keyboard and other devices. When I think about it, it should not be hard, it should even be easy, all I need is an AutoIt way to read midi signals. I'll continue searching for that then :o

... think about it... Playing C-grand for the start menu, D-grand for notepad, D-7 for wordpad, the nokia tune for opening the Nokia usb interface, the Intel tune for task manager, single low C for scrolling up, single low C# for scrolling down, etc. etc.. The possibilities seem endless :D

Well, happy music making!

(edit: just thought I could try this script in a VPC since if I remember correctly, VPC emulates the internal system speaker to the sound card (and/or DirectX driver?) of the host operating system. That might work?!)

Edited by SadBunny

Roses are FF0000, violets are 0000FF... All my base are belong to you.

Link to comment
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
 Share

  • Recently Browsing   0 members

    • No registered users viewing this page.
×
×
  • Create New...