Jump to content
kool kitty89

Using Pulse Density Modulation for 8-bit PCM

Recommended Posts

Haven't forgotten about the FAT player, BTW, and have been working on it a little this evening. I now have an EXE version of the FAT browser and I will bolt the already written IDE player code to it in the next few days. Can hardly wait to see if it works. :)

  • Like 4

Share this post


Link to post
Share on other sites

IDE player appears to work. Currently testing with 8MB interleaved raw file and will upload a video later. Interleaved format appears to be the way to go. Player is rough but once it's acceptable I'll upload it here. ;)

  • Like 8

Share this post


Link to post
Share on other sites

IDE player appears to work. Currently testing with 8MB interleaved raw file and will upload a video later. Interleaved format appears to be the way to go. Player is rough but once it's acceptable I'll upload it here. ;)

 

This will be so, soooo cool :thumbsup: :) .

 

Will the player eventually be integrated into the Side and XEL Loaders? It would be especially cool to be able to select a song, hit return, and have it play.

Share this post


Link to post
Share on other sites

It's a stand-alone application, but it has the same UI as the XEX loader and can be launched from same. I think at length it would be a good idea to have a simpler toolchain for creating PDM files and some kind of file header containing metadata, etc.

  • Like 2

Share this post


Link to post
Share on other sites

Hello Jon

 

Will your IDE player only work with certain devices or would it be possible to use it with for instance the MIO or Blackbox too?

 

Sincerely

 

Mathy

Share this post


Link to post
Share on other sites

Sorry the audio quality sucks as usual:



File is 8MB long and plays for some minutes (although I cut it short here, since you get the general idea). Still sufficient space left for monitoring keystrokes, etc, so perhaps some scanning functionality could be added. Most laborious part is building a table of cluster addresses by scanning the file's entire FAT chain (resulting table contains some 2,000 LBA values for this file).

Will your IDE player only work with certain devices or would it be possible to use it with for instance the MIO or Blackbox too?


I'm not as intimately familiar with SCSI as I am with IDE, but I see no reason why not, although much depends on seek times if you're using anything but solid state media. The delay allowed by this player for the IDE controller's data buffer to become ready (some 30,000 plus machine cycles) is overkill, though, so there's probably some headroom. One could - at the expense of more complexity in the player and the file format - allow for longer device seek times, but I have no idea if that would even be necessary.

 

At the moment, the player may be compiled on demand for SIDE/SIDE2, Incognito (although the 800 appears to have issues playing the samples), and 1088XEL/XEL-CF, and versions for IDE Plus 2.0, MYIDE II, etc, would be easy to produce. Some way to go before the player is even remotely 'polished', however, but I will upload it soon for general evaluation. There is no dependency whatsoever on U1MB or any other RAM expansion, so - for instance - 65XE and SIDE2 will do just fine.

Edited by flashjazzcat
  • Like 15

Share this post


Link to post
Share on other sites

Hello Jon

 

It's been a while, but IIRC the biggest difference between SCSI and IDE, command wise, is that you have to select a drive number (and a LUN, which usually is "0") when using SCSI.

 

Sincerely

 

Mathy

Share this post


Link to post
Share on other sites

Ah yes: I just looked it up and LUN is rather more sophisticated that IDE's simple device selection bit (which allows only a primary and secondary drive). The LUN hierarchy is rather reminiscent of the device/controller hierarchy described by Drac030 in his XDCB specification (which is faithfully implemented by APT compatible firmwares and drivers).

Share this post


Link to post
Share on other sites

Hello Jon

 

How much does APT differ from (AT)ASPI?

And does your IDE Player access the media at the FAT level or is the FAT stuff handled by a different routine?

 

Sincerely

 

Mathy

Share this post


Link to post
Share on other sites

APT is just a partitioning scheme (like MBR or GPT; indeed APT co-exists with MBR), although the specification cross-references the details of Konrad's XDCB. An APT implementation may employ any device protocol (IDE, ASPI, etc) in a hardware abstracted fashion.

 

Unfortunately when playing 8-bit samples, hardware abstraction is a luxury we can't afford, so the player drives the hardware directly. The player accesses the hard disk at the raw sector level and handles MBR, FAT, etc, entirely in software.

 

The PDM player builds a large table of LBA sector addresses of each FAT cluster in the file before playback commences. Therefore - during playback - we're just dealing with a plain list of sector numbers.

  • Like 5

Share this post


Link to post
Share on other sites

Here's something to test with SIDE/SIDE2:

 

PDM_Player_alpha_SIDE.zip

 

Just drop the XEX and the PDM file into a FAT partition and run the PDM.XEX application using the XEX loader. You can run it from the SDX command line as well but the player loads at $1000 at the moment, so an exit to DOS is unlikely to be successful. It exits back to the SIDE loader just fine, though.

 

I refrained from uploading the crude interleaving tool I wrote in C the other day since I'm certain Xuel can leverage a far superior toolchain. :) To recap: every 512 byte block (i.e. physical sector) of the file should be arranged thus:

 

Byte $000

Byte $100

Byte $001

Byte $101

 

...

 

Byte $0FF

Byte $1FF

 

No checks are currently made on file size, so anything larger than 16MB will probably crash the player. Partitions may be formatted FAT16 or FAT32. An unsophisticated stop byte in the cluster table currently signifies the end of the stream to the player, and handling that throws the cycle count off once per sector, but these things can be corrected later. I have no doubt that file browser will be full of bugs, since it's an aggressive and quick conversion of the ROM-based XEX loader.

 

Nice as the provided tune is, I'll be rather relieved to hear something different. :)

 

  • Like 6

Share this post


Link to post
Share on other sites

Here's something to test with SIDE/SIDE2:

 

attachicon.gifPDM_Player_alpha_SIDE.zip

 

 

Nice as the provided tune is, I'll be rather relieved to hear something different. :)

 

Deleted because I am a dumb ass that cannot read. Let me try this in my SIDE2 cart :)

Share this post


Link to post
Share on other sites

Very cool! Would it be possible to make this work on SD card readers? I'm wondering if I can get it working on the EclaireXL if I expose the SD card SPI registers somewhere (or have some glue logic to make it look like compact flash), allowing direct Atari partitions etc. Is there any sort of standard for this?

  • Like 1

Share this post


Link to post
Share on other sites

OK, is there possiility to play those PDM samples correctly from .car file?

Share this post


Link to post
Share on other sites

OK, is there possiility to play those PDM samples correctly from .car file?

 

No (and why?), if you're referring to the IDE player. It needs new files interleaved in the way I described.

 

Very cool! Would it be possible to make this work on SD card readers? I'm wondering if I can get it working on the EclaireXL if I expose the SD card SPI registers somewhere (or have some glue logic to make it look like compact flash), allowing direct Atari partitions etc. Is there any sort of standard for this?

 

Had several Polish hardware projects not fallen off the earth, I would probably have a PBI driver already written which drives SD carts via SPI, but as it stands the performance is a bit of an unknown quantity. That's why I'm hedging my bets on IDE emulation on some of these newer MCU-based, SD card multi-carts. If you can do IDE emulation in accordance with the ATA specs, then that would be ideal. The only ATA commands used are Identify Device, Set Features, Read Sector and Write Sector (plus device reset). Any IDE emulation need not worry about Atari partitions (the standard being APT), since all partition and logical drive stuff is handled by the 6502 (this is also true of the XEX loader on which the PDM player is based).

Edited by flashjazzcat

Share this post


Link to post
Share on other sites

Here's something to test with SIDE/SIDE2:

 

attachicon.gifPDM_Player_alpha_SIDE.zip

 

Just drop the XEX and the PDM file into a FAT partition and run the PDM.XEX application using the XEX loader. You can run it from the SDX command line as well but the player loads at $1000 at the moment, so an exit to DOS is unlikely to be successful. It exits back to the SIDE loader just fine, though.

 

I refrained from uploading the crude interleaving tool I wrote in C the other day since I'm certain Xuel can leverage a far superior toolchain. :) To recap: every 512 byte block (i.e. physical sector) of the file should be arranged thus:

 

Byte $000

Byte $100

Byte $001

Byte $101

 

...

 

Byte $0FF

Byte $1FF

 

No checks are currently made on file size, so anything larger than 16MB will probably crash the player. Partitions may be formatted FAT16 or FAT32. An unsophisticated stop byte in the cluster table currently signifies the end of the stream to the player, and handling that throws the cycle count off once per sector, but these things can be corrected later. I have no doubt that file browser will be full of bugs, since it's an aggressive and quick conversion of the ROM-based XEX loader.

 

Nice as the provided tune is, I'll be rather relieved to hear something different. :)

 

As usual, I'm begging for an internal MyIDE version ;-)

 

p.s.

and MyIDE (Slave drive-only version)

It's easier for me to get to my Slave CF card. (Don't ask!)

 

p.p.s

...unless the program is very easy to patch with a different address for IDE registers

Edited by a8isa1

Share this post


Link to post
Share on other sites

It's a five minute job to compile builds for MYIDE, XEL, etc. Got side-tracked with a firmware bug. :)

 

Will upload the other builds tomorrow.

  • Like 4

Share this post


Link to post
Share on other sites

Hello Jon

 

How long will it to compile a BlackBox build?

 

Sincerely

 

Mathy

Share this post


Link to post
Share on other sites

Here's something to test with SIDE/SIDE2:

 

Nice as the provided tune is, I'll be rather relieved to hear something different. :)

 

Yes I would also like to have more tune's to play on my SIDE/SIDE2 ..

  • Like 1

Share this post


Link to post
Share on other sites

Just drop the XEX and the PDM file into a FAT partition and run the PDM.XEX application using the XEX loader. You can run it from the SDX command line as well but the player loads at $1000 at the moment, so an exit to DOS is unlikely to be successful. It exits back to the SIDE loader just fine, though.

Could you point me to step-by-step instructions for setting this up in Altirra? I tried creating a 300MB FAT VHD with the files and adding a SIDE 2 device (w/ sload129.rom) pointing to it but when I run the XEX, the screen goes haywire:

 

post-21021-0-82423900-1527061592.png

 

post-21021-0-79616900-1527063300.png

I'm running the XEX by dragging it to Altirra. Do I need to run it from DOS/SDX?

 

I refrained from uploading the crude interleaving tool I wrote in C the other day since I'm certain Xuel can leverage a far superior toolchain. :) To recap: every 512 byte block (i.e. physical sector) of the file should be arranged thus:

Working on it... :)

  • Like 1

Share this post


Link to post
Share on other sites

Looks like BASIC is enabled, and the player is so crude it currently does not disable it for you. But in any case you should launch the player from the SIDE loader. I'll upload a set of ROMs for you later on, but since the player doesn't use the Altirra settings and is geared for real hardware, it doesn't sound great in the emulator.

Edited by flashjazzcat
  • Like 1

Share this post


Link to post
Share on other sites

PDM Stereo: Is this a possibility?

 

I asked this question a while back, and didn't see a reply.

 

Could this be implemented for Stereo Pokey boards, and if so what would get compromised if anything?

  • Like 3

Share this post


Link to post
Share on other sites

How long will it to compile a BlackBox build?

A long time, probably. I'd have to read up on the SCSI protocol and invest time I don't currently have in testing it.

 

Could you point me to step-by-step instructions for setting this up in Altirra?

U1MB_Xuel.zip

 

Go to System->Configure System->Firmware->Firmware Manager, then "Add", navigate to U1MB.ROM, and set the type to Ultimate 1MB, making sure you "Set as default".

 

Your VHD should be formatted FAT16 or FAT32, without or without MBR partition table, and should have the player and the sample file in it. Boot the emulated machine, pressing 'L' to start the loader. Go to the Options menu in the loader and turn off internal BASIC, then in the launcher menu (rocket), hit enter on PDM.XEX and then use a very similar interface inside the player to do the same thing with the sample file.

Share this post


Link to post
Share on other sites

H

 

Here's something to test with SIDE/SIDE2:

 

attachicon.gifPDM_Player_alpha_SIDE.zip

 

Just drop the XEX and the PDM file into a FAT partition and run the PDM.XEX application using the XEX loader. You can run it from the SDX command line as well but the player loads at $1000 at the moment, so an exit to DOS is unlikely to be successful. It exits back to the SIDE loader just fine, though.

 

...

i test it on real hardware an it works great.

 

But if you press a key the auto search function starts and the screen get overwritten with data and the loader crash.

 

Regards

Thomas

Share this post


Link to post
Share on other sites

But if you press a key the auto search function starts and the screen get overwritten with data and the loader crash.

If you can crash the loader by invoking a search, I'd be interested to know how to reproduce the issue here, since this is the first I heard of any issue. Even a screenshot of the crash would be useful, since I'm not aware of any problem.

 

If it's the player crashing, then I would not be in the least surprised, meanwhile. :)

Share this post


Link to post
Share on other sites

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Guest
Reply to this topic...

×   Pasted as rich text.   Paste as plain text instead

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

Loading...

  • Recently Browsing   0 members

    No registered users viewing this page.

×
×
  • Create New...