Jump to content

Photo

TailChao's HandyMusic on cc65


17 replies to this topic

#1 karri ONLINE  

karri

    River Patroller

  • 2,588 posts
  • Location:Espoo, Finland

Posted Tue Feb 19, 2019 10:31 AM

I finally ported over HandyMusic to cc65. It is so different from anything I have experienced in Lynx sound earlier. A very strange and deterministic tool.
 
Creating sound effects is easy but I still have not got my head around how the instruments work.
 
It also has built in digitized sound that plays the samples directly from the cart. It also has a convenience function to load any tune directly from the cart to memory for playing.
 
Is anyone else playing around with it?
 
My big surprise is that it takes much less space than Chipper.
 
Here is my first effort with HandyMusic to create a special track for an upcoming game.

 

http://79.125.115.17...cs/untitled.mp3

 

It is still only the rhythm and no chord changes or melody. Perhaps it takes shape next week...


Edited by karri, Tue Feb 19, 2019 11:45 AM.


#2 Turbo Laser Lynx OFFLINE  

Turbo Laser Lynx

    Dragonstomper

  • 500 posts
  • Location:Finland

Posted Tue Feb 19, 2019 11:34 AM

Sounds quite exciting! Btw I think you forgot to attach the tune (or I can't see it on mobile).



#3 karri ONLINE  

karri

    River Patroller

  • Topic Starter
  • 2,588 posts
  • Location:Espoo, Finland

Posted Tue Feb 19, 2019 11:41 AM

I just cannot find out how to attach a sound clip in a sensible way :(

 

The media-option turned it to flash

 

For some reason only a http link seems to work somehow...


Edited by karri, Tue Feb 19, 2019 11:46 AM.


#4 Turbo Laser Lynx OFFLINE  

Turbo Laser Lynx

    Dragonstomper

  • 500 posts
  • Location:Finland

Posted Tue Feb 19, 2019 11:13 PM

I think you can zip un-attachable files and then attach them. I've had this problem too with .lnx files.



#5 necrocia OFFLINE  

necrocia

    Moonsweeper

  • 347 posts

Posted Wed Feb 20, 2019 4:09 AM

That sounds cool, I remember talking to you about it, good you actually tried it out. I'm still using ABCmusic  :P



#6 LX.NET OFFLINE  

LX.NET

    Dragonstomper

  • 765 posts
  • Location:The Netherlands

Posted Wed Feb 20, 2019 12:54 PM

Karri, is there a place where we can find the source code for this?

#7 karri ONLINE  

karri

    River Patroller

  • Topic Starter
  • 2,588 posts
  • Location:Espoo, Finland

Posted Wed Feb 20, 2019 2:04 PM

Karri, is there a place where we can find the source code for this?

 

Yep. I just shared the source with you on bitbucket.

 

There is a few special things on my source. It has 3 different sound engines HANDYMUSIC, CHIPPER and NOMUSIC. Currently I have activated HANDYMUSIC.

The config file sets the HANDYMUSIC starting at A000. The sound effects have to be manually set in the config file AND they have to be set in the sounds directory Makefile as well. Otherwise the build fails.

 

You also need python3 installed for getting the tile engines to work correctly at compile time. If you are on Windows you need to remove the wine code in from of all exe files.

 

The game itself has not been released yet so please sshhhh.



#8 necrocia OFFLINE  

necrocia

    Moonsweeper

  • 347 posts

Posted Wed Feb 20, 2019 5:34 PM

I think what Alex is after is this - 

 

http://www.tailchao.com/Audio/

http://www.tailchao.com/Audio/SASS.php

http://www.tailchao....ic_v1-40cx .zip



#9 karri ONLINE  

karri

    River Patroller

  • Topic Starter
  • 2,588 posts
  • Location:Espoo, Finland

Posted Wed Feb 20, 2019 10:13 PM

Yes. These are the ones I have ported to cc65.

 

The original ones are for BLL and lyxass.

 

The port also contains interrupt integration to the cc65 and use of the cart read routines available in cc65. So it is now fully compatible with C. You can call all HandyMusic routines from C-code like:

HandyMusic_PlaySFX(TypewriterSFX);

HandyMusic_StopAll();

HandyMusic_LoadPlayBGM(0);

if (*PCMActive == 0) {
    openn((int)&SAMPLES1_FILENR);
    PlayPCMSample(1);
}
 
 
The SFX elements are arranged in an array so you index the SFX samples starting from 0.
The music is stored on cart and you choose what to play starting with index 0.
The digitized sound is still under work. I had problems with overlapping sound effects. As they are streamed out from the cart instead of from RAM I had to invent some new guards to make it work. The value of PCMActive is the real BACKUP register for timer 3. But now everything seems to work ok.
 
PS. I just updated the sound sample in the first post. Now it contains all 3 elements: BGM (Background music) SFX (HandyMusic Sound Effects) PCM (Digitized speech)

Edited by karri, Thu Feb 21, 2019 1:56 AM.


#10 Nop90 OFFLINE  

Nop90

    Star Raider

  • 70 posts
  • Location:Italy

Posted Thu Feb 21, 2019 7:28 AM

Is it possible to use chipper for tunes (channels 0, 1 and 2) and PCM sample with HandyMusic (channel 3) in the same game?

 

It would be great to use the original pcm SFX (just a bit downsampled) in my Xump port.



#11 karri ONLINE  

karri

    River Patroller

  • Topic Starter
  • 2,588 posts
  • Location:Espoo, Finland

Posted Thu Feb 21, 2019 11:58 AM

Mixing Chipper and HandyMusic is not a good idea.

 

But it is not so complicatred to push out digitized sound.

 

In "Shaken, not stirred" I wanted the phrase "Oh James, that was awesome" to be spoken in case you solved the game. Due to being lazy I did it completely from C.

 

        lynx_load((int)&OOJAMES_FILENR);
        musa = ohjames;
        CTLB_REG(0) = 0x0;
        CTLA_REG(0) = 0x10;
        STEREO_REG = 0;
        VOLUME_REG(0) = (char) 255;
        for (i = 0; i < 15880; i++) {
            for (j = 0; j < 15; j++) {
                isfrog = 0;
            }
            OUT_REG(0) = (char)*musa;
            musa++;
        }
        VOLUME_REG(0) = (char) 255;

The silly loop inside the bigger loop is just to have some delay to get the pitch of the sound right,


Edited by karri, Thu Feb 21, 2019 11:41 PM.


#12 TailChao OFFLINE  

TailChao

    Dragonstomper

  • 521 posts
  • Bup?

Posted Fri Mar 15, 2019 9:35 AM

Ah, I missed this. Thank you for doing the cc65 migration!

 

I haven't looked at HandyMusic in several years, I do not know if I will be able to come back to it and do a v2.0 - but it's nice to see it still in use.



#13 sage OFFLINE  

sage

    Dragonstomper

  • 984 posts
  • Location:Germany

Posted Fri Mar 15, 2019 10:07 AM

it is ... -> PM



#14 karri ONLINE  

karri

    River Patroller

  • Topic Starter
  • 2,588 posts
  • Location:Espoo, Finland

Posted Fri Mar 15, 2019 11:11 AM

Ah, I missed this. Thank you for doing the cc65 migration!

 

I haven't looked at HandyMusic in several years, I do not know if I will be able to come back to it and do a v2.0 - but it's nice to see it still in use.

 

I am really impressed by the SASS language. Easy to work on sound effects and it is also stable. You can create a sound and forget about it. No need to change it later.

 

One thing I would like to try out the PCM samples as part of my feelgood level. The idea is to create the tune Tequila. With the vocals at the end of the phrase. You seem to have this option available ;)



#15 Nop90 OFFLINE  

Nop90

    Star Raider

  • 70 posts
  • Location:Italy

Posted Fri Mar 15, 2019 4:54 PM

 

Mixing Chipper and HandyMusic is not a good idea.

 

But it is not so complicatred to push out digitized sound.

 

In "Shaken, not stirred" I wanted the phrase "Oh James, that was awesome" to be spoken in case you solved the game. Due to being lazy I did it completely from C.

 

        lynx_load((int)&OOJAMES_FILENR);
        musa = ohjames;
        CTLB_REG(0) = 0x0;
        CTLA_REG(0) = 0x10;
        STEREO_REG = 0;
        VOLUME_REG(0) = (char) 255;
        for (i = 0; i < 15880; i++) {
            for (j = 0; j < 15; j++) {
                isfrog = 0;
            }
            OUT_REG(0) = (char)*musa;
            musa++;
        }
        VOLUME_REG(0) = (char) 255;

The silly loop inside the bigger loop is just to have some delay to get the pitch of the sound right,

 

 

I can't make it play the sample, The output is only odd sounds. I exported the samples as raw PCM 8kHz mono 8bit signed (using audacity). Is it right?

 

Also tryed 8bit unsigned, but it's the same..



#16 42bs OFFLINE  

42bs

    Moonsweeper

  • 303 posts
  • Location:Germany/Southest West

Posted Sun Mar 17, 2019 12:15 AM

That's the setup in playsmp.asm (from BLL):

                stz $fd25
                stz $fd25+8
                stz $fd25+16
                stz $fd25+24
                stz $fd50
                lda #$F0
                sta $fd40
                sta $fd42
                lda #$0F
                sta $fd41
                sta $fd43
                stz $fd50
                lda #$ee
                sta $fd44

Maybe some registers were not setup correctly. Or the loop is too fast.

You may want to try the HBL (6240Hz at 60FPS or 7800Hz at 75FPS) to put out the data.



#17 sage OFFLINE  

sage

    Dragonstomper

  • 984 posts
  • Location:Germany

Posted Sun Mar 17, 2019 6:13 AM

 

Mixing Chipper and HandyMusic is not a good idea.

As chipper exports HandyMusic script as well, thats not a problem ;-)



#18 karri ONLINE  

karri

    River Patroller

  • Topic Starter
  • 2,588 posts
  • Location:Espoo, Finland

Posted Sun Mar 17, 2019 6:58 AM

As chipper exports HandyMusic script as well, thats not a problem ;-)

 

I had no idea. This is very good news for me. It will save lots of time.






0 user(s) are browsing this forum

0 members, 0 guests, 0 anonymous users