home *** CD-ROM | disk | FTP | other *** search
/ M.u.C.S. Disc 2000 / MUCS2000.iso / sound / mp2_099 / help.txt < prev    next >
Encoding:
Text File  |  1998-10-09  |  7.7 KB  |  210 lines

  1.    This is MP2AUDIO 0.99alpha version, released to the public on
  2. 9th October 1998, but it was only told to a few number of people
  3. who were selected as testers. Consider yourself lucky. ;)
  4.  
  5. This alpha version contains a number of known bugs, and most likely
  6. even more unknown bugs. 
  7.  
  8. So, what's new in this version? Well, just about everything with the
  9. interface, and nothing at all with the DSP player. The appearance of
  10. the GEM interface is very much the same as the last version. One
  11. button has been replaced, namely the count direction button which now
  12. contains a lambda symbol, to symbolize the integrated script language
  13. which now controls large parts of the player. The language is called
  14. Shoe, and is written by Fredrik Noring. It's contructed to be a small
  15. and easily extendable LISP like language. 
  16.  
  17. Large parts of the C code has been replaced by Shoe functions or
  18. combinations of Shoe functions. All buttons and control keys are
  19. controlled via Shoe. This means that you can map the control keys and 
  20. buttons to any function you like. It is not possible to change the
  21. icons on the buttons right now, but this might be implemented in a 
  22. later version.
  23.  
  24. The mp2audio.sho file has also replaced the configure file that was
  25. previously used. With this alpha version, not all configure functions 
  26. have been implemented in Shoe yet. You can't set which clock to use, 
  27. automatic detection will always be used. Time slice and buffer size
  28. is constant, unless you recompile the program, of course. If you ask
  29. me nicely, I might recompile a new version with the values you want, 
  30. if you're not happy with the current values. 
  31.  
  32. Right now, the program _needs_ the mp2audio.sho to be in the same 
  33. directory as the program file, or no mappings of the buttons and keys
  34. are made, and you can't do anything but to end the program. This will
  35. change later, and the basic functions will be mapped by the program
  36. itself. 
  37.  
  38. When you start the program, with the mp2audio.sho file included in this
  39. package, it will behave very much like the previous versions. By pressing
  40. control+j you will enter Jukebox mode. In this mode, when you load a song
  41. it is pushed into a play list, and by pressing the play button, it will
  42. play the first song on the list. Following presses on the load or play
  43. button will not stop the current song, but only push the new selected
  44. song onto the play list. To change to next song, press the next button. 
  45. This will start playing the first song in the play list, and remove it
  46. from the list at the same time. The previous button hasn't been mapped
  47. in Jukebox mode. 
  48.  
  49. I suggest that you read through the mp2audio.sho file and try to figure
  50. out as much as possible what it does. I'll try to list the most common
  51. Shoe functions here, but I'll probably miss some of them.
  52.  
  53. When you press the lambda button, a console window will pop up. This is
  54. a very simple line editor with a history list. When you enter expressions
  55. you can break lines at any place a normal space would have been inserted.
  56. Since LISP, and therefore also Shoe, contains a lot of parantheses, these
  57. might be difficult to keep track of. The console prints the number of
  58. unclosed parantheses as a number before the prompt. Expressions will be
  59. evaluated when the parantheses are in balance. 
  60.  
  61. Shoe uses lists for most thing. These are written as:
  62.   (element1 element2 element3)
  63. where the elements can be numbers, symbols or lists.
  64. Functions are used by writing a list with the function name as the first
  65. element and its arguments as the following ones. Exemple:
  66.   (+ 1 2 3)
  67.  
  68. Numbers are only integers. Symbols may not begin with a number.
  69. For the following examples, assume that "test" is a list containing
  70. three elements, a, b and c, like this:
  71.     > test
  72.     (a b c)
  73.  
  74. True and false values are represented as #t and #f respectively.
  75.  
  76. Values inside "" are quotes, which means the value should not be evaluated.
  77.  
  78. Shoe internal functions:
  79.  
  80. +    Add the arguments.
  81. -    Subract the arguments three and forward from the first.
  82. /    Divide the first argument with the arguments three- multiplicated
  83.     with each other.
  84. *    Multiply all arguments.
  85. %    Give the rest of a division, i.e. modulo.
  86.  
  87. car    Return the first element or a list.
  88.     > (car test)
  89.     a
  90.  
  91. cdr    Return the list that remains if the first element is removed.
  92.     > (cdr test)
  93.     (b c)
  94.  
  95. if    If expression is true, do the true-statement, otherwise do the
  96.     false-statement.
  97.     > (if expression true-statement false-statement)
  98.     [result of true- or false-statement]
  99.  
  100. cond    Set up a number of statements which are selected using a number
  101.     of conditions.
  102.     > (cond ((equal a 0) 0)
  103.     1> ((equal a 1) 2)
  104.     1> (#t 3))
  105.     [0 if a=0, 2 if a=1 and 3 otherwise]
  106.  
  107. cons    Put an element in the first position of a list.
  108.     > (cons "q" test)
  109.     (q a b c)
  110.  
  111. define    Define a new function. Functions can only do one expression now,
  112.     but with the "begin" statement, several can be used.
  113.     > (define fac (n)
  114.     1> (if (< n 1) 1
  115.     2>   (* n (fac (- n 1)))))
  116.     fac
  117.     
  118.     This means the function 'fac' has been defined and it takes one
  119.     argument, n. Use the function like this:
  120.     > (fac 5)
  121.     120
  122.     
  123. begin    Combine several statements, evaluate them all in order, and return
  124.     the value of the last one.
  125.     > (begin (fac 2) (fac 3))
  126.     6
  127.     
  128. equal    Returns #t if both arguments are equal and #f otherwise.
  129.  
  130. eval    Evaluate a statement.
  131.     > (eval test)
  132.     #ERR.
  133.     
  134.     Bad example, but it tries to use (a b c) as a function call, with
  135.     'a' being the function name and 'b' and 'c' as its arguments.
  136.  
  137. sort    Sort a list in alphabetical increasing order.
  138.     > (sort (cons "q" test))
  139.     (a b c q)
  140.     
  141.  
  142. MP2AUDIO specific functions:
  143.  
  144. pwd    Return the current directory in a list.
  145.     > (pwd)
  146.     (d:\mp2\jarre\)
  147.  
  148. cd    Change the current directory, relative, or absolute and return the
  149.     new directory.
  150.     > (cd "zoolook")
  151.     (d:\mp2\jarre\zoolook)
  152.  
  153. ls    Return the files in the current directory as a list. An argument
  154.     may be used to 'ls', and is the search mask, e.g. "*.mp?".
  155.     > (ls)
  156.     (. .. 02diva.mp2 01ethni.mp2)
  157.     > (ls "*.mp2")
  158.     (02diva.mp2 01ethni.mp2)
  159.  
  160.     'ls' does not sort the files in alphabetical order, but only list
  161.     them as they appear on the disk. To sort, use the 'sort' function:
  162.     > (sort (ls "*.mp2"))
  163.     (01ethni.mp2 02diva.mp2)
  164.     
  165.  
  166. mp2-play        Play the loaded song, if any.
  167. mp2-stop        Stop the currently playing song.
  168. mp2-pause        Pause or unpause the current song.
  169. mp2-load        Load a song with the filename as argument.
  170. mp2-fast-forward    Fast forward the currently playing song.
  171. mp2-loop        Set loop or not loop the current song.
  172. mp2-window-info        Open the Info window.
  173. mp2-window-console    Open the Console window.
  174. mp2-select        Open a fileselector and return the choosen name
  175.             or #f if none was choosen.
  176.  
  177. mp2-countdown        Toggle counting direction of time. If argument #t
  178.             or #f are given, set the direction accordingly.
  179. mp2-display-time    Toggle (or set) if the time should be displayed
  180.             in the title of the main window.
  181. mp2-title        Set the title of the main window.
  182. mp2-subtitle        Set the subtitle of the main window. This is where
  183.             the song name of the current song is usually written.
  184.  
  185. The following are functions that is being called by the program
  186. if the respective button is being pressed down:
  187.  
  188. mp2-icon-play
  189. mp2-icon-stop
  190. mp2-icon-pause
  191. mp2-icon-load
  192. mp2-icon-next
  193. mp2-icon-previous
  194. mp2-icon-fast-forward
  195. mp2-icon-loop
  196. mp2-icon-info
  197. mp2-icon-console
  198.  
  199. control-key-?    Replace the '?' with any letter, a-z or A-Z, and that
  200.         function is called when control+? key is pressed. Capital
  201.         control-key functions are called when shift is also pressed.
  202.  
  203. mp2-hook-finitum    This function is called when the current song has
  204.             stopped playing.
  205.  
  206.  
  207. The file mp2audio.sho contains some other common LISP functions, such as
  208. 'list', 'assoc', 'member', boolean operations and more. Have a look at
  209. the file.
  210.