QB64.org Forum

Active Forums => QB64 Discussion => Topic started by: Richard on March 11, 2021, 09:12:27 pm

Title: [SOLVED] PLAY question (follow up)
Post by: Richard on March 11, 2021, 09:12:27 pm
I just tried using PLAY for the very first time and to me the code does not play as i expected.

Code: QB64: [Select]
  1.  
  2. Play "ABCDEFG>ABCDEFG>ABCDEFG>ABCDEFG>ABCDEFG>ABCDEFG>ABCDEFG"
  3.  
  4.  

Any comments?

Using QB64 v1.5 Windows 10 x64
Title: Re: PLAY question
Post by: SpriggsySpriggs on March 11, 2021, 09:50:01 pm
How do you expect it to play?
Title: Re: PLAY question
Post by: bplus on March 11, 2021, 11:02:37 pm
'maybe <6 octaves
Play "o1CDEFGab>CDEFGab>CDEFGab>CDEFGab>CDEFGab"

doh ray me... usually starts on C a scale without sharps or flats.



Title: Re: PLAY question
Post by: Richard on March 12, 2021, 09:21:41 am
@bplus

Thanks - you have summarized PLAY in one line of code for me.

Now got the result expected - a monotonic increase in frequency.

Any way to adjust volume individually for each key?
Title: Re: PLAY question
Post by: SpriggsySpriggs on March 12, 2021, 09:24:23 am
http://www.qb64.org/wiki/PLAY (http://www.qb64.org/wiki/PLAY)
Title: Re: PLAY question
Post by: TempodiBasic on March 12, 2021, 06:49:14 pm
SpriggySpriggs is right!
see important notes on PLAY
Quote
MB will allow music to play while program code progresses. MF will wait for code to continue playing notes.
Command string values are not case sensitive and spacing is ignored. Use upper or lower case as desired.
NOTE: In QB64, PLAY may NOT delay program progress! Use _DELAY and END to allow music completion.
Title: Re: PLAY question
Post by: Richard on March 12, 2021, 09:42:19 pm
While playing around with PLAY the following does not play for me

Code: QB64: [Select]
  1. Play "L8N65"
  2.  

According to both the IDE help wiki and @SMcNeill downloaded Wiki (NOV 2020) - the note length can be any value between 1 and 64.

Also, for me, the IDE help wiki appears to have some "garbage" e.g. in the Tn -Tempo section of PLAY.
Title: Re: [SOLVED] PLAY question (follow up)
Post by: Richard on April 01, 2021, 11:20:25 pm
Not a fault with QB64 (really a "timing" aspect to be aware of)...

Consider the code below

Code: QB64: [Select]
  1. PLAY "L5N65"
  2.  

Different duration (for me) with/without  the  _DELAY 1 line

I may have "lost" the play sound in PLAY "L8N65" in my QB64 programs because of timing concerns (not having _DELAY 1).

So, yes, PLAY works with "L64" as well.