home *** CD-ROM | disk | FTP | other *** search
/ Chip 2011 November / CHIP_2011_11.iso / Programy / Inne / Gry / Enigma / Enigma-1.01-w7.exe / reference / soundset.lua < prev    next >
Encoding:
Text File  |  2009-12-13  |  6.6 KB  |  189 lines

  1. --
  2. -- This file demonstrates how to add a sound set to Enigma.
  3. --
  4. -- Sound effects are triggered by so-called "sound events". These sound
  5. -- events usually have a name (like "dooropen") and an associated location
  6. -- (the coordinates of the door) which affects the way a sound effect is
  7. -- played.
  8. --
  9. -- The sound event is converted into a real sound effect using tables
  10. -- similar to the one below.  Each entry in the table is either a string
  11. -- like "enigma/st-coinslot", which is interpreted as the file
  12. -- "soundsets/enigma/st-coinslot.wav" with some default properties, or a
  13. -- list of sound attributes enclosed in curly braces "{ ... }".
  14. --
  15. -- Here is a complete example of such an attribute list:
  16. --
  17. --      dooropen = { file="my_soundset/open-door", volume=0.9, priority=4 },
  18. --
  19. -- The meaning of these attributes is as follows:
  20. --
  21. --      file     - Path and name of the sound file for this event, without
  22. --                 the".wav" extension.
  23. --
  24. --      volume   - The sound volume: 1.0 is standard, 0.0 is silent.
  25. --
  26. --      priority - If many effects are active at the same time, high-priority
  27. --                 effects can replace lower-priority effects. Use an integer
  28. --                 between 1 and 10 (default 1). This property does not yet
  29. --                 work within Enigma 1.01.
  30. --
  31. --      global   - Either "true" or "false".  If true, no stereo effects are
  32. --                 applied and there is no attenuation.  Used for menu sound,
  33. --                 level end sounds, etc. Default is "false".
  34. --
  35. --      loop     - "true" or "false".  If true, the sound repeats infinitely
  36. --                 until canceled. Default is "false". 
  37. --
  38. --      damp_max, damp_inc, damp_mult, damp_min, damp_tick
  39. --               - Parameters for sound damping.  Sounds from noisy objects
  40. --                 like light passengers are damped to reduce the noise.
  41. --                 For this, the sound event's frequency is estimated.
  42. --                 damp_max calibrates the maximal damping factor (high means
  43. --                 quiet), damp_inc how fast the damping accumulates,
  44. --                 damp_mult is an overall factor, damp_min defines a lower
  45. --                 bound for the damping entries (beyond which they are
  46. --                 removed from memory) and damp_tick the factor that's
  47. --                 applied all 0.1 seconds. See sound.hh for details.
  48. --                 Defaults: 10.0, 1.0, 1.0, 0.5, 0.9.
  49. --
  50. -- To design a new sound set, proceed as follows.
  51. --
  52. -- 1) Create a new folder containing this file (named "soundset.lua")
  53. --    and the wav files you want to use.  
  54. --
  55. -- 2) Move this new folder into Enigma's "soundsets" folder in your user path.
  56. --    (Possibly you have to create it.) The directory structure should look
  57. --    something like this:
  58. --
  59. --      (user path)/soundsets/my_sounds/
  60. --                                     /soundset.lua
  61. --                                     /a.wav
  62. --                                     /b.wav
  63. --                                     ...
  64. --
  65. -- 3) Run Enigma.  Since this file's sound set does not map any sound effect
  66. --    to a wav file, you should hear nothing.
  67. --
  68. -- 4) Edit the contents of this file to your liking.  You can access the
  69. --    default sound files in the "soundsets/enigma" directory, e.g.:
  70. --        ...
  71. --        coinsloton = { file="enigma/st-coinslot" },
  72. --        ...
  73. --    When using own sound files, remember to add the subfolder, like in
  74. --        ...
  75. --        coinsloton = { file="my_sounds/b" },
  76. --        ...
  77. --    No extension ".wav"! It's added automatically. Make sure that the
  78. --    extension is in lower case letters.
  79. --
  80. -- 5) Replace "MY_SOUNDSET" by a suitable variable name, and "My Soundset"
  81. --    by the name you want to see in the sound options menu.  Remember to
  82. --    make it short enough to fit on the button.
  83. --
  84. -- If you need inspiration, take a look at "sound-defaults.lua" shipped with
  85. -- Enigma, which contains the default sound table.
  86. --
  87. -- If you have questions, don't hesitate to ask.  Have fun!
  88. --
  89.  
  90. soundtable_MY_SOUNDSET = {
  91.     [""]           = "",        -- empty sound
  92.     ballcollision  = "",
  93.     blackbomb      = "",
  94.     blockerdown    = "",
  95.     blockerup      = "",
  96.     booze          = "",
  97.     bumper         = "",
  98.     cloth          = "",
  99.     coinslotoff    = "",
  100.     coinsloton     = "",
  101.     crack          = "",
  102.     doorclose      = "",
  103.     dooropen       = "",
  104.     drown          = "",
  105.     dynamite       = "",
  106.     electric       = "",
  107.     exit           = "",
  108.     extinguish     = "",
  109.     fakeoxyd       = "",
  110.     falldown       = "",
  111.     fart           = "",
  112.     finished       = "",
  113.     floordestroy   = "",
  114.     fourswitch     = "",
  115.     glass          = "",
  116.     hitfloor       = "",
  117.     impulse        = "",
  118.     intro          = "",
  119.     invrotate      = "",
  120.     itemtransform  = "",
  121.     jump           = "",
  122.     jumppad        = "",
  123.     landmine       = "",
  124.     laserloop      = "",
  125.     laseron        = "",
  126.     laseroff       = "",
  127.     lock           = "",
  128.     magneton       = "",
  129.     magnetoff      = "",
  130.     mail           = "",
  131.     menuexit        = "",
  132.     menumove        = "",
  133.     menuok          = "",
  134.     menustop        = "",
  135.     menuswitch      = "",
  136.     metal          = "",
  137.     mirrorturn     = "",
  138.     movebig        = "",
  139.     moveslow       = "",
  140.     movesmall      = "",
  141.     oxydclose      = "",
  142.     oxydopen       = "",
  143.     oxydopened     = "",
  144.     pickup         = "",
  145.     puller         = "",
  146.     puzzlerotate   = "",
  147.     rubberband     = "",
  148.     scissors       = "",
  149.     seedgrow       = "",
  150.     shatter        = "",
  151.     shattersmall   = "",
  152.     shogunoff      = "",
  153.     shogunon       = "",
  154.     skull          = "",
  155.     spade          = "",
  156.     squish         = "",
  157.     stone          = "",
  158.     stonedestroy   = "",
  159.     stonepaint     = "",
  160.     stonetransform = "",
  161.     swamp          = "",
  162.     switchmarbles  = "",
  163.     switchoff      = "",
  164.     switchon       = "",
  165.     switchplayer   = "",
  166.     sword          = "",
  167.     thief          = "",
  168.     triggerdown    = "",
  169.     triggerup      = "",
  170.     turnstileleft  = "",
  171.     turnstileright = "",
  172.     umbrellaoff    = "",
  173.     umbrellaon     = "",
  174.     umbrellawarn   = "",
  175.     unlock         = "",
  176.     vortexclose    = "",
  177.     vortexopen     = "",
  178.     warp           = "",
  179.     whitebomb      = "",
  180.     wood           = "",
  181.     yinyang        = "",
  182. }
  183.  
  184. -- Remove "--" from the line below to add missing sound entries
  185. -- from the default sound set.
  186. --copy_missing (soundtable_enigma, soundtable_MY_SOUNDSET)
  187.  
  188. AddSoundSet ("My Soundset", soundtable_MY_SOUNDSET)
  189.