HTML Programming
 
Forums: » Register « |  User CP |  Games |  Calendar |  Members |  FAQs |  Sitemap |  Support | 
User Name:
Password:
Remember me
Go Back   Dev Shed ForumsWeb DesignHTML Programming

Reply
Add This Thread To:
  Del.icio.us   Digg   Google   Spurl   Blink   Furl   Simpy   Y! MyWeb 
Thread Tools Search this Thread Rate Thread Display Modes
 
Unread Dev Shed Forums Sponsor:
  #1  
Old July 8th, 2000, 08:48 PM
DuckyMoon DuckyMoon is offline
Junior Member
Dev Shed Newbie (0 - 499 posts)
 
Join Date: Jul 2000
Posts: 2 DuckyMoon User rank is Just a Lowly Private (1 - 20 Reputation Level) 
Time spent in forums: < 1 sec
Reputation Power: 0
Hi,

I am needing some help finishing a site ASAP and am looking for a way to create sequential timed functions. I hope someone here can give me some assistance!

I'm trying to write a Javascript function that will play a succession of notes using Beatnik. The pitch of the notes is computed from variable (pc) passed to the function as arguments. My problem is timing the notes. In my current version (see below) the notes play simultaneously. I tried nesting a function call for the playNote statement as the first argument to the setTimeout functions, but then notes still play
all together.

So what I want to do is play each note in succession with a specific delay in between notes.

function playline (pc1, pc2, pc3) {
pitch1 = pc1 + 60
pitch2 = pc2 + 60
pitch3 = pc3 + 60

notePlayer.playNote (1,0,24,pitch1,127,1000)
setTimeout("",1000)
notePlayer.playNote (1,0,24,pitch2,127,1000)
setTimeout("",2000)
notePlayer.playNote (1,0,24,pitch3,127,1000)
;
}

i appreciate any help you can give me. Thank you!

Reply With Quote
  #2  
Old July 9th, 2000, 12:32 PM
Argrajoca Argrajoca is offline
Contributing User
Dev Shed Newbie (0 - 499 posts)
 
Join Date: Feb 2000
Location: SPAIN
Posts: 47 Argrajoca User rank is Just a Lowly Private (1 - 20 Reputation Level) 
Time spent in forums: < 1 sec
Reputation Power: 9
why don't try this:

setTimeout("notePlayer.playNote (1,0,24,pitch1,127,1000)",1000)

Reply With Quote
  #3  
Old July 10th, 2000, 08:45 AM
DuckyMoon DuckyMoon is offline
Junior Member
Dev Shed Newbie (0 - 499 posts)
 
Join Date: Jul 2000
Posts: 2 DuckyMoon User rank is Just a Lowly Private (1 - 20 Reputation Level) 
Time spent in forums: < 1 sec
Reputation Power: 0
Thank you so much for your suggestion. I'll give it a try today. I appreciate your help!


Reply With Quote
Reply

Viewing: Dev Shed ForumsWeb DesignHTML Programming > How to create sequential timed functions?


Thread Tools  Search this Thread 
Search this Thread:

Advanced Search
Display Modes  Rate This Thread 
Rate This Thread:


Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

vB code is On
Smilies are On
[IMG] code is On
HTML code is Off
View Your Warnings | New Posts | Latest News | Latest Threads | Shoutbox
Forum Jump


Forums: » Register « |  User CP |  Games |  Calendar |  Members |  FAQs |  Sitemap |  Support | 
  
 





© 2003-2008 by Developer Shed. All rights reserved. DS Cluster 6 hosted by Hostway