Mod Archive Forums Mod Archive Forums
Advanced search  


Please note: Your main account will not work here, you must create a forum account to post on the forums.

Pages: [1]   Go Down

Author Topic: MOD files BPM and Temp parameters/commands  (Read 234 times)

0 Members and 1 Guest are viewing this topic.


  • Tasted the Pie
  • Offline Offline
  • Posts: 1
    • View Profile
MOD files BPM and Temp parameters/commands
« on: May 26, 2021, 08:52:39 »

Hello All! I have some 8 bit machine based on Z80 CPU. I try to write MOD player, but confront wirh a problem.
This 8 bit machine not have DMA and not have CIA or similar device. So, i need to work with samples and speed and bpm parameters in realrtime (or with tables). I need to convert BMP and speed to bytes per tick/row. I know about standart formula - speed/(BPM*2), but this is in milliseconds (or in Hz). But, i need to calculate - how many byutes i need to send in sound device per speed tick (or row). Can somebody help me?

Saga Musix

  • TMA Moderator
  • Too much pie
  • *****
  • Online Online
  • Posts: 2466
  • I love OpenMPT! And Modules! And TMA! And Pie! :>
    • View Profile
    • Saga Musix - free module music and more!
Re: MOD files BPM and Temp parameters/commands
« Reply #1 on: May 26, 2021, 22:48:22 »

With milliseconds, you're almost there, you just need one more calculation. First, you need to know the sample rate at which you're mixing. For example, if your sample rate is 48000 Hz, then 1 second (or 1000 milliseconds) will be 48000 samples long. So if your sound signal has 8-bit quality, that would be 48000 bytes, if it-s 16-bit quality then 96000 bytes and so on. So if your tick duration is 10ms, that would be 48000*10/1000=480 samples.
» My TMA artist profile
» Visit my music site: [de, en]
» Visit my programming website: [de]
» Open ModPlug Tracker
Pages: [1]   Go Up