MOD-player on Propeller

overclockedoverclocked Posts: 80
edited September 2014 in Propeller 1 Vote Up0Vote Down
I've tried searching both forum and web but didn't find anything. Anyone tried implementing a Amiga Module player on the Propeller? Is it possible, any code available? How could one handle the samples? Streaming samples from SD-Card? using external SPI-SRAM?

Lets here what you experts has to say about this.

Comments

  • 21 Comments sorted by Date Added Votes
  • RaymanRayman Posts: 8,302
    edited September 2014 Vote Up0Vote Down
    I'm no expert, but mod appears to be a simple wavetable with PCM data. So, I think it should be fairly simple to implement.
    I've seen other wavetable players here but don't remember one for .mod format...
    Prop Info and Apps: http://www.rayslogic.com/
  • Ahle2Ahle2 Posts: 906
    edited September 2014 Vote Up0Vote Down
    It wouldn't be very hard at all and the quality (read sample rate) would be exellent because of the simplicity of the Paula in the Amiga. (it's technically waaaay simpler than the SID)
    If it had not been for the limited RAM in the Propeller, I would have done it long before SIDcog; Back in the days when the Propeller still was the coolest kitten in the neighbourhood. =^.^=
    Ariba started implementing a tracker on the Propeller some years ago, that used a SD card as "sample RAM". I think it was supposed to be able to play standard Amiga Sountracker/Protracker modules.

    Btw, when we are at it.... here is my favourite Amiga module :)
    SIDcog - The sound of the Commodore 64 in a single cog: Thread, OBEX, SIDcogMedlay.mp3
    AYcog - An emulation of the AY3-8910 / YM2149F PSG: Thread, OBEX
    SNEcog - An emulation of the SN76489 PSG(and variants): Thread, OBEX
    Propeller chiptune player: Thread
  • Chris SavageChris Savage Parallax Engineering Posts: 14,406
    edited September 2014 Vote Up0Vote Down
    My personal favorite was always Klisje Paa Klisje. It would be awesome to hear the Propeller Chip playing this.

    For that matter, long before there were tracker modules on the Amiga there was a program called, Sonix, and the demo song, "Jays Song" was very catchy. Here's a link: https://www.youtube.com/watch?v=ybZZXyZzOu0
    Chris Savage | Engineering Tech | Main Office: (916) 624-8333 | Direct to Tech Support: (888) 997-8267 | Website | Twitter | Google+
  • RaymanRayman Posts: 8,302
    edited September 2014 Vote Up0Vote Down
    How much memory does it need?
    Is this memory to hold all of the various wavetables?

    Would some particular song not need all the wavetables?
    Prop Info and Apps: http://www.rayslogic.com/
  • roglohrogloh Posts: 556
    edited September 2014 Vote Up0Vote Down
    This also has been of interest to me over the last year. It was actually on my todo list to attempt it on one of my projects and I spent some early time investigating mod playing requirements a while back but now I am diverted onto other things like DE0-nanos. It looked very tight but it just may be doable via streaming samples from a fast SDCARD for perhaps a 2-4 channel mod at decent sample rates. You need lots of COGs and it's a total real time/resource challenge to get it to fit on P1. It would be a fun and difficult project which is why I liked it. The only other way to go is with external RAM which would be simpler but perhaps wouldn't be so interesting or portable.

    I know it has been already been done for AVR chips. I think if someone can make it work from SD on a prop that would be a great challenge. Ahle2?

    ps. I will have to see what Ariba did. Any links?
  • roglohrogloh Posts: 556
    edited September 2014 Vote Up0Vote Down
    Rayman wrote: »
    How much memory does it need?
    Is this memory to hold all of the various wavetables?

    Would some particular song not need all the wavetables?

    Different songs need different amounts of memory, you are looking at upwards of 512k-1MB for a reasonable selection.
  • pik33pik33 Posts: 776
    edited September 2014 Vote Up0Vote Down
    We have now p1v on DE2-115. It has sufficient memory to handle a mod. The longest Amiga (not PC xm etc) module I have has about 700 kB. Most of them are 50..200 kB
  • RaymanRayman Posts: 8,302
    edited September 2014 Vote Up0Vote Down
    I see now the mod file contains both the wavetable samples and 4 channels of song data.
    Looks like there can be 32 wavetables, each up to 64 kB.

    Does seem like external memory might make that a lot easier...
    On the other hand audio is very slow and SD is fast...
    Prop Info and Apps: http://www.rayslogic.com/
  • pik33pik33 Posts: 776
    edited September 2014 Vote Up1Vote Down
    You can keep sample data in external memory. Track definitions are short and they can be keep in and interpreted from the hub ram.
  • Chris SavageChris Savage Parallax Engineering Posts: 14,406
    edited September 2014 Vote Up0Vote Down
    Yeah, back then there was a need to keep things small because we all had dial-up access to a BBS. No internet at the time. Most of the samples were 8-bit and low sample rate/quality. Still very impressive for the time though. I myself made several tracker mods in my C= days. Some are on my website (what I could find after all these years). But I wanted to add that many games on the Amiga used tracker modules for the music. The format was very popular.
    Chris Savage | Engineering Tech | Main Office: (916) 624-8333 | Direct to Tech Support: (888) 997-8267 | Website | Twitter | Google+
  • AribaAriba Posts: 2,092
    edited September 2014 Vote Up0Vote Down
    rogloh wrote: »
    This also has been of interest to me over the last year. It was actually on my todo list to attempt it on one of my projects and I spent some early time investigating mod playing requirements a while back but now I am diverted onto other things like DE0-nanos. It looked very tight but it just may be doable via streaming samples from a fast SDCARD for perhaps a 2-4 channel mod at decent sample rates. You need lots of COGs and it's a total real time/resource challenge to get it to fit on P1. It would be a fun and difficult project which is why I liked it. The only other way to go is with external RAM which would be simpler but perhaps wouldn't be so interesting or portable.

    I know it has been already been done for AVR chips. I think if someone can make it work from SD on a prop that would be a great challenge. Ahle2?

    ps. I will have to see what Ariba did. Any links?

    The link has to go directly to my harddisk, perhaps the NSA can help you with that :smile:

    My MOD player plays directly from SD card and uses one Spin cog to play the pattern, and one PASM cog for the sample player. There is also another cog for the fast SD card SPI routines, not sure if that also counts.

    The pattern data needs 1 kB per pattern, and up to 64 patterns are possible, so you can hold only the current pattern to play in hub memory, the whole song is still on the SD card.
    There are max. 31 instruments (single samples) each up to 64 kByte. Normally the samples are much shorter, so the whole sample memory is mostly under 250 kB.
    The sample player must be able to play 4 samples at the same time and change pitch and volume of every channel. Also a part of the sample must be played in a loop.

    There are some more informations in the RETRONITUS thread, also a screenshot of the Tracker. My intension was to make a Tracker and not just a MOD player, but I haven't finished the project because editing on the SD card was too hard. I think this needs a Propeller with min. 256 kB hub- or external RAM.

    Because there seems to be some interest, I took the player part and added a very simple menu via a Terminal (P.S.T. or PropTerminal). The SD and audio pins can be defined in the CON section, the default setting is for the Activity Board.

    Attached are 2 ZIP files. One containes the Spin files which you compile and load with the PropTool. Before that you need to extract the other ZIP to a fresh formated SD card. It holds a temp file and some MOD files.
    The SD card should be fresh (fornated) because all the files needs to get consecutive sectors otherwise the sample player will not work correct.
    But it anyway not works perfect, there is still a bug with the sample loops. I could not find the reason so far, so looped samples sound a bit bumpy or produce glitches.

    Enjoy
    Andy
  • AribaAriba Posts: 2,092
    edited September 2014 Vote Up0Vote Down
    I've just noticed that the audio output on the Activity Board is totally overdriven with the default settings, so please try it with a reduced Master Volume (set constant M_Vol to 3 or 4).
    I need to find the version with sample interpolation, I remember the quality was a bit better...

    Andy
  • overclockedoverclocked Posts: 80
    edited September 2014 Vote Up0Vote Down
    Your description sounds nice and thanks for sharing. I need to get my SD-Card connection sorted out before I can really test it.
  • roglohrogloh Posts: 556
    edited September 2014 Vote Up0Vote Down
    Ariba wrote: »
    The link has to go directly to my harddisk, perhaps the NSA can help you with that :smile:Andy
    LOL
    Attached are 2 ZIP files. One containes the Spin files which you compile and load with the PropTool. Before that you need to extract the other ZIP to a fresh formated SD card. It holds a temp file and some MOD files.
    The SD card should be fresh (fornated) because all the files needs to get consecutive sectors otherwise the sample player will not work correct.
    But it anyway not works perfect, there is still a bug with the sample loops. I could not find the reason so far, so looped samples sound a bit bumpy or produce glitches.

    Enjoy
    Andy

    Thanks Ariba! i'm going to take a look at it.
  • Oldbitcollector (Jeff)Oldbitcollector (Jeff) Posts: 8,083
    edited September 2014 Vote Up0Vote Down
    Chris, is this what you are looking for?

    http://modarchive.org/index.php?request=view_by_moduleid&query=47057

    My personal favorite was always Klisje Paa Klisje. It would be awesome to hear the Propeller Chip playing this.

    For that matter, long before there were tracker modules on the Amiga there was a program called, Sonix, and the demo song, "Jays Song" was very catchy. Here's a link: https://www.youtube.com/watch?v=ybZZXyZzOu0
    <br>
  • Chris SavageChris Savage Parallax Engineering Posts: 14,406
    edited September 2014 Vote Up0Vote Down
    I have the .MOD file on my PC along with hundreds of others, including .XM, .S3M, etc. I just didn't realize there was a Propeller MOD player.
    Chris Savage | Engineering Tech | Main Office: (916) 624-8333 | Direct to Tech Support: (888) 997-8267 | Website | Twitter | Google+
  • @Ariba

    Sorry to bring up an old thread. But, have you had any more progress on this? I would love to get a good MOD player going on a P1. I have 512K SRAM just waiting to play MOD's. :-D

    Also, how many channels do you think could be played in one COG?

    Thanks
  • cbmeeks wrote: »
    @Ariba

    Sorry to bring up an old thread. But, have you had any more progress on this? I would love to get a good MOD player going on a P1. I have 512K SRAM just waiting to play MOD's. :-D

    Also, how many channels do you think could be played in one COG?

    Thanks

    I have not worked on it since then. You know the Prop 2 would be the ideal processor for a MOD player ... and was only a few month away then ;)

    With 512kB SRAM connected to a Prop1 it should also be possible, but this needs about 29 pins! I planned to try it with an SPI-RAM (128kB) but too many other projects got in the way.

    How many channels? Depends a lot on how fast you can access the samples and on the sample frequency you want. Maybe 4..8, the classical MODs need only 4 channels.

    Andy
  • SPI-RAM might work for audio. I don't have any issues devoting an entire propeller for audio with its own 512K SRAM. But yeah, with 2 pins for audio out and maybe 2 pins for p1-to-p1 communication, I would have to latch some pins. Still worth it.

    What I'd like to do is have my I/O Propeller load music from SD over to the audio Propeller's SRAM and the audio Propeller would just have to play it. So I wouldn't need SD support on the audio propeller. Just maybe 2-3 pins for serial.

    Imagine 2 COGS running 4 channel Amiga MODS (8 channels) with 2 COGS running SID and maybe one COG running AY-3-8910.

    That would rock (no pun intended).

  • roglohrogloh Posts: 556
    edited July 28 Vote Up0Vote Down
    @Ariba,

    Hey Andy, I know its been ages but I finally had a chance to try out your test MOD file player posted above since I was mucking about with all that I2S audio stuff recently. I got it working however you are right there seems to be some audio quality problems with it compared to listening to a normal player in VLC for example. Although some of that might well be due to my SD card read speed. Regardless it was cool to hear that classic retro sounding wavetable sample music of the old demoscene coming from a propeller.

    When I get another chance to play about more I hope to code up something similar but either use SDRAM on P1V boards to hold larger audio samples or use my 1MB/2MB SRAM memory expansion board on the BeMicro MAX10 board for this. That 2MB should be more than suitable for holding pretty much any MOD/S3M file of interest, even 512kB-1M should be plenty for most songs.

    The other option as you mentioned is to try some (Q)SPI SRAM but they seem to top out at 128kB for some reason which is rather small.

    Thanks!
    Roger.
    ps. Also got your player working over the I2S bus too at its 62.5kHz sample rate.
  • Hi Roger

    I2s mod working on native propeller chip ?

    Is possible post this code ?

    Many thanks
Sign In or Register to comment.