PLAY command now fully implemented!by (no login)It works very nicely, and I've addressed a couple of problems to do with the SOUND statement in the process. There's still a lot more to do like implementing ON PLAY(n) GOSUB and the like, but the play statement works fine. I've been listening to a lot of Christmas carols because of an old GWBASIC program I've got called CAROLS.BAS, which has about 30 different full length carols with lyrics. I'll include it in the next demo as an example. I'm also toying with the idea of adding some extra functionality to the PLAY statement: 1. Vn The letter V followed by a percentage of how loud the sound should be played (volume). 2. , A comma after a note would tell QB64 not to advance the next playing position to the end of the current note. In effect, the next note will be played at exactly the same time as the current note. This will allow chords and polyphonics. A simple example: (The spaces are optional) PLAY "ml ceg c,e,g dfa d,f,a ceg c,e,g egb e,g,b l1c>c<c" Of course, the Pn command without a comma could be used to advance the next position to any location to play more complex music. 3. In To implement different MIDI instruments. It could create a temporary MIDI file in memory (or on disk) an use QB64 existing sound commands to play it. You'd probably achieve this by doing something like: PLAY "i5cdefgabo5c",_MIDI Idea 3 is a dream that would require a lot of work to come to fruition, the other two are actually very easy to implement. My first thoughts on implementing these advanced features was it would be a waste of time, but I believe the BASIC-ness of the PLAY statement shouldn't be underestimated. To implement a few notes or play happy birthday any other way is actually quite a cumbersome task. from IP address 122.104.44.123 |
| Response Title | Author and Date |
| Right up my alley with idea number 3 Galleon :-) | on May 17 |
| Dav | * Cool! on May 17 |
| * Oops. SWAP Title, Name | Dav on May 17 |
| * Too late, your name is now officially "Cool!" How Dav is that? | Pete on May 17 |
| thank you | on May 17 |
| * PLAY uses one speaker and many new PC's have none | on May 17 |
| Don't forget to throw in my YouTube embeded video player while you're at it. | Pete on May 17 |