SD card MOD S3M soundtrack player on PIC32

Show off your projects to others!
serveurperso
Posts: 36
Joined: Tue Sep 13, 2011 5:55 am
Location: Paris
Contact:

Re: MOD/S3M soundtrack player on PIC32

Post by serveurperso » Wed Dec 07, 2011 1:06 pm

Hi, yes I received my two SPI SD Card reader, I would use the Microship library (if FAT32 is OK) or my own FAT16 code.

I just make another player highly optimised for S3M only (deliberately incompatible with .MOD for better pattern-streaming performances)

Playing some Purple Motion or other S3M I love it:)

- Realtime pattern unpacking to memory (100% working, pattern jump and break OK!)

- 100% accurate Scream Tracker 3 effects (soon!! I up. the code here when about 90% are OK)

- Player abuse-proof (http://schismtracker.org/wiki/Player%20abuse%20tests)

...

Pascal
Last edited by serveurperso on Sun Dec 11, 2011 1:01 pm, edited 1 time in total.
(French user) English is not my native language, please forgive my mistakes.

amiarts
Posts: 19
Joined: Sun Nov 27, 2011 11:05 am
Location: Dresden Germany
Contact:

Re: Amiga MOD soundtrack file player on PIC32

Post by amiarts » Wed Dec 07, 2011 8:40 pm

S3m would be even better!!! Can you call the code of the Fat Librarys sometimes post or a link?

Greeting René

serveurperso
Posts: 36
Joined: Tue Sep 13, 2011 5:55 am
Location: Paris
Contact:

Re: Amiga MOD soundtrack file player on PIC32

Post by serveurperso » Wed Dec 07, 2011 10:35 pm

amiarts wrote:S3m would be even better!!! Can you call the code of the Fat Librarys sometimes post or a link?

Greeting René
I need to create this code... or rip from google or :

Microchip Application Libraries :

http://www.microchip.com/stellent/idcpl ... e=en547784

http://www.schmalzhaus.com/MAL/Microchi ... _08_04.zip
This is just the Microchip folder from the MAL

Yes S3M is better (and XM or IT is way better), but a better composer can do anything in any format; check DOPE.mod :)

Pascal
Attachments
DOPE.zip
(332.86 KiB) Downloaded 165 times
(French user) English is not my native language, please forgive my mistakes.

fulvio
Posts: 19
Joined: Tue Nov 29, 2011 5:16 am

Re: Amiga MOD soundtrack file player on PIC32

Post by fulvio » Thu Dec 08, 2011 12:03 am

Absolutely, dope! :ugeek:

fulvio
Posts: 19
Joined: Tue Nov 29, 2011 5:16 am

Re: Amiga MOD soundtrack file player on PIC32

Post by fulvio » Fri Dec 09, 2011 12:12 pm

I wanna store these songs on my SD card! :cry:

serveurperso
Posts: 36
Joined: Tue Sep 13, 2011 5:55 am
Location: Paris
Contact:

Re: Amiga MOD soundtrack file player on PIC32

Post by serveurperso » Sat Dec 10, 2011 3:24 pm

fulvio wrote:I wanna store these songs on my SD card! :cry:
me too. I think the Uno32 will be too limited in RAM, large buffer size are needed for SD Card streaming for S3M, for MOD it's OK because don't need pattern unpacking.

My mini S3M engine is now accurate I uploaded on this thread -> http://www.youtube.com/watch?v=Gg9AeQXbcFM :D

I just found this for SD Card, very interesting :

http://elm-chan.org/fsw/ff/00index_e.html

PIC32MX implementation http://www.microchip.com/forums/m563218.aspx
-> NBIIFS.zip work on the PIC32MX

https://www.microchip.com/forums/m572924-p2.aspx -> DMA version (better for Writes but slower for read at this time)

Edit : Now I use MPLAB and an ICD3 but NBIIFS.zip is not very complicated to run on MPIDE, it's the best SPI SD Card solution for PIC32 at this time (last FatFs version:)

Edit2 : first working version of the SD Card MOD player, MPLAB only at this time.

Pascal
(French user) English is not my native language, please forgive my mistakes.

serveurperso
Posts: 36
Joined: Tue Sep 13, 2011 5:55 am
Location: Paris
Contact:

Re: MOD/S3M soundtrack player on PIC32

Post by serveurperso » Fri Dec 23, 2011 12:22 am

Playing MOD or S3M from SD Card is OK but I used MPLAB for my project.

http://www.youtube.com/watch?v=i3Yl0TISQBE
(French user) English is not my native language, please forgive my mistakes.

fulvio
Posts: 19
Joined: Tue Nov 29, 2011 5:16 am

Re: MOD/S3M soundtrack player on PIC32

Post by fulvio » Fri Dec 23, 2011 12:28 am

serveurperso wrote:Playing MOD or S3M from SD Card is OK but I used MPLAB for my project.

http://www.youtube.com/watch?v=i3Yl0TISQBE
Will this work with any compatible SD Card shield for chipKIT? Would love to see some source code and instructions on how to get it working with MPLAB.

serveurperso
Posts: 36
Joined: Tue Sep 13, 2011 5:55 am
Location: Paris
Contact:

Re: MOD/S3M soundtrack player on PIC32

Post by serveurperso » Fri Dec 23, 2011 10:28 pm

Source is here : http://www.serveurperso.com/temp/ multi files MPLAB project.

Do you have a PicKit3 programmer? do you know how to reinstall your arduino-bootloader.X.Max32.hex bootloader ? (it's easy).

SPI setup is here: sdmod32/fatfs/mmcPIC32.c

Code: Select all

/* Port Controls  (Platform dependent) */
#define CS_SETOUT() TRISFbits.TRISF12 = 0 
#define CS_LOW()  _LATF12 = 0	/* MMC CS = L */
#define CS_HIGH() _LATF12 = 1	/* MMC CS = H */
// Change the SPI port number as needed on the following 5 lines
#define SPIBRG  SPI4BRG
#define SPIBUF  SPI4BUF
#define SPISTATbits SPI4STATbits
#define SPI_CHANNEL SPI_CHANNEL4
#define SPICONbits SPI4CONbits
Update TRISFbits.TRISF12 -> SPI Chip Select pinMode (port F pin 12 to output)
LATF12 -> SPI Chip Select pin (port F pin 12)

And chose the SPI port 1 / 2 / 3 / 4...

Or send me your shield datasheet I check this...

Pascal
(French user) English is not my native language, please forgive my mistakes.

zerobyte
Posts: 2
Joined: Sun Nov 27, 2011 3:08 pm

Re: Amiga MOD soundtrack file player on PIC32

Post by zerobyte » Sat Dec 24, 2011 6:49 pm

serveurperso wrote:Hi, thanks:) you don't need float, fixed point DSP and multiply before divide give very good accuracy and way better performance, If you put a 16 bit DAC on my player you get exactly the sound of any tracker with "linear interpolation" setup. I use 10 bits for mantissa (#define DIVIDER 10)
Ok, interesting, I'll try to replace float by fixed but Im not sure it will be better :)
The main problem was the instrument player, play an instrument at specific frequency in run time is extremely long (even more on XMEGA which doesn't have euclidian div instruction, just a bull crap fraction mul instruction totally useless).
How do you play instrument at specific frequency? Any tricks? Or just convert amiga period to freq, and calculate step to play it?

Post Reply