Jump to content
IGNORED

FujiConvert 0.1


Xuel

Recommended Posts

is possible plays PDM on Rapidus (21MHz)

FAST1 equ 1<<6 ; 1.79Mhz for channel 1
FAST3 equ 1<<5 ; 1.79Mhz for channel 3
HI13 equ 1<<2   ; HiPass 1+3
 
mva #[FAST1|FAST3|HI13] AUDCTL
 
mva #5 AUDF3 ; Set up 1/16 dutycycle HiPass on 1+3
mva #3 AUDF1
 
sta STIMER
sta AUDF3

AUDF3=5, AUDF1=3 is proper only for CPU 6502 1.79 MHz ?

Edited by tebe
Link to comment
Share on other sites

The second write to AUDF3 should happen at least 4 cycles later than writing STIMER so you need to add an appropriate number of NOPs (or a delay loop) between sta STIMER and sta AUDF3. I'm not sure what the number of NOPs should be, maybe 21 / 1.79 * 4 / 2 = 23 NOPs, I'm guessing.

Edited by antrykot
  • Like 1
Link to comment
Share on other sites

You can't rely on accelerators running at a consistent speed. It depends on whether the CPU is running instructions from high speed memory, how often the Atari hardware chips are accessed, and whether the accelerator does write posting or simply syncs to the 1.79MHz bus for every write.

 

For this case, the timing requirements can be relaxed considerably by initially setting the timers to offsets from a large multiple of the period, such as 157 and 155 for 161 and 159 cycles. All that's required is that the difference between the two initial timer values establishes the correct phase offset, and then both timers are changed to the common period before they roll over after the initial period. That gives a much longer time to update the timer periods after STIMER, which will be adopted after each timers' next tick. Doing a few dummy hardware reads then ensures required delays after STIMER.

  • Like 3
Link to comment
Share on other sites

  • 3 weeks later...

Hehe,

 

after receiving two AVG carts, I can now successfully playback PDM (PCM 4+4) files with FJC's PDM player. The first thing I had to do was searching for some docs. regarding keys and key-combos, found them somewhere in one of the two AVG topics. http://atariage.com/forums/topic/278212-avgcart/page-9?do=findComment&comment=4055093 Then I downloaded all kinds of firmware I could find (would be great if a link to the latest AVG firmware and docs could be found at the start of the AVG topic) and finally update to the latest AVG firmware 013. http://avgcart.tmp.sk/files/atari/avgcart-0013.zip

 

Since my 16GB SD Sandisk Ultra was already formatted with FAT32, I created a folder named PDM...

- copied the pdm-player (PDM.xex) http://atariage.com/forums/topic/244946-using-pulse-density-modulation-for-8-bit-pcm/page-5?do=findComment&comment=4032449

- the SIDE XEX loader (S2load.car) http://atariage.com/forums/topic/278212-avgcart/page-8?do=findComment&comment=4053638

and several pdm files I had downloaded from AA into it. Then insert the SD-card into the AVG-cart and this into the A8 and power-on, goto the PDM folder, load the SIDE XEX loader, then load the PDM-player and finally choose a PDM file to play. Wow, simply wow ! Great sounds and quality. Too bad, that stereo can only use playback with 22khz, but still very impressive that a whole song with up to 12MB can be played off the SD card.

 

So now the PDM-player can be used from SIDE/SIDE-2 cart, UNO-cart and AVG-cart. Hopefully other carts (e.g. Ultimate) and enhancements (IDE-2/IDE+) can also use this fine player in the future. Its great what the AVG cart does for approx. 1/3 (one third!) of the price of an Ultimate cart.

Edited by CharlieChaplin
  • Like 6
Link to comment
Share on other sites

  • 2 weeks later...

FujiConvert 0.2.2:

  • Added sinc resampling (super slow)
  • Added SIC! cart support
  • Added preview wave file (always 8-bit regardless of method)

I'm using Ron Nicholson's Quick & Dirty Simple Slow ReSampling technique which is indeed brute-force and slow as advertised. Set resampling effort to "None" to disable.

 

Using "High" effort is enough to get a pretty clean chirp with a pretty clean cutoff. "Ultra" does a bit better. I'm using the sample from the Chirp Wikipedia page.

 

Linchirp.ogg.zip

Linchirp pcm4+4 mono 7800Hz sic pal high.zip

Linchirp pcm4+4 mono 7800Hz sic pal ultra.zip

The resampling effort just determines the window size for the sinc convolution:

  • Low = 16
  • Medium = 128
  • High = 256
  • Ultra = 1024

The cutoff frequency is hard-coded at 0.45 * output sample rate.

 

I would love (easy) suggestions for how to speed this up.

 

I added the preview wave file download to verify that the resampling was working. Playing the result in the browser via WebAudio ("Play" and "Stop" buttons) doesn't give a true picture because WebAudio doesn't resample so you get artifacts. That's the whole reason that I added explicit resampling in the first place. See also this post.

  • Like 6
Link to comment
Share on other sites

@Xuel:

 

Would it help (make the conversion process faster with Fuji Convert) if I:

 

- convert the sound into 8 Bit mono with 44khz or 8Bit stereo with 22khz first ? (done in 1 or 2 seconds)

- use Windows built-in (WAV) Audio-recorder (built-in with Win 3.x, built-in with Win XP, not sure if Win 7, 8 or 10 still has it) to convert into 8Bit WAV mono/stereo

- use Wavosaur (https://www.wavosaur.com/) to convert WAV or MP3 to 8Bit mono/stereo WAV and/or remove some noise (https://www.wavosaur.com/tutorials/how-to-remove-noise.php)

 

or would the converted file still sound annoying / noisy and not as good as with your SINC resampling (which takes approx. 1 hour when set to ultra)...?!? Besides, does Fuji Convert accept 8Bit WAV as audio input to be converted into PDM (PCM 4+4) ?!?

Edited by CharlieChaplin
  • Like 1
Link to comment
Share on other sites

@Xuel:

 

Three small feature requests based on what we tried in the past day @Fujiama:

- ROM versions should query the OPTION key during powerup and disable the cartridge to continue with regular booting.
This is the way AtariMax and The!Cart work. Otherwise you are stuck an cannot update the cartridge anymore without hotpluging or TurboFreezer.
- When exporting 32MB The!Cart files as .car, also export as .raw without header (and for raw only the actually used size in 8k steps).
This way the raw can be flashed effectively.

- Do not block the IRQs/NMIs on the title screen, so you have to chance to enter the Turbofreezer to check and see what's potentially wrong

  • Like 3
Link to comment
Share on other sites

@Xuel:

 

Would it help (make the conversion process faster with Fuji Convert) if I:

 

- convert the sound into 8 Bit mono with 44khz or 8Bit stereo with 22khz first ? (done in 1 or 2 seconds)

- use Windows built-in (WAV) Audio-recorder (built-in with Win 3.x, built-in with Win XP, not sure if Win 7, 8 or 10 still has it) to convert into 8Bit WAV mono/stereo

- use Wavosaur (https://www.wavosaur.com/) to convert WAV or MP3 to 8Bit mono/stereo WAV and/or remove some noise (https://www.wavosaur.com/tutorials/how-to-remove-noise.php)

 

or would the converted file still sound annoying / noisy and not as good as with your SINC resampling (which takes approx. 1 hour when set to ultra)...?!? Besides, does Fuji Convert accept 8Bit WAV as audio input to be converted into PDM (PCM 4+4) ?!?

 

What the high quality sinc resampler does, is that it removes all frequencies above n * target_sample_frequency where n is 0.45 in Xuel's code. If you want to avoid the long waiting time, you have to make sure your source material has the same properties. Example:

 

Source: 44.1 kHz 16-bit stereo wav

You want: 15.6 kHz 8-bit mono on the Atari

 

So, target_sample_rate is 15.6 kHz.

 

Load the source wav in your favorite (fast) audio processing tool. Use low-pass filtering with a cut-off point of 7020 Hz (0.45*15600) and as much dB per octave suppression of high frequencies. Optionally run it two or three times. Then save as 44.1 kHz 16-bit stereo wav.

 

Use that file as your source for FujiConvert and disable the sinc-resampler completely. End result should be similar. Well, it should be ;)

  • Like 3
Link to comment
Share on other sites

The loading bars are causing Firefox to use about 20% of a core even when not encoding. Looks like the animation styles are triggering constant style recomputation.

 

Pause seems to be broken as audio is distorted on resume -- high-pass phase offset is getting reset.

 

Regarding speeding up the resampler, what I do for Altirra's recording output filter is to precompute an array of filters at fixed phase steps and then linearly interpolate between adjacent filters (or equivalently, between the filtered results of adjacent filters). This doubles the dot product work but cuts out the expensive sinc and window function evaluations.

  • Like 3
Link to comment
Share on other sites

 

Some quick fixes:

 

FujiConvert 0.2.3:

  • Fixed PCM4+4 initialization after pause/resume
  • Removed CSS-animated progress bars that slowed down the browser
  • Fixed 7800Hz on Firefox

 

 

it do not work in my browser :( I change settings as i need, and nothing happens after mp3 choose. than i click to reconvert and stil nothing happens. and in the version desription in the left down corner i have only version X.X. iam using Edge, win10 (and it do not work on Chrome and IE too:( )

Edited by Poison
Link to comment
Share on other sites

FujiConvert 0.2.4:

  • Fixed issues found by Microsoft Edge

 

 

 

it do not work in my browser :( I change settings as i need, and nothing happens after mp3 choose. than i click to reconvert and stil nothing happens. and in the version desription in the left down corner i have only version X.X. iam using Edge, win10 (and it do not work on Chrome and IE too:( )

 

It works for me in Chrome, Firefox and Edge on Windows 10. Are you using the github.io site or running a local copy? If running locally, Chrome doesn't allow web workers when using the file:// interface so you'll need to use an HTTP server or run Chrome with --disable-web-security. If it still doesn't work for you, can you open the developer console and see if it reported an error?

  • Like 3
Link to comment
Share on other sites

  • 3 weeks later...

Well,

 

every now and then Fuji Convert (or the Browser?) spills out an "Error: Undefine..." when converting a WAV or MP3 into PDM (PCM 4+4) format. You may think then, that this music file cannot be converted into PDM format - but thats not the case! All you have to do is wait and try the same file a few hours or a day later and suddenly it works...

 

So maybe the Error should look like this: "Too busy! Try again later..." ?!? Having converted approx. 250 music files into PDM format right now, I got the mentioned error more than 10 times. When I got it for the first time, I converted the MP3 into WAV one day later and it suddenly worked. When I got the error again I converted MP3 into WAV once more, but at the same day (just a few minutes later) and the error still came up, so it had nothing to do with the music format. When I tried both formats one day later, both converted fine, so I guess, that whenever this error shows up, the converter is too busy or something else went wrong and its all good when you try again at a later time. So, to make a long story short: Don't give up, if converting your music file into PDM fails, try again one day later and it may work fine then...

 

(For example, I converted "Shine On You Crazy Diamond by Pink Floyd into PDM mono yesterday and it worked, converting into PDM stereo gave the "Error: Undefine..." message; tried it again today and the music file converted fine into PDM stereo. Since the result is approx. 28MB in length, I have to try if it works fine with the PDM player or not. The 23MB PDM file of "November Rain" by Guns N'Roses worked fine, so I have yet to see if I have a 24MB or 48MB file limit for playback with my AVG cart and 16GB Sandisk SD card...)

 

Still wishing for a PDM player by FJC that can play PDM in stereo and several musics in one go (aka a playlist), etc. - that would be really great !

Edited by CharlieChaplin
  • Like 1
Link to comment
Share on other sites

Well,

 

every now and then Fuji Convert (or the Browser?) spills out an "Error: Undefine..." when converting a WAV or MP3 into PDM (PCM 4+4) format. You may think then, that this music file cannot be converted into PDM format - but thats not the case! All you have to do is wait and try the same file a few hours or a day later and suddenly it works...

 

So maybe the Error should look like this: "Too busy! Try again later..." ?!? Having converted approx. 250 music files into PDM format right now, I got the mentioned error more than 10 times. When I got it for the first time, I converted the MP3 into WAV one day later and it suddenly worked. When I got the error again I converted MP3 into WAV once more, but at the same day (just a few minutes later) and the error still came up, so it had nothing to do with the music format. When I tried both formats one day later, both converted fine, so I guess, that whenever this error shows up, the converter is too busy or something else went wrong and its all good when you try again at a later time. So, to make a long story short: Don't give up, if converting your music file into PDM fails, try again one day later and it may work fine then...

 

(For example, I converted "Shine On You Crazy Diamond by Pink Floyd into PDM mono yesterday and it worked, converting into PDM stereo gave the "Error: Undefine..." message; tried it again today and the music file converted fine into PDM stereo. Since the result is approx. 28MB in length, I have to try if it works fine with the PDM player or not. The 23MB PDM file of "November Rain" by Guns N'Roses worked fine, so I have yet to see if I have a 24MB or 48MB file limit for playback with my AVG cart and 16GB Sandisk SD card...)

 

Still wishing for a PDM player by FJC that can play PDM in stereo and several musics in one go (aka a playlist), etc. - that would be really great !

 

If that message happens again, can you open up the console and see what file and line number it says the code failed on? When exactly does it occur? When you click on "choose file" or "reconvert"? During the conversion? During page loading?

 

Maybe the javascript didn't finish downloading when you tried it. There's a 6MB json file, players.js, that contains all of the player code. Or maybe the browser ran out of memory. Closing the tab and reopening might help.

 

BTW, all of the conversion happens on your local machine. So github's server is only busy while you're downloading the page. From that point on, everything is running in the browser.

Link to comment
Share on other sites

Well,

 

I always convert MP3 or WAV into mono 44khz first, then into stereo 22khz using the "reconvert" button (the program automat. sets the sample rate to 22khz when I choose stereo, still wondering if a higher sample rate would be possible in stereo). The error only happened when I tried to convert into stereo (with reconvert) and it always happened after loading, when it should "decode and resample"... it suddenly spilled out "Error: Undefine..."

 

And errm, I currently use only one tab and do not open any other tabs while converting the music into PDM. When I opened other tabs some weeks ago and made them active while converting, the converting process stopped until I came back (and made Fuji convert active again). So that is why I only open one tab - the Fuji Convert and don't do anything else in the meanwhile (okay, watching tv on my LCD tv and coming back to the PC when converting is finished). When the error happened, I simply loaded another website, but when I came back several minutes or hours later, Fuji Convert still showed my settings and the name of the last converted file, so when I tried converting again, the error still came up. Converting one day later worked then - guess I have to clear the cache or something like that ?!?

 

Besides, I am using an old and outdated OS on the PC, also known as WIN XP (32Bit with SP3), Firefox 52.9.0 esr (32Bit) and Java 7 (update 45)... ;-) Or do I need a newer Java version, e.g. Java 8 ?!?

Edited by CharlieChaplin
Link to comment
Share on other sites

Well,

 

I always convert MP3 or WAV into mono 44khz first, then into stereo 22khz using the "reconvert" button (the program automat. sets the sample rate to 22khz when I choose stereo, still wondering if a higher sample rate would be possible in stereo). The error only happened when I tried to convert into stereo (with reconvert) and it always happened after loading, when it should "decode and resample"... it suddenly spilled out "Error: Undefine..."

 

And errm, I currently use only one tab and do not open any other tabs while converting the music into PDM. When I opened other tabs some weeks ago and made them active while converting, the converting process stopped until I came back (and made Fuji convert active again). So that is why I only open one tab - the Fuji Convert and don't do anything else in the meanwhile (okay, watching tv on my LCD tv and coming back to the PC when converting is finished). When the error happened, I simply loaded another website, but when I came back several minutes or hours later, Fuji Convert still showed my settings and the name of the last converted file, so when I tried converting again, the error still came up. Converting one day later worked then - guess I have to clear the cache or something like that ?!?

 

Besides, I am using an old and outdated OS on the PC, also known as WIN XP (32Bit with SP3), Firefox 52.9.0 esr (32Bit) and Java 7 (update 45)... ;-) Or do I need a newer Java version, e.g. Java 8 ?!?

 

OK, I see. I suspect that there might be memory leak involving javascript Blobs. I suggest reloading the page after you've saved the mono 44kHz version and then converting to stereo 22kHz using "Browse..." again. In other words, avoid the "Reconvert" button when converting large files.

 

BTW, the version of Java shouldn't matter since FujiConvert only uses Javascript (which is totally different than Java).

Link to comment
Share on other sites

The strange thing is, this error does not always happen (e.g. it does NOT happen every second conversion), normally just every 10th or 20th conversion. Today I converted approx. 5 music files and then the error showed up again (but using the reconvert button worked fine before!). Went to the web-developer options in Firefox and under debugger, inspector, etc. I could see some sources, but not the line where it spilled out the error; a button named JS showed "uncaught exception: out of memory"...

 

Cleared the cache in Firefox (under extras, setup), but when I reloaded Fuji Convert, it still refused to convert the music file. So I closed Firefox and then executed C-Cleaner (which removes trash, temp files, etc.) and when I started Firefox and Fuji Convert again, it converted the same music file without any problems...

 

P.S.: When the error shows up, it does not matter then if I use "browse" or "reconvert" to try to convert the file once more - the error shows up again...

Edited by CharlieChaplin
Link to comment
Share on other sites

The strange thing is, this error does not always happen (e.g. it does NOT happen every second conversion), normally just every 10th or 20th conversion. Today I converted approx. 5 music files and then the error showed up again (but using the reconvert button worked fine before!). Went to the web-developer options in Firefox and under debugger, inspector, etc. I could see some sources, but not the line where it spilled out the error; a button named JS showed "uncaught exception: out of memory"...

 

Cleared the cache in Firefox (under extras, setup), but when I reloaded Fuji Convert, it still refused to convert the music file. So I closed Firefox and then executed C-Cleaner (which removes trash, temp files, etc.) and when I started Firefox and Fuji Convert again, it converted the same music file without any problems...

 

P.S.: When the error shows up, it does not matter then if I use "browse" or "reconvert" to try to convert the file once more - the error shows up again...

 

OK, the "out of memory" error strongly suggests a memory leak. Closing Firefox and restarting every so often should be sufficient. No need to clear cache as this is purely a RAM issue.

Link to comment
Share on other sites

  • 1 month later...

Soo, in the meanwhile I used "Fuji Convert" to convert approx. 500 songs into 4+4 PCM / PDM format. And I converted every song twice, first into mono, then into stereo. Now I would like to upload the converted A8 files somewhere, to be used for anyone with a UNO cart or SIDE/SIDE-2 cart or AVG cart. and Flashjazzcat's PDM-player...

 

Alas, there is a small or rather a big problem: If I upload around 500 songs to Atari Age in mono and stereo, thats 10.6 Gigabytes uncompressed (and only 20% less when compressed), so quite a lot. Furthermore, I am quite sure the record companies would sue Albert and this could be the end of Atari Age (and no-one wants that). Thought about uploading the stuff to some service companies like dropbox, etc. but errm, they also do not like it when someone is breaking the law and uploading hundreds of copyrighted songs. And then the record companies would sue me... oh well.

 

Looks like my 16GB card is formatted with 8k blocks/clusters, so 24MB is the limit for playing back PDM files for me now. Tried reformatting the SD-card, but WIN XP did not give me the option to choose a different block/cluster size than "standard" and that was 8k. Tried reformatting with a USB formatter program, but still no option there to use a bigger block/cluster size. Okay then, looking at the size of the ~500 songs, only 5 of them (thats one percent!) are bigger than 24MB, namely Stairway to Heaven (live version by Led Zeppelin), I'd do anything for love (album version by Meat Loaf), Pictures in the rear view mirror may appear closer than they are (album version by Meat Loaf), This Corrosion (album version by the Sisters of Mercy) and Shine on you crazy diamond (album version by Pink Floyd). So, with a 16GB card one can play more than 90% of PDM files (in my case even 99%). Still I would like to know, if there exists an SD-card formatter that lets me format the card with a block/cluster size I want (e.g. with 512b, 1k, 2k, 4k, 8k, 16k, etc.)... Have not converted the full-length (12 minutes) album version of Papa was a rolling stone (by the Temptations) yet, since I know quite well it would be over 24MB...

 

Someone suggested to me to use a Torrent to upload these ~500 converted songs, compress and decrypt them with a password, but I am still not sure, if this would protect me...

Edited by CharlieChaplin
  • Like 3
Link to comment
Share on other sites

If you have made archival copies of your music in a significantly degraded fashion, and aren't selling them and have put them in the cloud and encrypted as well as protected by a password it's perfectly legal, if others obtain a password or whatever and do whatever they do, it appears you have taken the proper steps to protect your archive. I don't see a problem.. if someone guessed it or did something your not responsible

 

since you are in need of space I could hold the music on a drive for you. It can be an open ftp server or torrent type server as it would be faster. since it's encrypted and password protected I don't have an issue with it.

Edited by _The Doctor__
Link to comment
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.
Note: Your post will require moderator approval before it will be visible.

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...