Random Music Generator
-
- newcomer
- Posts: 7
- Joined: Fri Nov 11, 2011 1:33 am
Random Music Generator
Download: Here (also attached)
Note: ZZT 4.0, Lyon, or memory limit removing port recommended.
I've created a "Random Music Generator". Choose from one of the 12 major scales, or the Chromatic Scale, and listen to the sounds your computer's random generation makes.
___INSTRUCTIONS___
* Touch the purple object.
* Select from the 12 major scales, or the "Chromatic Scale", which is all of the notes.
* The arrow will then place the notes from the scale on the board for them to be played at random.
* When the arrow is done and reaches the left/west wall, you can then touch the purple object again to change the scale.
* When you touch the purple object, it tells everything to stop playing. ZZT needs time for it to catch up to this, so if you have it on one of the faster speed settings, you might want to wait a bit before selecting another scale after touching the purple object, as it will give everything time to stop.
Some notes from the .txt:
It's obvious ZZT can't keep up with all of the notes, nor can it play chords.
After a while, it tends to give precedence to the lower notes. I'm guessing this has to do with the way things are read in ZZT(at least with Lyon, which is what this was mostly tested with). When you put it on one of the slower speeds, it gives it more of a chance to randomly play the higher notes, so it's probably read left to right, and with the slower speeds giving it more time to catch up to the right before the left bombards it with more information.
- Attachments
-
- rmgzzt.zip
- (2.88 KiB) Downloaded 523 times
Re: Random Music Generator
ZZT only has so much room allocated for a music buffer- that's why if you loop a bunch of #play statements in the original engine some of the lines simply don't make it. I don't know if Lyon's method is 100% accurate in how it handles the buffer limit, but it should be pretty close.
Still, this is a really exciting development and a unique concept :)
Still, this is a really exciting development and a unique concept :)
-
- newcomer
- Posts: 7
- Joined: Fri Nov 11, 2011 1:33 am
Re: Random Music Generator
Glad you find it interesting. It was a nice little project that lasted 2-3 days. Kept finding things that needed to be patched up and ways to make it more visually pleasing and the engine efficient.
Hope it helped with Lyon in any way, or ZZT. I had a different concept for a while but it used shooting so I thought of this method so that there wouldn't be any bullet sounds(guess you could hack the ZZT.exe and mute the bullets if you really wanted). That method allowed for some abstract random "composing" though, as the notes would randomly shoot messages to each other and react if shot. Still not ruling it out but glad I got this version complete.
Hope it helped with Lyon in any way, or ZZT. I had a different concept for a while but it used shooting so I thought of this method so that there wouldn't be any bullet sounds(guess you could hack the ZZT.exe and mute the bullets if you really wanted). That method allowed for some abstract random "composing" though, as the notes would randomly shoot messages to each other and react if shot. Still not ruling it out but glad I got this version complete.
Re: Random Music Generator
ZZT runs sound on a different interrupt than when it runs stuff on the screen, so when music aligns to #cycle 1 in the game it's pure coincidence; they aren't actually synced. If the time it takes to process all the objects takes more time than it would to run the cycle normally, the game itself will lag behind the sound. As long as the game can keep up with the sound though, you could probably mask the shooting with played notes.
It's interesting to note that Lyon DOES sync these two, music ticks and game ticks are completely synced as if the game were running full speed all the time.
It's interesting to note that Lyon DOES sync these two, music ticks and game ticks are completely synced as if the game were running full speed all the time.
Re: Random Music Generator
This is neat. I'd like to see more of these. The bullet idea is good.
*POW* *CLANK* *PING*
Re: Random Music Generator
One more thing before I log out for a week, does anyone know the max object size for a board in zzt?
Re: Random Music Generator
An object can have any amount of code up to the board size IIRC. So about 14k. If it's a lot of text you need, you can use an external .txt file. Change the extension to .hlp, and open it in-game using a the hyperlink command:
!-diary;Open Diary
if the file is diary.hlp. Downside is that people can just read it without playing the game (or editing it).
Edit: wait a second..... deja vu.
!-diary;Open Diary
if the file is diary.hlp. Downside is that people can just read it without playing the game (or editing it).
Edit: wait a second..... deja vu.
*POW* *CLANK* *PING*
Re: Random Music Generator
Second thought I had, is there any predictability to ZZT's RNG? Could procedural content be created? Is it reset when a world is loaded, or dynamic through the multiple ZZT worlds/restores? Maybe #endgame resets the seed. Wishful thinking I bet, but made me curious as to how it goes down. Maybe certain commands turn over the seed (#try rnd, built-in creature intelligence routine), or it gets turned every frame reguardless. Saxxon?
*POW* *CLANK* *PING*
- Dr. Dos
- OH YES! USE VINE WHIP! <3
- Posts: 1772
- Joined: Tue Mar 11, 2003 12:00 am
- Location: Washington
Re: Random Music Generator
Let's just trick somebody into TASing Town and they'll have to figure this out.
Visit the Museum of ZZT
Follow Worlds of ZZT on Twitter
Apologies for the old post you may have just read.
Follow Worlds of ZZT on Twitter
Apologies for the old post you may have just read.