It is currently Thu Apr 09, 2020 9:09 pm

All times are UTC + 1 hour




Post new topic Reply to topic  [ 23 posts ]  Go to page 1, 2  Next
Author Message
 Post subject: Speaker-Tecno
PostPosted: Fri Apr 01, 2005 2:40 pm 
Offline
Addict
Addict
User avatar

Joined: Sat Feb 12, 2005 3:35 am
Posts: 803
Location: Germany(Hessen)
Code updated For 5.20+

EVERYBODY, CLAP YOUR HANDS !!! :lol:



Code:
#Grad2Rad=0.017453
OpenConsole()                                 
ConsoleTitle ("Tecno-Mucke")
repeat
For a=1 To 150 Step 10
Beep_(Int(Sin(a*#Grad2Rad)*1000), 10)
Beep_(Int(Sin(a*#Grad2Rad)*500), 5)
Beep_(Int(Cos(a*#Grad2Rad)*1000), 10)
Next
Delay(40)
For x=1 To 20
Beep_(100+Random (1000),3)
Beep_(100+Random (1000),3)
Next x
Delay(40)
For a=1 To 400 Step 10
Beep_(Int(Sin(a*#Grad2Rad)*1000), 10)
Beep_(Int(Sin(a*#Grad2Rad)*500), 5)
Beep_(Int(Cos(a*#Grad2Rad)*1000), 10)
Next
Delay(40)
For x=1 To 20
Beep_(100+Random (1500),3)
Beep_(100+Random (1000),3)
Next x
Delay(40)
For a=1 To 150 Step 10
Beep_(Int(Sin(a*#Grad2Rad)*2000), 10)
Beep_(Int(Sin(a*#Grad2Rad)*500), 5)
Beep_(Int(Cos(a*#Grad2Rad)*1000), 10)
Next
Delay(20)
For x=1 To 20
Beep_(100+Random (1000),3)
Beep_(100+Random (1000),3)
Next x
Delay(20)
For x=1 To 20
Beep_(100+Random (1500),3)
Beep_(100+Random (1000),3)
Next x
Until Inkey()<>""
CloseConsole()

_________________
German blog about IT and programming
German PB forums


Last edited by Hroudtwolf on Fri Apr 01, 2005 3:12 pm, edited 1 time in total.

Top
 Profile  
Reply with quote  
 Post subject:
PostPosted: Fri Apr 01, 2005 3:02 pm 
Offline
Enthusiast
Enthusiast

Joined: Sun Aug 29, 2004 2:25 pm
Posts: 149
Location: United Kingdom
Lol, My PC is dying! :)


Top
 Profile  
Reply with quote  
 Post subject:
PostPosted: Fri Apr 01, 2005 3:13 pm 
Offline
Addict
Addict
User avatar

Joined: Sat Feb 12, 2005 3:35 am
Posts: 803
Location: Germany(Hessen)
Yeah ,there must die more PCs.... :lol:


Code:
Declare synth1()
Declare synth2()
Declare synth3()
Declare synth4()
OpenConsole()                                 
ConsoleTitle ("Tecno-Mucke")

Repeat
Read note

Select note
Case 1
synth1()
Case 2
synth2()
Case 3
synth3()
Case 4
synth4()

EndSelect

x=x+1
If x>23:x=0:Restore mucke::EndIf
Delay (30)
Until Inkey()<>""
CloseConsole()



Procedure synth1()
For a=1 To 500 Step 10
Beep_(Int(Sin(a*0.017453)*1000), 5)
Beep_(Int(Cos(a*0.017453)*3000), 5)
Next
EndProcedure
Procedure synth3()
For a=1 To 500 Step 10
Beep_(Int(Sin(a*0.017453)*5000), 2)
Beep_(Int(Cos(a*0.017453)*2000), 5)
Next
EndProcedure
Procedure synth2()
For a=1 To 800 Step 10
Beep_(Int(Sin(a*0.017453)*Random(1000)), 1)
Beep_(Int(Cos(a*0.017453)*Random(5000)), 1)
Next
EndProcedure
Procedure synth4()
For a=1 To 800 Step 10
Beep_(Int(Sin(a*0.017453)*3000), 2)
Beep_(Int(Sin(a*0.017453)*1500), 2)
Next
EndProcedure








DataSection
Mucke:
Data.l 1,2,1,3,1,2,1,3,1,2,1,3,1,1,4,1,4,1,4,1,2,1,3,1,4
EndDataSection

_________________
German blog about IT and programming
German PB forums


Top
 Profile  
Reply with quote  
 Post subject:
PostPosted: Fri Apr 01, 2005 3:34 pm 
Offline
PureBasic Expert
PureBasic Expert
User avatar

Joined: Sun Apr 27, 2003 4:41 pm
Posts: 1661
Location: Germany
horrible!

_________________
Good programmers don't comment their code. It was hard to write, should be hard to read.


Top
 Profile  
Reply with quote  
 Post subject:
PostPosted: Fri Apr 01, 2005 11:57 pm 
Offline
Addict
Addict
User avatar

Joined: Fri Feb 13, 2004 12:45 am
Posts: 2787
Location: Bergen, Norway
:lol:
Annoying, but kinda funny.
First time I ran it, it gave me a flash back from the olden days hehehe

_________________
I Stepped On A Cornflake!!! Now I'm A Cereal Killer!


Top
 Profile  
Reply with quote  
 Post subject:
PostPosted: Sat Apr 02, 2005 12:04 am 
Offline
Addict
Addict

Joined: Fri Apr 25, 2003 11:10 pm
Posts: 1218
kind of reminds me of Moon Cresta :)


Top
 Profile  
Reply with quote  
 Post subject:
PostPosted: Thu Apr 14, 2005 1:14 am 
Offline
Addict
Addict
User avatar

Joined: Tue Dec 23, 2003 3:54 am
Posts: 1771
Hows this?

Code:
; Sloppily Coded Rave by kenmo
; Tune written by "Toby"!

Structure Note
   base.b
   note.b
EndStructure

Global length.w : Read length.w : Global tempo.w : Read tempo.w : Dim Note.Note(length-1)
For tmp=0 To length-1
   Read note(tmp)\base : Read note(tmp)\note
Next tmp
Global a.b : Global b.b

Dim notefreq.w(11,9) : For tmp=0 To 11 : For tmp2=0 To 9 : Read notefreq(tmp,tmp2) : Next tmp2 : Next tmp
OpenWindow(0,0,0,300,40,#PB_Window_ScreenCentered|#PB_Window_SystemMenu,"Tempo: "+Str(tempo)+" bpm")
CreateGadgetList(WindowID())
TrackBarGadget(0,10,10,280,20,30,200) : SetGadgetState(0,tempo)

Procedure PlayIt()
   tmp=0
   Repeat
      a=note(tmp)\note-1 : b=note(tmp)\base-1
      Beep_(notefreq(a,b),15000/tempo)
      tmp+1 : If tmp=length : tmp=0 : EndIf
   ForEver
EndProcedure

   thread=CreateThread(@playit(),0)
   If thread
   Repeat
      e=WindowEvent()
      While e
         If e=#PB_EventCloseWindow : KillThread(thread) : End
         ElseIf e=#PB_EventGadget And EventGadgetID()=0
            tempo=GetGadgetState(0) : SetWindowTitle(0,"Tempo: "+Str(tempo)+" bpm")
         EndIf
         e=WindowEvent() : Delay(2)
      Wend
      Delay(2)
   ForEver
   Else : End : EndIf
   
DataSection
   ; Song Length, Tempo
   Data.w 64,100
   ; Base/Note
   Data.b 5,1
   Data.b 5,8
   Data.b 6,1
   Data.b 5,1
   Data.b 5,8
   Data.b 6,1
   Data.b 5,1
   Data.b 5,8
   Data.b 5,1
   Data.b 5,8
   Data.b 6,4
   Data.b 5,1
   Data.b 5,8
   Data.b 6,4
   Data.b 5,1
   Data.b 5,8
   Data.b 5,4
   Data.b 5,9
   Data.b 6,4
   Data.b 5,4
   Data.b 5,9
   Data.b 6,4
   Data.b 5,4
   Data.b 5,9
   Data.b 5,6
   Data.b 6,1
   Data.b 6,6
   Data.b 5,6
   Data.b 6,1
   Data.b 6,6
   Data.b 5,6
   Data.b 6,1
   Data.b 5,1
   Data.b 5,8
   Data.b 6,8
   Data.b 5,1
   Data.b 5,8
   Data.b 6,8
   Data.b 5,1
   Data.b 5,8
   Data.b 5,1
   Data.b 5,8
   Data.b 6,6
   Data.b 5,1
   Data.b 5,8
   Data.b 6,6
   Data.b 5,1
   Data.b 5,8
   Data.b 5,4
   Data.b 5,11
   Data.b 6,9
   Data.b 5,4
   Data.b 5,11
   Data.b 6,9
   Data.b 5,4
   Data.b 5,11
   Data.b 5,6
   Data.b 6,1
   Data.b 6,6
   Data.b 5,6
   Data.b 6,1
   Data.b 6,6
   Data.b 5,6
   Data.b 6,1
   
   ; Note Frequencies
   Data.w 16,32,65,130,261,523,1046,2093,4186,8372
   Data.w 17,34,69,138,277,554,1108,2217,4434,8869
   Data.w 18,36,73,146,293,587,1174,2344,4698,9397
   Data.w 19,38,77,155,311,622,1244,2489,4978,9956
   Data.w 20,41,82,164,329,659,1318,2637,5274,10548
   Data.w 21,43,87,174,349,698,1396,2793,5587,11175
   Data.w 23,46,92,184,369,739,1479,2959,5919,11839
   Data.w 24,48,97,195,391,783,1567,3135,6270,12541
   Data.w 25,51,103,207,415,830,1661,3322,6644,13289
   Data.w 27,55,110,220,440,880,1760,3520,7040,14080
   Data.w 29,58,116,233,466,932,1964,3729,7458,14917
   Data.w 30,61,123,246,493,987,1975,3951,7902,15804
EndDataSection


Last edited by kenmo on Fri Apr 15, 2005 12:30 am, edited 1 time in total.

Top
 Profile  
Reply with quote  
 Post subject:
PostPosted: Thu Apr 14, 2005 11:29 am 
Offline
PureBasic Expert
PureBasic Expert
User avatar

Joined: Sun Apr 27, 2003 4:41 pm
Posts: 1661
Location: Germany
kenmo wrote:
Hows this?

First tune posted here to meet the defintion of music! Like it! :D

_________________
Good programmers don't comment their code. It was hard to write, should be hard to read.


Top
 Profile  
Reply with quote  
 Post subject:
PostPosted: Thu Apr 14, 2005 11:48 am 
Offline
Addict
Addict
User avatar

Joined: Fri Feb 13, 2004 12:45 am
Posts: 2787
Location: Bergen, Norway
Pretty cool, I kinda like it :)

_________________
I Stepped On A Cornflake!!! Now I'm A Cereal Killer!


Top
 Profile  
Reply with quote  
 Post subject:
PostPosted: Thu Apr 14, 2005 1:20 pm 
Offline
Enthusiast
Enthusiast
User avatar

Joined: Fri Apr 25, 2003 7:44 pm
Posts: 465
Location: end of www
@kenmo:

Indeed ... nice piece of melody :!:

_________________
regards,
benny!
-
pe0ple ar3 str4nge!!!


Top
 Profile  
Reply with quote  
 Post subject:
PostPosted: Thu Apr 14, 2005 3:36 pm 
Offline
Enthusiast
Enthusiast

Joined: Sun Aug 29, 2004 2:25 pm
Posts: 149
Location: United Kingdom
Ok i can't take credit for this, ages ago in my DarkBASIC years somebody posted a melody tune for the beginning of Guns & Roses, so i changed it to be and here it is:

Code:
tempo=180
Beep_(284,tempo)
Beep_(568,tempo)
Beep_(426,tempo)
Beep_(379,tempo)
Beep_(758,tempo)
Beep_(426,tempo)
Beep_(716,tempo)
Beep_(426,tempo)

Beep_(284,tempo)
Beep_(568,tempo)
Beep_(426,tempo)
Beep_(379,tempo)
Beep_(758,tempo)
Beep_(426,tempo)
Beep_(716,tempo)
Beep_(426,tempo)

Beep_(319,tempo)
Beep_(568,tempo)
Beep_(426,tempo)
Beep_(379,tempo)
Beep_(758,tempo)
Beep_(426,tempo)
Beep_(716,tempo)
Beep_(426,tempo)

Beep_(319,tempo)
Beep_(568,tempo)
Beep_(426,tempo)
Beep_(379,tempo)
Beep_(758,tempo)
Beep_(426,tempo)
Beep_(716,tempo)
Beep_(426,tempo)

Beep_(379,tempo)
Beep_(568,tempo)
Beep_(426,tempo)


Last edited by Tommeh on Thu Apr 14, 2005 5:28 pm, edited 2 times in total.

Top
 Profile  
Reply with quote  
 Post subject:
PostPosted: Thu Apr 14, 2005 5:25 pm 
Offline
PureBasic Expert
PureBasic Expert
User avatar

Joined: Sun Apr 27, 2003 4:41 pm
Posts: 1661
Location: Germany
To my ears, you've got to change the second note of the first two rows:
Code:
Beep_(568,tempo)


first is note is too sharp as well, but... ;)

_________________
Good programmers don't comment their code. It was hard to write, should be hard to read.


Top
 Profile  
Reply with quote  
 Post subject:
PostPosted: Thu Apr 14, 2005 5:26 pm 
Offline
Enthusiast
Enthusiast

Joined: Sun Aug 29, 2004 2:25 pm
Posts: 149
Location: United Kingdom
As i said, i didnt make it but i've changed it.. if you think its for the better ;p


Top
 Profile  
Reply with quote  
 Post subject:
PostPosted: Thu Apr 14, 2005 8:19 pm 
Offline
Enthusiast
Enthusiast

Joined: Wed Aug 18, 2004 9:52 am
Posts: 426
Location: Penang, Malaysia
Trigger back memories when we were in DOS using GWBASIC trying to write a game.


Top
 Profile  
Reply with quote  
 Post subject:
PostPosted: Thu Apr 14, 2005 10:24 pm 
Offline
Addict
Addict
User avatar

Joined: Sat Feb 19, 2005 5:05 pm
Posts: 1769
Location: Norway
I couldn't help myself, turned this into a ringtone'ish function. heh.
minimum 1 loop, maximum 10 loops. has a finishing note when the loop is do ne.

Code:
Procedure play(replay.l)
 tempo=180
 If replay>10 : replay=10 : EndIf
 If replay<1 : replay=1 : EndIf
 Repeat
  replay-1
  Beep_(284,tempo)
  Beep_(568,tempo)
  Beep_(426,tempo)
  Beep_(379,tempo)
  Beep_(758,tempo)
  Beep_(426,tempo)
  Beep_(716,tempo)
  Beep_(426,tempo)
 
  Beep_(284,tempo)
  Beep_(568,tempo)
  Beep_(426,tempo)
  Beep_(379,tempo)
  Beep_(758,tempo)
  Beep_(426,tempo)
  Beep_(716,tempo)
  Beep_(426,tempo)
 
  Beep_(319,tempo)
  Beep_(568,tempo)
  Beep_(426,tempo)
  Beep_(379,tempo)
  Beep_(758,tempo)
  Beep_(426,tempo)
  Beep_(716,tempo)
  Beep_(426,tempo)
 
  Beep_(319,tempo)
  Beep_(568,tempo)
  Beep_(426,tempo)
  Beep_(379,tempo)
  Beep_(758,tempo)
  Beep_(426,tempo)
  Beep_(716,tempo)
  Beep_(426,tempo)
 
  Beep_(379,tempo)
  Beep_(568,tempo)
  Beep_(426,tempo)
  Beep_(379,tempo)
  Beep_(758,tempo)
  Beep_(426,tempo)
  Beep_(716,tempo)
  Beep_(426,tempo)
 
  Beep_(379,tempo)
  Beep_(568,tempo)
  Beep_(426,tempo)
  Beep_(379,tempo)
  Beep_(758,tempo)
  Beep_(426,tempo)
  Beep_(716,tempo)
  Beep_(426,tempo)
 Until replay=0
 Beep_(284,tempo*2)
EndProcedure

play(2)


Top
 Profile  
Reply with quote  
Display posts from previous:  Sort by  
Post new topic Reply to topic  [ 23 posts ]  Go to page 1, 2  Next

All times are UTC + 1 hour


Who is online

Users browsing this forum: No registered users and 10 guests


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

Search for:
Jump to:  

 


Powered by phpBB © 2008 phpBB Group
subSilver+ theme by Canver Software, sponsor Sanal Modifiye