z2

I agree. Take me to the spicy page.
It is currently Thu Dec 14, 2017 12:38 am

All times are UTC




Post new topic Reply to topic  [ 10 posts ] 
Author Message
 Post subject: Random Music Generator
PostPosted: Wed Oct 24, 2012 6:00 pm 
Offline
newcomer

Joined: Fri Nov 11, 2011 1:33 am
Posts: 7
Image

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 136 times
Top
 Profile  
 
PostPosted: Fri Oct 26, 2012 5:20 pm 
Offline
the Gargoyle.
User avatar

Joined: Tue Jul 25, 2006 10:02 am
Posts: 602
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 :)


Top
 Profile  
 
PostPosted: Fri Oct 26, 2012 6:45 pm 
Offline
newcomer

Joined: Fri Nov 11, 2011 1:33 am
Posts: 7
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.


Top
 Profile  
 
PostPosted: Sat Oct 27, 2012 1:06 am 
Offline
the Gargoyle.
User avatar

Joined: Tue Jul 25, 2006 10:02 am
Posts: 602
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.


Top
 Profile  
 
PostPosted: Mon Oct 29, 2012 5:21 pm 
Offline
fgsdfs
User avatar

Joined: Wed Mar 12, 2003 5:44 pm
Posts: 2423
Location: :noitacoL
This is neat. I'd like to see more of these. The bullet idea is good.

_________________
*POW* *CLANK* *PING*


Top
 Profile  
 
PostPosted: Tue Nov 06, 2012 3:29 pm 
Offline
Official Clamp School Defender
User avatar

Joined: Thu Mar 01, 2012 3:00 am
Posts: 328
Location: earthbound
nice little app!

_________________
Image Image


Top
 Profile  
 
PostPosted: Tue Nov 18, 2014 5:05 am 
Offline
newcomer

Joined: Tue Nov 18, 2014 4:59 am
Posts: 1
One more thing before I log out for a week, does anyone know the max object size for a board in zzt?

_________________
http://www.testking.net/CCIE-Security-certification-training.htm
http://www.ju.edu/
http://www.testking.net/CCNA-Data-Center-certification-training.htm


Top
 Profile  
 
PostPosted: Tue Nov 18, 2014 4:51 pm 
Offline
fgsdfs
User avatar

Joined: Wed Mar 12, 2003 5:44 pm
Posts: 2423
Location: :noitacoL
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.

_________________
*POW* *CLANK* *PING*


Top
 Profile  
 
PostPosted: Thu Nov 20, 2014 4:40 am 
Offline
fgsdfs
User avatar

Joined: Wed Mar 12, 2003 5:44 pm
Posts: 2423
Location: :noitacoL
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*


Top
 Profile  
 
PostPosted: Thu Nov 20, 2014 11:53 pm 
Offline
OH YES! USE VINE WHIP! <3
User avatar

Joined: Tue Sep 11, 2001 9:11 am
Posts: 1743
Location: scabsboro
Let's just trick somebody into TASing Town and they'll have to figure this out.

_________________
<asgromo> Dr Dos; What is this monstrocity?
<Spectere> Aura 2
<asgromo> This thread is useless... I'll just... read the Featured Games article.
<asgromo> ... I'll just look for boners.


Top
 Profile  
 
Display posts from previous:  Sort by  
Post new topic Reply to topic  [ 10 posts ] 

All times are UTC


Who is online

Users browsing this forum: No registered users and 1 guest


You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot post attachments in this forum

Search for:
Jump to:  
Powered by phpBB® Forum Software © phpBB Group