[Script] Greensleeves intro... silly beep stuff

Post your working scripts, libraries and tools for AHK v1.1 and older
heathen
Posts: 5
Joined: 08 Nov 2020, 22:37

[Script] Greensleeves intro... silly beep stuff

08 Nov 2020, 22:41

Code: Select all

GreenSleevesIntro()
{
	BPM := 120.0
	MSPM := 60000.0
	BeatsPerMeasure := 6.0
	Beat := 8.0 ; Which note gets the beat
	WholeNote := MSPM / BPM * Beat
	Quarter:=WholeNote/4.0
	Half:=WholeNote/2.0
	Whole:=WholeNote/1.0
	Eighth:=WholeNote/8.0
	Sixteenth:=WholeNote/16.0
	Thirtysecond:=WholeNote/32.0
	Sixtyfourth:=WholeNote/64.0
	Sleep Quarter
	SoundBeep, 220, Eighth					; A3
	SoundBeep, 261.63, Quarter				; C4
	SoundBeep, 293.66, Eighth				; D4
	SoundBeep, 329.63, Eighth+Sixteenth		; E4
	SoundBeep, 349.23, Sixteenth			; F4
	SoundBeep, 329.63, Eighth				; E4
	SoundBeep, 293.66, Quarter				; D4
	SoundBeep, 220, Eighth					; A3
	SoundBeep, 196.00, Eighth+Sixteenth		; G3
	SoundBeep, 220, Sixteenth				; A3
	SoundBeep, 246.94, Eighth				; B3
	SoundBeep, 261.63, Quarter				; C4
	SoundBeep, 220, Eighth					; A3
	SoundBeep, 220, Eighth+Sixteenth		; A3
	SoundBeep, 207.65, Sixteenth			; G#3
	SoundBeep, 220, Eighth					; A3
	SoundBeep, 246.94, Quarter				; B3
	SoundBeep, 207.65, Eighth				; G#3
	SoundBeep, 164.81, Quarter				; E3
	SoundBeep, 220, Eighth					; A3
	SoundBeep, 261.63, Quarter				; C4
	SoundBeep, 293.66, Eighth				; D4
	SoundBeep, 329.63, Eighth+Sixteenth		; E4
	SoundBeep, 349.23, Sixteenth			; F4
	SoundBeep, 329.63, Eighth				; E4
	SoundBeep, 293.66, Quarter				; D4
	SoundBeep, 246.94, Eighth				; B3
	SoundBeep, 196.00, Eighth+Sixteenth		; G3
	SoundBeep, 220, Sixteenth				; A3
	SoundBeep, 246.94, Eighth				; B3
	SoundBeep, 261.63, Eighth+Sixteenth		; C4
	SoundBeep, 246.94, Sixteenth			; B3
	SoundBeep, 220, Eighth					; A3
	SoundBeep, 207.65, Eighth+Sixteenth		; G#3
	SoundBeep, 174.61, Sixteenth			; F3
	SoundBeep, 196, Eighth					; G3
	SoundBeep, 220, Quarter					; A3
	SoundBeep, 220, Eighth					; A3
	SoundBeep, 220, Quarter+Eighth			; A3
}
robodesign
Posts: 935
Joined: 30 Sep 2017, 03:59
Location: Romania
Contact:

Re: [Script] Greensleeves intro... silly beep stuff

09 Nov 2020, 13:54

wow, awesome, dude!

Can you cover more songs? Fur Elise.... or... Nocturne?

Best regards, Marius.
-------------------------
KeyPress OSD v4: GitHub or forum. (presentation video)
Quick Picto Viewer: GitHub or forum.
AHK GDI+ expanded / compilation library (on GitHub)
My home page.
User avatar
SpeedMaster
Posts: 494
Joined: 12 Nov 2016, 16:09

Re: [Script] Greensleeves intro... silly beep stuff

06 Mar 2021, 15:24

robodesign wrote:
09 Nov 2020, 13:54
Can you cover more songs? Fur Elise.... or... Nocturne?
:D FurElise()

Code: Select all

FurElise()

FurElise() {
Soundbeep, 1329, 214
Soundbeep, 1175, 214
Soundbeep, 1329, 214
Soundbeep, 1175, 214
Soundbeep, 1329, 214
Soundbeep, 988, 214
Soundbeep, 1175, 214
Soundbeep, 1047, 214
Soundbeep, 880, 643
Soundbeep, 523, 214
Soundbeep, 659, 214
Soundbeep, 880, 214
Soundbeep, 988, 643
Soundbeep, 659, 214
Soundbeep, 784, 214
Soundbeep, 988, 214
Soundbeep, 1047, 643
Soundbeep, 659, 214
Soundbeep, 1329, 214
Soundbeep, 1175, 214
Soundbeep, 1329, 214
Soundbeep, 1175, 214
Soundbeep, 1329, 214
Soundbeep, 988, 214
Soundbeep, 1175, 214
Soundbeep, 1047, 214
Soundbeep, 880, 643
Soundbeep, 523, 214
Soundbeep, 659, 214
Soundbeep, 880, 214
Soundbeep, 988, 643
Soundbeep, 659, 214
Soundbeep, 1047, 214
Soundbeep, 988, 214
Soundbeep, 880, 643
Soundbeep, 988, 214
Soundbeep, 1047, 214
Soundbeep, 1175, 214
Soundbeep, 1329, 643
Soundbeep, 784, 214
Soundbeep, 1397, 214
Soundbeep, 1329, 214
Soundbeep, 1175, 643
Soundbeep, 699, 214
Soundbeep, 1329, 214
Soundbeep, 1175, 214
Soundbeep, 1047, 643
Soundbeep, 659, 214
Soundbeep, 1175, 214
Soundbeep, 1047, 214
Soundbeep, 988, 429
Soundbeep, 659, 214
Soundbeep, 659, 214
Soundbeep, 1329, 214
Soundbeep, 659, 214
Soundbeep, 1329, 214
Soundbeep, 1329, 214
Soundbeep, 659, 214
Soundbeep, 1175, 214
Soundbeep, 1329, 214
Soundbeep, 1175, 214
Soundbeep, 1329, 214
Soundbeep, 1175, 214
Soundbeep, 1329, 214
Soundbeep, 1175, 214
Soundbeep, 1329, 214
Soundbeep, 1175, 214
Soundbeep, 1329, 214
Soundbeep, 1175, 214
Soundbeep, 1329, 214
Soundbeep, 988, 214
Soundbeep, 1175, 214
Soundbeep, 1047, 214
Soundbeep, 880, 643
Soundbeep, 523, 214
Soundbeep, 659, 214
Soundbeep, 880, 214
Soundbeep, 988, 643
Soundbeep, 659, 214
Soundbeep, 1047, 214
Soundbeep, 988, 214
Soundbeep, 880, 857
}

robodesign
Posts: 935
Joined: 30 Sep 2017, 03:59
Location: Romania
Contact:

Re: [Script] Greensleeves intro... silly beep stuff

06 Mar 2021, 16:58

Wow. Very nice!

Is there a way to get it play in the background? Like when I open a window. I tried this and it stalls until the song ends... I'd like to have such a tune play when users open the "about" panel in my image viewer.


Best regards, Marius.
-------------------------
KeyPress OSD v4: GitHub or forum. (presentation video)
Quick Picto Viewer: GitHub or forum.
AHK GDI+ expanded / compilation library (on GitHub)
My home page.
User avatar
kunkel321
Posts: 1194
Joined: 30 Nov 2015, 21:19

Re: [Script] Greensleeves intro... silly beep stuff

14 Jun 2023, 14:50

Strangely, this script used to play correctly (correct tempo/speed). Today it is really slow on my Win 10 computer, opened in SciTE.

Great script by the way.... Someone should do Unchained Melody.
ste(phen|ve) kunkel
User avatar
kunkel321
Posts: 1194
Joined: 30 Nov 2015, 21:19

Re: [Script] Greensleeves intro... silly beep stuff

28 Jun 2023, 15:41

I asked ChatGPT to recreate this script. It's the first time that it's given me working code--so that's cool. I thought the setup, with the arrays and the loop, was pretty smart. There probably should be two different 'duration' arrays, though. One for beep and one for sleep.

Unfortunately, the tune doesn't really sounds much like Greensleeves. I tried Unchained Melody and Never Gonna Give You Up also. They also didn't sound correct.

Code: Select all

; ChatGPT, Greensleeves.
; Define the beep durations in milliseconds
beepDurations := [200, 200, 200, 200, 200, 400, 200, 200, 200, 200, 200, 400, 200, 200, 200, 400, 600, 200, 200, 200, 200, 200, 400, 200, 200, 200, 200, 200, 400, 200, 200, 200, 400, 600]

; Define the frequencies of each beep
beepFrequencies := [659, 587, 523, 440, 392, 392, 440, 523, 659, 784, 698, 659, 587, 523, 440, 523, 659, 587, 523, 440, 392, 392, 440, 523, 659, 587, 523, 440, 523, 659, 784, 698, 659]

; Loop through the arrays and play the beeps
Loop % beepDurations.Length()
{
    duration := beepDurations[A_Index]
    frequency := beepFrequencies[A_Index]
    SoundBeep, %frequency%, %duration%
    Sleep, %duration%
}
ste(phen|ve) kunkel

Return to “Scripts and Functions (v1)”

Who is online

Users browsing this forum: No registered users and 146 guests