Copyright (C) 1991 by Klaus Pedersen. JUKEBOX is a Public Domain program by Klaus Pedersen Nyborgvej 217 4. TH DK-5220 Odense Sē Denmark EMAIL : micro@imada.ou.dk You should check that you have the following files in the JUKEBOX directory: AUTOEXEC\ AUTOEXEC.PRG ; THE Program for the autofolder AUTOEXEC.TXT ; This file. AUTOEXEC.SYS ; sample autoexec.sys file. MAKE_AEX.TTP ; reads the auto folder and generates a ; autoexec.sys file. SOURCE\ AUTOEXEC.PRJ ; TC makefile. AUTOEXEC.C ; The source for the program COOKIE.C ; routine to read a cookie LOADSEGM.C ; routine to load and relocate segm file PLAYER.S ; routine to start and stop playing of segms PLAYER.H ; headers to the routines in 'player' module NT_CONST.S ; Hardware and TOS constants MXALLOC.S ; a TT compatible malloc MXALLOC.H ; header and manual for MXALLOC TINYSTRT.S ; small startup code... MAKE_AEX.PRJ ; TC makefile for MAKE_AEX. MAKE_AEX.C ; The source for MAKE_AEX program --------------------------------------------------------------------- / / / / / / / / INTRODUCTION / / / / / / / / / / / / / / / / / / / / --------------------------------------------------------------------- Some time back (3 days) Jonathan Roy (as666@cleveland.freenet.edu, Genie: J.ROY18) asked me if I could make a program that could play a sample when the computer was started, well this is it... Besides the possibility to play a sample, it also incoroperat a simple PROGRAMMING language. The language has conditionals, program execution, sample play, print and input commands. Together all these commands make an very powerful program. This program works on all ST's and TT's, but the sample playing feature only works on [MEGA] STe and TT. The most usefull feature in this program is the ability to change the order of the auto programs, with a simple texteditor. And the ability to have more setups that can be choosen among with a key press... --------------------------------------------------------------------- / / / / / / / / QUICK INSTALL / / / / / / / / / / / / / / / / / / / / --------------------------------------------------------------------- To install the program, do the following: o Run the program MAKE_AEX.TTP and write : >c:\autoexec.sys in the dialog box. The program will then generate a setup that behaves just like useally autofolder setup. o Now rename (or copy) the old AUTO folder to a new one called NEW_AUTO. o Now make an empty AUTO-folder and copy AUTOEXEC.PRG to that. o Now try to reset the computer. Everything should start like it used to do. If you press the SPACE bar before the program has started - auto program execution will be bypassed. For a more advanced setup, take a look at the supplied AUTOEXEC.SYS. To understand the commands please read the next chapter. The AUTOEXEC.SYS files can be edited with an simple editor, such as FirstWord or Tempus. --------------------------------------------------------------------- / / / / / / / / THE PROGRAMMING LANGUAGE / / / / / / / / / / / / / / --------------------------------------------------------------------- The language is a line for line interpretor, that is build around simple one letter tokens. All commands can be part of a conditional statement. TOKEN MEANING ! Execute the program found at 'path' > Play the sample found at 'path'. P Print the message on the screen. W Print the message on the screen and wait for key. If a default key have been set then that will be returned, if no other have been pressed, without waiting for user action. D Set default Key (if no key in keyboard buffer us this) # Set number of bytes to keep free below sample This is default 100Kbyte. X Stop executing. ? Conditional, if more '?' follow, then the statement is true if one is conditions is true. ; Comment, also mean 'end of line' if used after other command. A line starts with a command or conditions followed by a command. Example 1: PIt is a nice day today. -this is selfexplaning. (Print the message) Example 2: WPress a key : ?a?p?ePYou pressed a letter from the word 'APE' ?s>g:\sound\nt_comp\sounds\impact.seg -this will cause the computer to wait for a key. If the key is 'a' or 'p' or 'e' it will print the message. If 's' was pressed then the computer will load the file 'impact.seg' and play it. Any other key will cause no action. Adding the line: Ds will change the program so that it don't wait for the user to press a key but, instead uses 's' if no other key have been pressed. If you had pressed a key before the 'W' command then that would have been used instead of the default. A default key can also be used in an conditional, like in: ?a?b?cDq ?q!program1.prg ?d?q!program2.prx This will run the program 'program2' if 'a', 'b', 'c' or 'd' have been pressed, and 'program1' if 'a', 'b' or 'c' have been pressed... --------------------------------------------------------------------- / / / / / / / / THE SAMPLES FILES / / / / / / / / / / / / / / / / / / / / --------------------------------------------------------------------- This program uses the sample format introduced by the PD-program, NT_COMP, called SEGM-files. A SEGM-sample is always in signed binary, and there is information about the playback frequency in the file, which makes this program much more 'clean'. NT_COMP can convert all kinds of sample files in to SEGM format. --------------------------------------------------------------------- / / / / / / / / TECHNICAL BITS / / / / / / / / / / / / / / / / / / / --------------------------------------------------------------------- This program uses the XBRA protocol to take the SOUND_VECTOR. It uses the ID 'zexc', when the sample is playing the routine don't chain to the original routine. That is restored when the sample stops. All programs are started from lowest possible memory with all memory allocated to it, even if a sample is loaded. The reason for this is that the *legal* way to enlarge the screen memory or allocate memory in the top of TPA is to allocate all memory except the amount you are interested in allocating, and then allocate that. The reason that the programs isn't loaded about the sample is that most auto-programs stay resident, and that would cause fragmentation of the free memory when the sample is released again... When a sample is loaded, there is allocated a block of memory of that is big enough to hold both the free memory and the sample. When the sample have been loaded and started, the memory is released again. At this time no one owns it! Of course this will cause problems with virtual memory, but with virtual memory, we did not need to deallocate the memory again. (or think about fragmentation). WHAT DO *I* DO? --------------- I would like you to contribute with : Ideas (for further developments) and code that you think needs to be included (I need compression code, filters and such). If this program shall improve and grow, then I need your help! Send in BUG-reports (I can't test the program on your computer - I need your help to do that!). If there is a thing you think is backward or silly let me know, _DO_NOT_ say "this is obvious, someone else have told him", tell me yourself! There are 3 ways to contact me : SNAIL MAIL EMAIL VOICE PHONE Klaus Pedersen micro@imada.dk 66 15 58 79 Nyborgvej 217 4.TH. (from Denmark) DK-5220 Odense Sē Denmark. What language should you write to me in? I prefer C and Assembler, and I don't understand a word Basic. You can fill in with Scandinavian, English and Modern (Computer) German...