Subversion Repositories Kolibri OS

Rev

Blame | Last modification | View Log | Download | RSS feed

  1. MIDAMP for Menuet v1.0       July 29, 2005
  2.  Written in pure assembler by Ivushkin Andrey aka Willow
  3.  
  4. Monophonic MIDI player
  5.  
  6. Vivat assembler et MENUETOS!
  7. MenuetOS still has a poor sound capabilities. Drivers are written for a few
  8. soundcard models. Till recently I considered MEOS to be as voiceless as an
  9. oyster. But then an alternative appeared; dear VaStaNi wrote kernel support of
  10. PC speaker. Old good times of Pascal and MS-DOS came to me again. About 5 years
  11. ago I wrote a Pascal application that parsed and played a note string in QBasic
  12. syntax.
  13.  
  14. Now MeOS gets the simplest, speaker-driven sound scheme in Mario79's distro,
  15. but the first melody in Menuet I heard was from the my program MIDAMP in
  16. December, 2004. On technical reasons its release takes place only now.
  17.  
  18. So, MIDAMP is the simplest single-voiced MIDI player. It cannot do much though
  19. it resembles the famous WinAmp. All it can do is to beep MIDI files.
  20. There are no equalizer, balance and fader, and they won't appear. Moreover,
  21. I may guarantee the correct sound only for files having a single track, one
  22. instrument channel and within technological range of notes :-(
  23.  
  24. #########
  25. System requirements:
  26. 1. Kernel having following function implemented:
  27.        55/55 - PC speaker interface (critical!)
  28.        67    - window shading;
  29.        66/3  - for extended mouse selection in playlist.
  30. 2. SYSXTREE version not below 52 - opening files and directories (critical!)
  31. 3. RAM amount for application - about 150 Kbytes.      
  32. #########
  33.  
  34. MIDAMP still uses a single playlist - /HD/1/PLAYLIST.TXT by default. Persons
  35. interested can change the PLAYLIST_PATH constant value in MIDAMP.ASM. Playlist
  36. is a simple text file having filenames to be played in each line. It is NOT
  37. RECOMMENDED to edit the playlist by hand - bugs may appear while loading MIDAMP.
  38.  
  39. When started, MIDAMP creates a new thread whose job is actually playing. Early
  40. versions had main thread that processed everything, therefore unpleasant sound
  41. delays appeared when managing the playlist. Threads communicate intensively
  42. through IPC, although I think it's an excess in such a case. But it works not
  43. bad.
  44.  
  45. MIDAMP is able to shade to window header by pressing the proper button. I tried
  46. to perform complete minimization through mcall 18,10 (new feature of Kolibri4),
  47. but ran into the problem while restoring of window when PANEL button pressed.
  48. That function possibly does not support windows type II ?
  49.  
  50. Hotkeys - almost like in WinAmp:
  51.  
  52. Del - delete the selected tracks;
  53. z   - previous track;
  54. x, Enter, double click - play selected file;
  55. c, Space - pause;
  56. v   - stop;
  57. b   - next track;
  58.  
  59. Esc - close the program;
  60. m   - sound on/off;
  61. PgUp, PgDn - swap 2 tracks (not completed!);
  62. BackSpace  - rewind track;
  63. Home/End - increase/decrease melody notes offset and play track from beginning
  64.     (it is shown near 'tone>' text).
  65.    
  66. In the case of polyphonic MIDI, if an intelligent melody isn't heard, you may
  67. try to choose another track 'trk' or instrument channel 'chnl', pressing '[' or
  68. ']' accordingly and then a number key from '0' to '9'. The file will be played
  69. from the beginning. To reset track and channel to the default value, press '\' .
  70.  
  71. Explaining some interface buttons:
  72. Shuffle toggles random playback on/off. Repeat - current track will loop again
  73. and again. An icon in the top left corner outputs a brief info about the
  74. program to the Debug Board. Clicking the time toggles its view - from beginning
  75. or from the end of file.
  76.  
  77. Mouse click on playlist when holding Shift or Ctrl button works like in WinAmp.
  78.  
  79. Remarks to bottom buttons:
  80. 'Add URL' not implemented, on clear reasons;
  81. 'Add Dir' - specify any file in the directory desired. *.MID and *.KAR files of
  82.      that directory will be added to the list;
  83. 'Misc' submenu is not implemented;
  84. 'New List' does nothing. MIDAMP still uses a fixed playlist.
  85.  
  86. One of the following flags may precede a filename in the commandline:
  87.  
  88. W - to load a file and wait (default);
  89. P - to play a file;
  90. H - to start shaded and close after playback.
  91.  
  92. To-Do list:
  93.  
  94. 1.  Increase playlist size (40 items for now).
  95. 2.  Add dialog to select tracks of polyphonic melodies including analysis on
  96.     notes.
  97. 3.  Reading text in Karaoke files.
  98. 4.  Playlist select.
  99. 5.  Note editor, as in Ringtone Editor.
  100. 6.  Add comments to source.
  101. 7.  Correct bugs to be found.
  102.  
  103. Special thanks to:
  104.  
  105.    VaStaNi - there would be no need of MIDAMP w/o his code
  106.    Standard MIDI Files 0.06        March 1, 1988
  107.    MIDI 1.0 Specification
  108.    General MIDI Level Spec
  109.    MIDI SAMPLE DUMP STANDARD
  110.    Standard MIDI File Format by Dustin Caldwell
  111.    Files format of MIDI
  112.    The USENET MIDI Primer by Bob McQueer
  113.    Pavlushin Evgeny for his splendid SYSXTREE (DLGS.INC is the opendialog macro
  114.        of ASCL library edited to meet MIDAMP specific needs)
  115.  
  116. Send the wishes and bug reports to wil_low@hotbox.ru or to the meos.sysbin.com
  117. forum.
  118.  
  119. See you later!
  120.  
  121.  
  122. ****************************************
  123. ****************************************
  124.  
  125. MIDAMP ¤«ï Menuet v1.0       29 ¨î«ï 2005 £.
  126.   ¯¨á ­  ­  ç¨á⮬  áᥬ¡«¥à¥ ˆ¢ã誨­ë¬ €­¤à¥¥¬ (Willow)
  127.  
  128. Œ®­®ä®­¨ç¥áª¨© MIDI-¯«¥¥à
  129.  
  130. Vivat assembler et MENUETOS!
  131. ‘® §¢ãª®¬ ¢ MenuetOS â㣮 ¤® á¨å ¯®à. „à ©¢¥à  ­ ¯¨á ­ë ¤«ï ®£à ­¨ç¥­­®£® ªà㣠
  132. §¢ãª®¢ëå ª àâ. „® ­¥¤ ¢­¥£® ¢à¥¬¥­¨ MeOS ¡ë«  ¤«ï ¬¥­ï ­¥¬ , ª ª àë¡ . ® ¯®â®¬
  133. ¯®ï¢¨« áì  «ìâ¥à­ â¨¢  - 㢠¦ ¥¬ë© VaStaNi ­ ¯¨á « ¯®¤¤¥à¦ªã PC ᯨª¥à . Œ­¥
  134. áࠧ㠢ᯮ¬­¨«¨áì áâ àë¥ ¤®¡àë¥ ¢à¥¬¥­   áª «ï ¨ MS-DOS. ‹¥â 5 ­ § ¤ ­ ¯¨á «
  135. ­   áª «¥ ¯à®£à ¬¬ªã, ª®â®à ï ¯ àᨫ ,   ¯®â®¬ ¢®á¯à®¨§¢®¤¨«  áâப㠭®â ¢
  136. ᨭ⠪á¨á¥ QBasic.
  137.  
  138. ‘¥©ç á MeOS ¢ ¤¨áâਡã⨢¥ Mario79 ®¡à¥â ¥â ¯à®á⥩èãî §¢ãª®¢ãî á奬ã á ¯®¬®éìî
  139. ᯨª¥à , ­® ¯¥à¢ãî ¬¥«®¤¨î ¢ Menuet ï ãá«ëè « ¢á¥-â ª¨ ®â ᢮¥© ¯à®£à ¬¬ë -
  140. MIDAMP ¢ ¤¥ª ¡à¥ 2004 £®¤ . ® â¥å­¨ç¥áª¨¬ ¯à¨ç¨­ ¬ ¥¥ ५¨§ ¯à®¨á室¨â ⮫쪮
  141. ᥩç á.
  142.  
  143. ˆâ ª, MIDAMP - ¯à®á⥩訩 ®¤­®£®«®áë© MIDI-¯à®¨£à뢠⥫ì. Ž­ ­¥ ¯à¥â¥­¤ã¥â ­ 
  144. ¬­®£®¥, å®âì ¨ ¯®å®¦ ­  WinAmp. ‚á¥, çâ® ®­ 㬥¥â, íâ® ¯¨«¨ª âì MIDI-ä ©«ë.
  145. ª¢ « ©§¥à , ¡ « ­á  ¨ ॣã«ïâ®à  £à®¬ª®á⨠­¥â ¨ ­¥ ¯à¥¤¢¨¤¨âáï. ®«¥¥ ⮣®,
  146. ª®à४⭮¥ §¢ãç ­¨¥ ¬®£ã £ à ­â¨à®¢ âì «¨èì ¤«ï ä ©«®¢ á 1 â४®¬, 1 ª ­ «®¬
  147. ¨­áâà㬥­â  ¨ ¢ ¯à¥¤¥« å â¥å­®«®£¨ç¥áª®£® ¤¨ ¯ §®­  ­®â :-(
  148.  
  149. #########
  150. ‘¨á⥬­ë¥ âॡ®¢ ­¨ï:
  151. 1. Ÿ¤à® á ॠ«¨§ æ¨¥© á«¥¤ãîé¨å á¨á⥬­ëå ä㭪権:
  152.        55/55 - ¨­â¥à䥩á PC ᯨª¥à  (­¥®¡å®¤¨¬®!);
  153.        67    - ᢮à ç¨¢ ­¨¥ ®ª­  ¢ § £®«®¢®ª;
  154.        66/3  - ¤«ï ०¨¬®¢ ¢ë¤¥«¥­¨ï â४®¢ ¬ëèìî.
  155. 2. SYSXTREE ¢¥àᨨ ­¥ ­¨¦¥ 52 - ®âªàë⨥ ä ©«®¢ ¨ ª â «®£®¢ (­¥®¡å®¤¨¬®!)
  156. 3. Ž¡ê¥¬ ¯ ¬ï⨠¤«ï ¯à®£à ¬¬ë - ®ª®«® 150 Š¡.      
  157. #########
  158.  
  159. ®ª  çâ® MIDAMP ¨á¯®«ì§ã¥â ¥¤¨­á⢥­­ë© ¯«¥©«¨áâ - ¯® 㬮«ç ­¨î
  160. /HD/1/PLAYLIST.TXT. †¥« î騥 ¬®£ãâ ¨§¬¥­¨âì §­ ç¥­¨¥ ª®­áâ ­âë PLAYLIST_PATH ¢
  161. ä ©«¥ MIDAMP.ASM. «¥©«¨áâ - ®¡ëç­ë© ⥪áâ®¢ë© ä ©«, ¢ ª ¦¤®© áâப¥ ª®â®à®£®
  162. ­ å®¤¨âáï ¨¬ï ä ©«  ¤«ï ¢®á¯à®¨§¢¥¤¥­¨ï. …£® … …ŠŽŒ…„“…’‘Ÿ ¯à ¢¨âì ¢àãç­ãî -
  163. ¢®§¬®¦­ë ¡ £¨ ¯à¨ ¯®á«¥¤ãî饩 § £à㧪¥ ¥£® ¯à¨«®¦¥­¨¥¬.
  164.  
  165. à¨ § ¯ã᪥ MIDAMP ᮧ¤ ¥â ­®¢ë© ¯®â®ª, § ¤ ç¥© ª®â®à®£® ï¥âáï ᮡá⢥­­®
  166. ®§¢ã窠. ‚ à ­­¨å ¢¥àá¨ïå ¢á¥ ¤¥« « £« ¢­ë© ¯®â®ª, ¯®í⮬㠢®§­¨ª «¨ ­¥¯à¨ïâ­ë¥
  167. § ¤¥à¦ª¨ ¢ §¢ãç ­¨¨ ¢® ¢à¥¬ï ã¯à ¢«¥­¨ï ¯«¥©«¨á⮬. ®â®ª¨ ¨­â¥­á¨¢­® ®¡é îâáï
  168. ¬¥¦¤ã ᮡ®© ç¥à¥§ IPC, å®âï ï ᪫®­ïîáì ª ⮬ã, çâ® ¢ ¤ ­­®¬ á«ãç ¥ íâ®
  169. ¨§«¨è¥á⢮. ® à ¡®â ¥â ­¥¯«®å®.
  170.  
  171. MIDAMP 㬥¥â ᢮à ç¨¢ âìáï ¢ áâப㠧 £®«®¢ª  ­ ¦ â¨¥¬ ᮮ⢥âáâ¢ãî饩 ª­®¯ª¨.
  172. Ÿ ¯ëâ «áï ᤥ« âì ¯®«­®¥ ᢮à ç¨¢ ­¨¥ ç¥à¥§ mcall 18,10 (­®¢ ï ä¨ç  Kolibri4),
  173. ­® á⮫ª­ã«áï á ¯à®¡«¥¬®© ¢®ááâ ­®¢«¥­¨ï ®ª­  ­ ¦ â¨¥¬ ª­®¯ª¨ PANEL. ‚®§¬®¦­®,
  174. äã­ªæ¨ï ­¥ ¯®¤¤¥à¦¨¢ ¥â ®ª­  ⨯  II ?
  175.  
  176. ƒ®àï稥 ª« ¢¨è¨ - ¯®ç⨠ª ª ¢ WinAmp:
  177.  
  178. Del - 㤠«¨âì ¢ë¤¥«¥­­ë¥ â४¨;
  179. z   - ¯à¥¤ë¤ã騩 â४;
  180. x, Enter, ¤¢®©­®© 饫箪 ­  ä ©«¥ - ¢®á¯à®¨§¢¥¤¥­¨¥;
  181. c, Space - ¯ ã§ ;
  182. v   - á⮯;
  183. b   - á«¥¤ãî騩 â४;
  184.  
  185. Esc - § ªàëâì ¯à®£à ¬¬ã;
  186. m   - ¢ª«îç¨âì/¢ëª«îç¨âì §¢ãª;
  187. PgUp, PgDn - ¯®¬¥­ïâì ¬¥áâ ¬¨ 2 á®á¥¤­¨å â४  (­¥ § ª®­ç¥­®!);
  188. BackSpace - ¯¥à¥¬®âª  â४  ¢ ­ ç «®;
  189. Home/End - 㢥«¨ç¨âì/㬥­ìè¨âì â®­ «ì­®áâì ¬¥«®¤¨¨ ¨ ¯à®¨£à âì ¥¥ á ­ ç « 
  190.     (®â®¡à ¦ ¥âáï à冷¬ á ­ ¤¯¨áìî 'tone>').
  191.    
  192. ‚ á«ãç ¥ ¯®«¨ä®­¨ç¥áª¨å MIDI, ¥á«¨ ®á¬ëá«¥­­®© ¬¥«®¤¨¨ ­¥ ¯®«ãç ¥âáï, ¬®¦­®
  193. ¯®¯à®¡®¢ âì ¢ë¡à âì ¤à㣮© â४ 'trk' ¨«¨ ª ­ « ¨­áâà㬥­â  'chnl', ­ ¦ ¢
  194. ᮮ⢥âá⢥­­® '[' ¨«¨ ']' ¨ § â¥¬ ª« ¢¨èã á ­®¬¥à®¬ ®â 0 ¤® 9. ” ©« ¡ã¤¥â
  195. ¢®á¯à®¨§¢¥¤¥­ á á ¬®£® ­ ç « . ‘¡à®á ¤®à®¦ª¨ ¨ ª ­ «  ¢ §­ ç¥­¨¥ ¯® 㬮«ç ­¨î -
  196. ­ ¦ â¨¥¬ '\' .
  197.  
  198.  §­ ç¥­¨¥ ­¥ª®â®àëå ª­®¯®ª ¨­â¥à䥩á :
  199. Shuffle - á«ãç ©­ë© ¯®à冷ª ¯à®¨£à뢠­¨ï â४®¢. Repeat  - ⥪ã騩 â४ ¡ã¤¥â
  200. ¯à®¨£à뢠âìáï á­®¢  ¨ á­®¢ . ‡­ ç®ª ¢ «¥¢®¬ ¢¥àå­¥¬ 㣫㠢뢮¤¨â ªà âªãî
  201. ¨­ä®à¬ æ¨î ® ¯à®£à ¬¬¥ ­  ¤®áªã ®â« ¤ª¨. ™¥«ç®ª ­  ¢à¥¬¥­­®© ¬¥âª¥ ¬¥­ï¥â
  202. ᯮᮡ ¥¥ ®â®¡à ¦¥­¨ï - á ­ ç «  ¨«¨ á ª®­æ  ä ©« .
  203.  
  204. ™¥«ç®ª ¬ëèìî ­  ¯«¥©«¨áâ¥ á ­ ¦ âë¬ Shift ¨«¨ Ctrl à ¡®â ¥â  ­ «®£¨ç­® WinAmp.
  205.  
  206. ‡ ¬¥ç ­¨ï ®â­®á¨â¥«ì­® ª­®¯®ª ¢­¨§ã:
  207. 'Add URL' ­¥ ॠ«¨§®¢ ­® ¯® ¯®­ïâ­ë¬ ¯à¨ç¨­ ¬;
  208. 'Add Dir' - 㪠¦¨â¥ «î¡®© ä ©« ¢ ¦¥« ¥¬®¬ ª â «®£¥. ” ©«ë *.MID ¨ *.KAR í⮣®
  209.      ª â «®£  ¡ã¤ãâ ¤®¡ ¢«¥­ë ¢ ᯨ᮪;
  210. 'Misc' ¯®¤¬¥­î ­¥ ॠ«¨§®¢ ­®;
  211. 'New List' ­¨ç¥£® ­¥ ¤¥« ¥â. ®ª  ¨á¯®«ì§ã¥âáï 䨪á¨à®¢ ­­ë© ¯«¥©«¨áâ.
  212.  
  213. ‚ ª®¬ ­¤­®© áâப¥ ¯¥à¥¤ ¨¬¥­¥¬ ä ©«  ¤«ï ¢®á¯à®¨§¢¥¤¥­¨ï ¬®¦¥â áâ®ïâì ®¤¨­ ¨§
  214. ä« £®¢:
  215.  
  216. W - ¯à®áâ® § £à㧨âì ä ©« (¯® 㬮«ç ­¨î);
  217. P - ¢®á¯à®¨§¢¥á⨠䠩«;
  218. H - áâ à⮢ âì ᢥà­ãâë¬ ¢ § £®«®¢®ª, § ªàëâìáï ¯®á«¥ ¢®á¯à®¨§¢¥¤¥­¨ï.
  219.  
  220. —â® ¥é¥ ­ã¦­® ᤥ« âì:
  221.  
  222. 1.  “¢¥«¨ç¨âì à §¬¥àë ¯«¥©«¨áâ  (ᥩç á 40 ¯®§¨æ¨©).
  223. 2.  „®¡ ¢¨âì ¤¨ «®£ ¢ë¡®à  â४®¢ ¯®«¨ä®­¨ç¥áª¨å ¬¥«®¤¨© á ¨å  ­ «¨§®¬ ¯®
  224.     ­ «¨ç¨î ­®â.
  225. 3.  —⥭¨¥ ⥪áâ  ¢ ª à ®ª¥-ä ©« å.
  226. 4.  ‚ë¡®à ¯«¥©«¨áâ .
  227. 5.  ®â­ë© । ªâ®à, ª ª ¢ Ringtone Editor.
  228. 6.  Žâª®¬¬¥­â¨à®¢ âì ª®¤ (ª ª ¢á¥£¤ , «¥­ì).
  229. 7.  ˆá¯à ¢¨âì ¡ £¨, ª®â®àë¥, ­¥á®¬­¥­­®, ­ ©¤ãâáï ;-)
  230.  
  231. Žá®¡ë¥ ¡« £®¤ à­®áâ¨:
  232.  
  233.    VaStaNi - ¡¥§ ¥£® ª®¤  ­ ¯¨á ­¨¥ MIDAMP ­¥ ¨¬¥«® ¡ë á¬ëá« 
  234.    Standard MIDI Files 0.06        March 1, 1988
  235.    MIDI 1.0 Specification
  236.    General MIDI Level Spec
  237.    MIDI SAMPLE DUMP STANDARD
  238.    Standard MIDI File Format by Dustin Caldwell
  239.    ”®à¬ â ä ©«®¢ MIDI
  240.    The USENET MIDI Primer by Bob McQueer
  241.     ¢«îè¨­ã …¢£¥­¨î §  ­¥¯à¥¢§®©¤¥­­ë© SYSXTREE (DLGS.INC - ¯¥à¥à ¡®â ­­ë© á
  242.       ãç¥â®¬ ᯥæ¨ä¨ª¨ MIDAMP'a ¬ ªà®á opendialog ¡¨¡«¨®â¥ª¨ ASCL)
  243.  
  244. ®¦¥« ­¨ï ¨ á®®¡é¥­¨ï ®¡ ®è¨¡ª å ­ ¯à ¢«ï©â¥ ­  wil_low@hotbox.ru ¨«¨ ­  ä®àã¬
  245. meos.sysbin.com.
  246.  
  247. „® ­®¢ëå ¢áâà¥ç!