bjbest60 Posted December 18, 2018 Share Posted December 18, 2018 Well, "music" might be a strong term. "Sufficiently harmonious tones" might be better. Attached is a .bin and .bas file of a program that generates, well, sufficiently harmonious tones in the key of A major. It's fairly compact and efficient. I've tried to include a lot of comments. I thought I might use it in a game, but it doesn't really suit the project. I'm posting it here in case it might benefit someone else. Basically it picks a random bass note and a random melody note and plays them. It keeps track of note length and plays things in correct time. (The bass moves in quarter notes, the melody moves in eighth notes, with some variations possible.) It's very basic but could be built out for more interesting (and perhaps musical) results. I'm happy to answer any questions. Enjoy! songtestprocedural.bas songtestprocedural.bas.bin 7 Quote Link to comment https://forums.atariage.com/topic/286160-procedural-music-in-bb/ Share on other sites More sharing options...
+Muddyfunster Posted December 18, 2018 Share Posted December 18, 2018 That's actually quite neat, thanks for sharing this. Sound production is one place I really struggle in bB. 1 Quote Link to comment https://forums.atariage.com/topic/286160-procedural-music-in-bb/#findComment-4179775 Share on other sites More sharing options...
+Random Terrain Posted December 19, 2018 Share Posted December 19, 2018 Is it possible to make something similar for a single channel so the other channel can be used for sound effects? If so, I could make an adapted example program for the bB page. 1 Quote Link to comment https://forums.atariage.com/topic/286160-procedural-music-in-bb/#findComment-4179990 Share on other sites More sharing options...
bjbest60 Posted December 19, 2018 Author Share Posted December 19, 2018 (edited) Is it possible to make something similar for a single channel so the other channel can be used for sound effects? If so, I could make an adapted example program for the bB page. I'm not quite sure how a single channel would work ... you need two separate notes to create a harmony. You might be able to "flicker" the music on one channel (one frame is bass, the next is melody, the next is bass, etc.) though I imagine that might sound choppy. A better strategy might be to always have both channels doing what they're currently doing and then have a sound effect override a particular channel for a set period of time. I'll experiment a bit when I have some time. EDIT: I tried the "flicker" effect just to hear what it sounds like. To me, it sounds like a very insistent ringing telephone, but maybe it would be useful for the right project? Both one-frame (that is, the sound changes every frame; this uses one bit of a variable) and two-frame (which requires a variable that can count to three) examples are attached. songtestproceduralflicker1frame.bas.bin songtestproceduralflicker2frame.bas.bin Edited December 19, 2018 by bjbest60 2 Quote Link to comment https://forums.atariage.com/topic/286160-procedural-music-in-bb/#findComment-4180271 Share on other sites More sharing options...
+Muddyfunster Posted December 19, 2018 Share Posted December 19, 2018 the 1 channel stuff sounds kind of like early ZX Spectrum music (the 48k beeper variety) Quote Link to comment https://forums.atariage.com/topic/286160-procedural-music-in-bb/#findComment-4180505 Share on other sites More sharing options...
+Gemintronic Posted December 23, 2018 Share Posted December 23, 2018 I could see two options: A. Interleave two notes on one sound channel. B. Make the sound engine interrupt playback on one channel and play back a sound effect on it. I don't mind blippy simulated stereo as I grew up on Apple IIs and IBM PCs Quote Link to comment https://forums.atariage.com/topic/286160-procedural-music-in-bb/#findComment-4182844 Share on other sites More sharing options...
Recommended Posts
Join the conversation
You can post now and register later. If you have an account, sign in now to post with your account.
Note: Your post will require moderator approval before it will be visible.