Author Topic: [SOLVED] PLAY question (follow up)  (Read 3534 times)

0 Members and 1 Guest are viewing this topic.

Offline Richard

  • Seasoned Forum Regular
  • Posts: 364
    • View Profile
[SOLVED] PLAY question (follow up)
« 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
« Last Edit: April 01, 2021, 10:49:00 pm by Richard »

Offline SpriggsySpriggs

  • Forum Resident
  • Posts: 1145
  • Larger than life
    • View Profile
    • GitHub
Re: PLAY question
« Reply #1 on: March 11, 2021, 09:50:01 pm »
How do you expect it to play?
Shuwatch!

Offline bplus

  • Global Moderator
  • Forum Resident
  • Posts: 8053
  • b = b + ...
    • View Profile
Re: PLAY question
« Reply #2 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.



« Last Edit: March 11, 2021, 11:10:12 pm by bplus »

Offline Richard

  • Seasoned Forum Regular
  • Posts: 364
    • View Profile
Re: PLAY question
« Reply #3 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?

Offline SpriggsySpriggs

  • Forum Resident
  • Posts: 1145
  • Larger than life
    • View Profile
    • GitHub
Re: PLAY question
« Reply #4 on: March 12, 2021, 09:24:23 am »
Shuwatch!

Offline TempodiBasic

  • Forum Resident
  • Posts: 1792
    • View Profile
Re: PLAY question
« Reply #5 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.
Programming isn't difficult, only it's  consuming time and coffee

Offline Richard

  • Seasoned Forum Regular
  • Posts: 364
    • View Profile
Re: PLAY question
« Reply #6 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.

Offline Richard

  • Seasoned Forum Regular
  • Posts: 364
    • View Profile
Re: [SOLVED] PLAY question (follow up)
« Reply #7 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.