AutoHotkey Community

It is currently May 27th, 2012, 7:33 am

All times are UTC [ DST ]




Post new topic Reply to topic  [ 5 posts ] 

What does this sound like to you?
Alien code
Rabbits
Wierd music
Techno.
You may select 1 option

View results
Author Message
PostPosted: July 2nd, 2006, 7:17 am 
Offline

Joined: January 20th, 2006, 4:48 am
Posts: 29
Location: Colorado, USA
I can never be on one topic.
Must make new code! :shock:
Interesting (music? code? etc.) based on the fibbonacci rabbit sequence (see code for website)

Not entirely my idea though. See the site for their quicktime version.

I made up the speed/volume increase and (pseudo)randomness.

Code:
beeps=
(join
"10110101101101011010110110101101101011010110110101101
01101101011011010110101101101011011010110101101101011010110110101101
10101101011011010110101101101011011010110101101101011011010110101101
10101101011011010110110101101011011010110110101101011011010110101101
10101101101011010110110101101011011010110110101101011011010110110101
10101101101011010110110101101101011010110110101101011011010110110101
10101101101011011010110101101101011010110110101101101011010110110101
10110101101011011010110101101101011011010110101101101011010110110101
10110101101011011010110110101101011011010110101101101011011010110101
10110101101101011010110110101101011011010110110101101011011010110101
10110101101101011010110110101101101011010110110101101011011010110110
10110101101101011010110110101101101011010110110101101101011010110110
10110101101101011011010110101101101011011010110101101101011010110110
10110110101101011011010110101101101011011010110101101101011011010110
10110110101101011011010110110101101011011010110101101101011011010110
10110110101101101011010110110101101011011010110110101101011011010110
11010110101101101011010110110101101101011010110110101101011011010110
11010110101101101011011010110101101101011010110110101101101011010110
11010110110101101011011010110101101101011011010110101101101011010110
11010110110101101011011010110110101101011011010110101101101011011010
11010110110101101011011010110110101101011011010110110101101011011010
11010110110101101101011010110110101101101011010110110101101011011010
11011010110101101101011010110110101101101011010110110101101101011010
11011010110101101101011011010110101101101011011010110101101101011010
11011010110110101101011011010110101101101011011010110101101101011011
01011010110110101101011011010110110101101011011010110101101101011011
01011010110110101101101011010110110101101011011010110110101101011011
01011011010110101101101011010110110101101101011010110110101101011011
01011011010110101101101011011010110101101101011010110110101101101011
0101101101011010110110101101101011010110110"
)

;fibbonacci rabbit sequence (never repeats! just like PHI) READ MORE: http://www.mcs.surrey.ac.uk/Personal/R.Knott/Fibonacci/fibrab.html#2000

;Begin fix
Loop Parse, beeps
{
   Random random, 0, 1000        ; Random frequency
   SoundBeep 600+(A_LoopField-0.5)*random, (2000-A_Index)/5
;   SoundSet A_Index/20,PCSPEAKER ; Volume increases (often no effect)
}
;^ Lazlo's fix (I didn't realize I was listening to pseudorandomness!)
 


--


Last edited by 1991 on July 5th, 2006, 4:59 am, edited 1 time in total.

Report this post
Top
 Profile  
Reply with quote  
 Post subject:
PostPosted: July 2nd, 2006, 2:14 pm 
Could you please overwork your code to avoid horizontal scrolling?
E.g. by using a continuation section

Code:
beeps =
(
1011010110110101101011011010110110101101011011010110101101101011011
1011010110110101101101011010110110101101011011010110110101101011011....
)

_______________
Cheers
AGU


Report this post
Top
  
Reply with quote  
 Post subject:
PostPosted: July 3rd, 2006, 9:43 am 
Offline

Joined: December 27th, 2005, 1:46 pm
Posts: 6837
Location: France (near Paris)
Aha, that's why I don't see the poll...
I didn't care to search to it.
1991, since you created this post logged in, you can edit your post. Please do, it will be easier to read.

_________________
Image vPhiLho := RegExReplace("Philippe Lhoste", "^(\w{3})\w*\s+\b(\w{3})\w*$", "$1$2")


Report this post
Top
 Profile  
Reply with quote  
 Post subject:
PostPosted: July 3rd, 2006, 6:54 pm 
Offline

Joined: February 14th, 2005, 4:05 pm
Posts: 4710
Location: Boulder, CO
Interesting effects!

You can generate the rabbit sequence with a handful of AHK commands. Also, the two first parameters in "stringmid, beeps, beepout, %a_index%, 1" are swapped, causing the variable beeps and beepout to be empty. Fixing this, here is an equivalent script, for experimenting.
Code:
beeps = 0                        ; 1st 1 dropped
Loop 1235 {                      ; Generate 1999 bits of the rabbit sequence
   StringMid x, beeps, A_Index, 1
   beeps := beeps "1" Chr(x*48)  ; ASC("0") = 48
}

Loop Parse, beeps
{
   Random random, 0, 1000        ; Random frequency
   SoundBeep 600+(A_LoopField-0.5)*random, (2000-A_Index)/5
   SoundSet A_Index/20,PCSPEAKER ; Volume increases (often no effect)
}


Report this post
Top
 Profile  
Reply with quote  
 Post subject:
PostPosted: July 3rd, 2006, 11:24 pm 
Offline

Joined: February 14th, 2005, 4:05 pm
Posts: 4710
Location: Boulder, CO
This version has no randomness. Sliding groups of 3 bits select harmonic tones:
Code:
s = 0                      ; 1st 1 dropped
Loop 1235 {                ; Generate 1999 bits of the rabbit sequence
   StringMid x, s, A_Index, 1
   s := s "1" Chr(x*48)    ; ASC("0") = 48
}

fx = 440.00,493.88,523.25,587.33,659.26,698.46,783.99,880.00
Loop Parse, fx, `,
{
   i := A_Index - 1
   f%i% := A_LoopField
}

Loop Parse, s
{
   i := 2*Mod(i,4) + A_LoopField
   SoundBeep f%i%, (2000-A_Index)/10
   SoundSet A_Index/20,PCSPEAKER
}
It sounds very differently.


Report this post
Top
 Profile  
Reply with quote  
Display posts from previous:  Sort by  
Post new topic Reply to topic  [ 5 posts ] 

All times are UTC [ DST ]


Who is online

Users browsing this forum: nothing and 10 guests


You can post new topics in this forum
You can reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot post attachments in this forum

Search for:
Powered by phpBB® Forum Software © phpBB Group