PLAY musak! - Printable Version +- QB64 Phoenix Edition (https://staging.qb64phoenix.com) +-- Forum: QB64 Rising (https://staging.qb64phoenix.com/forumdisplay.php?fid=1) +--- Forum: Code and Stuff (https://staging.qb64phoenix.com/forumdisplay.php?fid=3) +---- Forum: Works in Progress (https://staging.qb64phoenix.com/forumdisplay.php?fid=9) +---- Thread: PLAY musak! (/showthread.php?tid=1760) |
RE: PLAY musak! - bplus - 06-19-2023 Well I am eager to add patterns and graphics to this but I've got to catch up on Play first. We will have to read the e$ and to convert instructions to add graphics and timing is probably going to be a difficulty. Perhaps break down the e$ string and Play and Draw pieces at a time? Just off the top of my head. RE: PLAY musak! - mnrvovrfc - 06-19-2023 In particular there are only three code lines to worry about (line #169, #180, #191). For example where there is this: Code: (Select All) e$ = e$ + phrase(Random1(5)) + frag(a) + frag(b) + frag(c) + frag(d) just straight out do: Code: (Select All) PLAY phrase(Random1(5)) + frag(a) + frag(b) + frag(c) + frag(d) and do whatever else needs to be done right after that PLAY statement. Delete PLAY e$ left later in the code. Also where e$ begins being built to set the tempo, background mode etc. use PLAY directly on that string like you already fixed it earlier. RE: PLAY musak! - mnrvovrfc - 06-19-2023 I made some more modifications: Code: (Select All)
Otherwise the music pitch was going too high. I desired to include staccato play option like my other program, and I neglected the sinewave. Yeah it's boring and absolutely needs the octave to start at 2 instead of 3 because the highest pitches could barely be heard... Fixed measuring wrong which was "L4." then "L16". The last one should be "L8", that is three "L8" of one note, then one "L8" of different note. I also changed it so it involves way more volume commands -- make it more dynamic. But I wish I could clean up all those angle brackets which look unsightly. Could take down about half the string changing all the ">>" into "O4", and delete the corresponding "<<" while the base is "O2", or something like that. Now chunks of the PLAY string are played while the program checks for escape key press to quit. EDIT: was forced to change where _CLIPBOARD$ resided because I had a good one playing and, in the process of copying and pasting this text into the forum I lost the song. (boo-hoo) EDIT: Having problems with Firefox on Manjaro KDE and other stuff so I also added the ability to save to a BAS file called "mnrvovrfc-musak.bas" in the same directory as the executable, with the created PLAY string completed or not, and ready to be loaded and run into the QB64 IDE. RE: PLAY musak! - bplus - 06-19-2023 OK v3.8 installed and latest Musak! version tested. Some notes seem out of tune not in scales. But this sounded better to my ears: (Missing starting code) Can you see why this is different that first 3-4 ran? RE: PLAY musak! - mnrvovrfc - 06-19-2023 The scales are decided randomly, just advance "current base note" by 3, 4, 5 or 6 to have five notes to work with for each group called a scale. As I've said before, I don't have enough music education to go into Phrygian and other such scales, and less those used in Old World ethnic music. If you take a closer look at the program, it mostly goes along with "ABA" song divison format. The second "A", however has additional small "phrases" that are added, which are not included near the beginning of the song. The "B" division was meant to be totally different with the way the program was written, but it really should try to be as similar as possible to "A". Even more variety with note lengths could be added especially for dotted-lengths but adding those are tricky. To get better at it must issue notes as "A4.C4C4" instead of "L4A.CE". Are you able to paste from this program into a text editor or this forum's reply window? What happened to the text file that I was forced to have it write? RE: PLAY musak! - bplus - 06-19-2023 Quote:Are you able to paste from this program into a text editor or this forum's reply window? What happened to the text file that I was forced to have it write? Ah, let me check my brand spank'n new QB64pe v3.8 folder, here it is: Quote:PLAY "MBMST180@1O2L16V12G>V25C<>V50G<V25GL4>V12G<L8V25G>V50C<L16>V12C<>V50C<>V12G<>V25G<L4V50G>V12D#<L8V25G>V50C<L16>V12C<>V50C<>V12G<>V25G<L16V12G>V25C<>V50G<V25GL4>V12G<L8V25G>V50C<L16>V12C<>V50C<>V12G<>V25G<L4V50G>V12D#<L8V25G>V50C<L16>V12C<>V50C<>V12G<>V25G<L16>V50C<>>V12C#<<>V50G<>>V12C#<<L4>V50G<L16V12G>V50D#<V25G>V50G<L4V12GL8V25G>V50D#<L4>V12C<L8V25GL4>V50C<L8>V25D#<L4V50G>V12D#<L8V12GL16>V50G<>V25C<L8>V50C<L16>V25D#<>V12G<L8V12GL16>V50G<>V25C<L8>V50C<L16>V25D#<>V12G<L4>V25C<L8>V12D#<L4>V12C<L8>>V50C#<<>V12C<L8V25G>V12C<L16V50G>V25G<>V50C<>V25C<L16V12G>V50G<L8V25GL4V12GL8V25G>V12C<L16>V25D#<>V12G<>V50G<>V12D#<L16>V12C<>V50C<L8>>V12C#<<L4V50GL8V12GL16>V50G<>V25C<L8>V50C<L16>V25D#<>V12G<L8V25G>V50C<L16>V12C<>V50C<>V12G<>V25G<L4V50GL8>V12D#<>V25C<L4>V50C<L8>>V25C#<<L8V12GV25GL16>V12G<>V50D#<>V12G<>V25G<L8V12G>V50C<>V12D#<>>V25C#<<L4>V12C<L8>V50G<>V12G<L16>V12C<>V50C<L8>>V12C#<<L4V50GL8V12GL16>V50G<>V25C<L8>V50C<L16>V25D#<>V12G<L8V25G>V50C<L16>V12C<>V50C<>V12G<>V25G<L4V50GL8>V12D#<>V25C<L8V50G>V25D#<L16>V12G<>>V25C#<<V50G>V25C<L4V25GL8>V12G<L16>V50C<>>V12C#<<>V50G<>>V12C#<<L4>V50G<L16V12G>V50D#<V25G>V50G<L4V12GL16V12G>V25C<>V50G<V25GL4>V12G<L8V25G>V50C<L16>V12C<>V50C<>V12G<>V25G<L4V50G>V12D#<L8V25G>V50C<L16>V12C<>V50C<>V12G<>V25G<L16V12G>V25C<>V50G<V25GL4>V12G<L8V25G>V50C<L16>V12C<>V50C<>V12G<>V25G<L4V50G>V12D#<L8V25G>V50C<L16>V12C<>V50C<>V12G<>V25G<L8V25G>V50D#<L4>V12C<L8V25GL4>V50C<L8>V25D#<L4>V12C<L8>>V50C#<<>V12C<L8V25G>V12C<L16V50G>V25G<>V50C<>V25C<L4V50G>V12D#<L8V12GL16>V50G<>V25C<L8>V50C<L16>V25D#<>V12G<L8V12GL16>V50G<>V25C<L8>V50C<L16>V25D#<>V12G<L4>V25C<L8>V12D#<L16V12G>V50G<L8V25GL4V12GL8V25G>V12C<L16>V25D#<>V12G<>V50G<>V12D#<L4>V50C<L8>>V25C#<<L8V12GV25GL16>V12G<>V50D#<>V12G<>V25G<L16>V12C<>V50C<L8>>V12C#<<L4V50GL8V12GL16>V50G<>V25C<L8>V50C<L16>V25D#<>V12G<L8V25G>V50C<L16>V12C<>V50C<>V12G<>V25G<L4V50GL8>V12D#<>V25C<L8V12G>V50C<>V12D#<>>V25C#<<L4>V12C<L8>V50G<>V12G<L8V50G>V25D#<L16>V12G<>>V25C#<<V50G>V25C<L4V25GL8>V12G<L8>V12F#<>>V50C<<L4>>V12D#<<L4>V50F#<>V25F#<L4>>V25D#.<<L8>>V50C<<L4>V50F#<>V25F#<L4>V50F#<>V25F#<L8>V12F#<>>V50C<<L4>>V12D#<<L16>V50F#<V12GL8>V50F#<L4V12GL8>V50C#<>V12F#<L4>V50F#<L16>V50F#<V12GL8>V50F#<L4V12GL8>V12F#<>>V50C<<L4>>V12D#<<L16>V50F#<V12GL8>V50F#<L4V12GL4>V12F#<L8>>V50D#<<>V25F#<L4>V12F#<L8>>V50D#<<>V25F#<L16>>V12D#<<>>V25C<<>>V12C<<>V25F#<L4>>V12D#<<L8>>V25C<<>>V50C<<L16V25G>V12F#<V50G>V12F#<L8>V50C#<L4V25GL8>>V12C<<L8>>V12C<<L16>V50F#<>>V12C<<L8>>V50C<<L16>V25F#<>V50F#<L4>>V25D#.<<L8>>V50C<<L4>V12F#<L8>>V50D#<<>V25F#<L4>V12F#<L8>>V50D#<<>V25F#<L8>>V12C<<L16>V50F#<>>V12C<<L8>>V50C<<L16>V25F#<>V50F#<L4>>V25D#.<<L8>>V50C<<L4>V12F#<L8>>V50D#<<>V25F#<L4>V12F#<L8>>V50D#<<>V25F#<L8>>V25D#<<L16V12G>V25F#<L8V50GL16>V25F#<>V50C#<L16V12G>V50F#<L8>V12C#<L4>V50F#<L16>>V25C<<>V50F#<L8>V25C#<L4>>V50C<<L4>V12C#<>V50F#<L4>V50F#<>V25F#<L4>V12F#<L8>>V50D#<<>V25F#<L4>>V25D#.<<L8>>V50C<<L8>V12F#<>>V50C<<L4>>V12D#<<L4>V50F#<>V25F#<L4>V12F#<L8>>V50D#<<>V25F#<L4>>V25D#.<<L8>>V50C<<L8>V12F#<>>V50C<<L4>>V12D#<<L8>>V25C<<L16>>V12D#<<>>V25D#<<L8V50GL16>V25C#<>V50F#<L4>>V25D#.<<L8>>V50C<<L8>>V12C<<L16>V50F#<>>V12C<<L8>>V50C<<L16>V25F#<>V50F#<L8V25GL4V50GL8>V25C#<L8>>V12C<<L16>V50F#<>>V12C<<L8>>V50C<<L16>V25F#<>V50F#<L4>>V25D#.<<L8>>V50C<<L4>V12F#<L8>>V50D#<<>V25F#<L4>V12F#<L8>>V50D#<<>V25F#<L8>>V12C<<L16>V50F#<>>V12C<<L8>>V50C<<L16>V25F#<>V50F#<L4>>V25D#.<<L8>>V50C<<L4>V12F#<L8>>V50D#<<>V25F#<L4>V12F#<L8>>V50D#<<>V25F#<L4>V50F#<>V25F#<L8>V12F#<>>V50C<<L4>>V12D#<<L16>V50F#<V12GL8>V50F#<L4V12GL8>V50C#<>V12F#<L4>V50F#<L8>>V12C<<L16>V50F#<>>V12C<<L8>>V50C<<L16>V25F#<>V50F#<L4>>V25D#.<<L8>>V50C<<L4>V12F#<L8>>V50D#<<>V25F#<L4>V12F#<L8>>V50D#<<>V25F#<L8>>V12C<<L16>V50F#<>>V12C<<L8>>V50C<<L16>V25F#<>V50F#<L4>>V25D#.<<L8>>V50C<<L4>V12F#<L8>>V50D#<<>V25F#<L4>V12F#<L8>>V50D#<<>V25F#<L4>V12F#<L8>>V50D#<<>V25F#<L16>>V12D#<<>>V25C<<>>V12C<<>V25F#<L4>>V12D#<<L8>>V25C<<>>V50C<<L16V25G>V12F#<V50G>V12F#<L8>V50C#<L4V25GL8>>V12C<<L4>V50F#<>V25F#<L4>V12F#<L8>>V50D#<<>V25F#<L4>>V25D#.<<L8>>V50C<<L8>V12F#<>>V50C<<L4>>V12D#<<L4>V50F#<>V25F#<L4>V12F#<L8>>V50D#<<>V25F#<L4>>V25D#.<<L8>>V50C<<L8>V12F#<>>V50C<<L4>>V12D#<<L8>>V25D#<<L16V12G>V25F#<L8V50GL16>V25F#<>V50C#<L16V12G>V50F#<L8>V12C#<L4>V50F#<L16>>V25C<<>V50F#<L8>V25C#<L4>>V50C<<L4>V12C#<>V50F#<L16>V12C<>V50C<L8>>V12C#<<L4V50GL8V12GL16>V50G<>V25C<L8>V50C<L16>V25D#<>V12G<L8V25G>V50C<L16>V12C<>V50C<>V12G<>V25G<L4V50GL8>V12D#<>V25C<L16>V50C<>>V12C#<<>V50G<>>V12C#<<L4>V50G<L16V12G>V50D#<V25G>V50G<L4V12GL8V25G>V50D#<L4>V12C<L8V25GL4>V50C<L8>V25D#<L4V50G>V12D#<L8V12GL16>V50G<>V25C<L8>V50C<L16>V25D#<>V12G<L8V12GL16>V50G<>V25C<L8>V50C<L16>V25D#<>V12G<L4>V25C<L8>V12D#<L4>V12C<L8>>V50C#<<>V12C<L8V25G>V12C<L16V50G>V25G<>V50C<>V25C<L16V12G>V50G<L8V25GL4V12GL8V25G>V12C<L16>V25D#<>V12G<>V50G<>V12D#<L16>V12C<>V50C<L8>>V12C#<<L4V50GL8V12GL16>V50G<>V25C<L8>V50C<L16>V25D#<>V12G<L8V25G>V50C<L16>V12C<>V50C<>V12G<>V25G<L4V50GL8>V12D#<>V25C<L4>V50C<L8>>V25C#<<L8V12GV25GL16>V12G<>V50D#<>V12G<>V25G<L8V12G>V50C<>V12D#<>>V25C#<<L4>V12C<L8>V50G<>V12G<L4V50GL8>V12D#<>V25C<L8>V25C<L4>V12D#<L8>V25G<L16V12G>V25C<>V50G<V25GL4>V12G<L8V12GL16>V50G<>V25C<L8>V50C<L16>V25D#<>V12G<L8V50G>V25D#<L16>V12G<>>V25C#<<V50G>V25C<L8V50G>V12C<>V50D#<V25GL4>V12C<>V25D#<L8V12GL16>>V25C#<<V50GL8>V25D#<L16V12G>V25D#<L8V12GL16>V50G<>V25C<L8>V50C<L16>V25D#<>V12G<L4V50G>V12D#<L16V12G>V25C<>V50G<V25GL4>V12G<L8V25G>V50C<L16>V12C<>V50C<>V12G<>V25G<L8V12GL16>V50G<>V25C<L8>V50C<L16>V25D#<>V12G<L4V50G>V12D#<L16V12G>V25C<>V50G<V25GL4>V12G<L8V25G>V50C<L16>V12C<>V50C<>V12G<>V25G<L16>V50C<V12GL8>V25C<L4>V50D#<L4V25G>>V50C#<<L8V12GL4>V25C<L8>>V50C#<<L8V12GV25GL16>V50G<>>V25C#<<>V50G<>V12C<L4V50GL8>V12D#<>V25C<L8>V25C<L4>V12D#<L8>V25G<L16V12G>V25C<>V50G<V25GL4>V12G<L8V12GL16>V50G<>V25C<L8>V50C<L16>V25D#<>V12G<L16V50G>V12G<L8>V50D#<L4>V12G<L4V25GL8>V12G<L16>V50C<>>V12C#<<>V50G<>>V12C#<<L4>V50G<L16V12G>V50D#<V25G>V50G<L4V12GL16V12G>V25C<>V50G<V25GL4>V12G<L8V25G>V50C<L16>V12C<>V50C<>V12G<>V25G<L4V50G>V12D#<L8V25G>V50C<L16>V12C<>V50C<>V12G<>V25G<L16V12G>V25C<>V50G<V25GL4>V12G<L8V25G>V50C<L16>V12C<>V50C<>V12G<>V25G<L4V50G>V12D#<L8V25G>V50C<L16>V12C<>V50C<>V12G<>V25G<L8V25G>V50D#<L4>V12C<L8V25GL4>V50C<L8>V25D#<L4>V12C<L8>>V50C#<<>V12C<L8V25G>V12C<L16V50G>V25G<>V50C<>V25C<" But that's not the one I wanted to share, it sounds like one of the previous. I suppose I quit program before it had chance to write the one I caught a snapshot of. You do seem to have repeated patterns with variations in the Musak RE: PLAY musak! - mnrvovrfc - 06-19-2023 Near the top of the most recent code, it could be modified like this: Code: (Select All)
to make the song divisions "A" and "B" more like each other, but only for pitches. A better way is to ditch the "B" division altogether and have 10 "phrases" based on the same five notes of the scale. The live playback is a bit disturbed on my computer especially after it gets to the second "A" division. Sometimes it displays a longer string than before that it doesn't finish processing. So it's a good thing I had it writing a BAS file so the musak stays on the beat always. The "phrases" idea would be nice for "space music" LOL involving the "N" command of PLAY and fast runs of notes. Only if that sinewave could be heard at higher frequencies. For multichannel sound it might be better to avoid PLAY, and figure out how to do surfs and eerie noises as the background channel, with the "space music" in front. In the old forum I liked Mr.Why's experimentations with _SNDRAW. RE: PLAY musak! - Ultraman - 06-26-2023 I notice the comment in the code (that KiloManjaro posted) saying it requires a certain version of QB64PE. I can't remember the way to check the compiler version and display an error if they're using the wrong one. I used to do it all the time. I just can't remember how to do it. RE: PLAY musak! - bplus - 06-26-2023 (06-26-2023, 11:38 AM)Ultraman Wrote: I notice the comment in the code (that KiloManjaro posted) saying it requires a certain version of QB64PE. I can't remember the way to check the compiler version and display an error if they're using the wrong one. I used to do it all the time. I just can't remember how to do it. Would a search of the exe file for "QB64pe" (not case sensitive) be fruitful for getting the version of QB64PE? RE: PLAY musak! - Ultraman - 06-26-2023 It's an actual metacommand in the language but I just don't remember how to do it. Matt or Samuel should know how to do it. |