home *** CD-ROM | disk | FTP | other *** search
/ NetNews Offline 2 / NetNews Offline Volume 2.iso / news / comp / sys / amiga / programmer / 4238 < prev    next >
Encoding:
Text File  |  1996-08-05  |  4.7 KB  |  135 lines

  1. Newsgroups: comp.sys.amiga.programmer
  2. Path: surfnet.nl!sun4nl!hguijt
  3. From: hguijt@solair1.inter.NL.net (Hans Guijt)
  4. Subject: Re: MIDI + C + AMIGA !!
  5. Message-ID: <DnDooB.Ctt@solair1.inter.NL.net>
  6. Organization: NLnet
  7. X-Newsreader: TIN [version 1.2 PL2]
  8. Date: Mon, 26 Feb 1996 10:19:23 GMT
  9.  
  10. >> Ok, so maybe quality would suffer, but you could always buy a Toccata and
  11. >> use the Delitracker Toccata driver. In the mean time the rest of us could
  12. >> at least play those songs.
  13. >
  14. >Albeit without being able to do anything else at the same time onthe
  15. >majority of achines.
  16.  
  17. Ah-ha! So now we are down to 'majority' rather than 'impossible'. That's
  18. good, I like making progress ;-)
  19.  
  20. I have an MSX machine next to my Amiga. I have a soundplayer on it that I
  21. like to run occasionally, even though it is singletasking. It's just that I
  22. like the sound it makes.
  23.  
  24. >> So? Alien Breed 3D uses 8 notes polyphony and manages to run a complete
  25. >> Doom-style engine at the same time! 24 note polyphony isn't basically
  26. >harder
  27. >> or slower (a little over three times slower I would say - that would leave
  28. >> enough power for me to do what I usually do with my machine).
  29. >
  30. >Have you actually thought about this?  "I can do 8-note, so 24-note is no
  31. >problem ".  From this, we can say "24-note is no problem,. so we can do
  32. >72-note easily".
  33.  
  34. A little bit, yes. Let's examine the problem from another direction -
  35. suppose I want to build a program like this, I would start with something
  36. like:
  37.  
  38. - Resample channel #1 for the next period
  39. -    "        "    #2  "   "   "      "
  40. ...
  41. - Mix channels #1..#n into one hardware channel
  42. ...
  43.  
  44. Now, when playing 8-note music we have to resample 8 channels, while playing
  45. 24 notes obviously requires 24 resampling passes (in other words, exactly
  46. three times as slow). The mixing routine will be more complex, but then
  47. again this is an extremely simple routine anyway:
  48.  
  49.     move.l    #Buf1,a0
  50.     move.l    #Buf2,a1
  51.     move.l    #Buf3,a2
  52.     ...
  53.     move.l    #Dest,a6
  54.     move.w    #BufSize,d0
  55.     moveq    #0,d1
  56.     moveq    #0,d2
  57.  
  58. .x    move.b    (a0)+,d1
  59.     move.b    (a1)+,d2
  60.     add.w    d2,d1
  61.     move.b    (a2)+,d2
  62.     add.w    d2,d1
  63.     ...
  64.     lsr.w    #(2 or 3),d1
  65.     move.b    d1,(a6)+
  66.     dbra    d0,.x
  67.  
  68. This (rather awful) piece of code (or something similar to it) will do the
  69. job, and will not take that many more cycles when more channels must be
  70. mixed in.
  71.  
  72. >Running GMPlay on my machine at home (`020, 10Mb RAM) DOES virtually lock up
  73. >the entire system.  The system is NOT useable whilst the program is running.
  74. >Fact.  Sorry if you do not like this, but there we are.
  75.  
  76. That's because the author uses Forbid during the sampling stage. The problem
  77. is with the programming, not with the actual technique. He deliberately
  78. chooses to take down the machine - and you are right, I do not like this.
  79.  
  80. >> Care to explain why any of these are hard to do? As far as I can tell
  81. >these
  82. >> are just standard music commands for adjusting volume and frequency, which
  83. >> are fairly standard (one might even say 'essential') on any other music
  84. >> playing system. Really, there is no magic in midi.
  85. >
  86. >They all take extra time to process.  Processing power and time which is
  87. >just
  88. >not there on an 020-based machine...
  89.  
  90. Oh, now I understand: a format like S3M *DOESN'T* contain information to
  91. adjust volume and frequency! That probably explains why I can play such
  92. well-sounding S3M songs on my lowly '030.
  93.  
  94. It's the resampling that takes most time in routines such as these, the
  95. other bits are minor details in comparison. In the end any songformat comes
  96. down to a long list of 'Play sample #n at frequency #f and volume #v'-type
  97. commands. Perhaps MIDI utilises a harder system than others (although I
  98. doubt it) but it would explain the conversion being carried out before the
  99. song starts playing.
  100.  
  101. >> Explain this then: I have an 8 channel song running in the background
  102. >right
  103. >> now. It sounds excellent and it causes no noticable slowdown on my machine
  104. >> (a4030).
  105. >
  106. >A4000 / 030, presumably.  == much more processor power than on an A1200.
  107. >Think about it.
  108.  
  109. It's about 4 times faster than an a1200 without fastram. That means a
  110. routine like this could use 25% CPU time and it would still run fine on such
  111. a machine. Only thing is, it uses far less than 25%...
  112.  
  113. >("Hey, I can run Breathless at 1x1 full sscreen on my A4000/040 so you
  114. >should have
  115. >no problems on an A1200"...)
  116.  
  117. Breathless does (let's take a guess) ...25fps on an a4040? And assuming it's
  118. about 20 times as fast as an a1200 that would put the a1200 machine on about
  119. 2..3 fps.
  120.  
  121. >GMPlay is a good program, of that there is no doubt.  However, it is NOT
  122. >suited
  123. >to playing GM midi files whilst multitasking on all but the most powerful
  124. >of machines
  125. >(certainly true on my `020 at home, and my A4000/040 here in the office).
  126.  
  127. I never said GMPlay is fit for doing that - I said it is a good start, but a
  128. better MIDI player (one that multitasks) is feasible.
  129.  
  130.  
  131. Bye,
  132.  
  133. Hans
  134.  
  135.