Basic Questions and Answers Thread

Discussion in 'Discussion & Q&A' started by Malevolence, Jul 7, 2009.

  1. Deactivated Account

    Deactivated Account Well-Known Member Exiled

    Joined:
    Aug 26, 2016
    Messages:
    244
    Hello everyone! Someone know if exist a tool than can be detect bpm about vgm's? I remember than Nineko he had an useful tool but, the link are down.
    Thanks in advance.
     
  2. nineko

    nineko I am the Holy Cat Member

    Joined:
    Mar 24, 2008
    Messages:
    1,902
    Location:
    italy
    That tool doesn't really work by the way, it only measures the time intervals between the events in a vgm file, but there's no guarantee that they are representative of the actual bpm, as events can be other things (volume changes, for example, not to mention that it doesn't differentiate between channels); besides, it can't work in a vgm file with pcm, because pcm uses events all the time, messing up with the stats even more. That said, I'm not at my computer right now, but I'll attach that tool to this post (or to a new one in case more posts are made) later today. There are cases in which you can get decent results so I won't prevent you from trying.

    Someday someone might write a better tool which measures the time intervals only between note attacks instead of all events and only on a channel-by-channel basis. That would be way more accurate but also way more work.

    You might actually have more luck with one of those generic bpm guessers that work on any audio stream (wav/mp3), they're not perfect but they're, too, way more versatile. So that's something else you should look into.
     
    Deactivated Account likes this.
  3. Deactivated Account

    Deactivated Account Well-Known Member Exiled

    Joined:
    Aug 26, 2016
    Messages:
    244
    I will take notes about your words, thank you so much. I'm working with Mid2smps also, my technique for search bpm is using Virtual DJ or FL Studio.
    FL Studio have got a glitch with high search bpm to 150 to 200, instead, Virtual DJ a bit, but I tell because, I saw your tool you posted a long time ago, but well, I will follow using these techniques.

    Thank you and good evening.

    Edit: I hope than will be not a fool question guys.
     
  4. Kilo

    Kilo Foxy Fren Exiled

    Joined:
    Oct 9, 2017
    Messages:
    391
    Location:
    A warm and lovely place~
    So, recently, I've been toying with tempos of preexisting songs. Mostly for 2 projects, 1 small and easy, the other, large and ambitious. Anyways, back to my question; When changing Marble Zone's tempo, the PSG track is indeed slowed down, but it plays when it should have when the song had it's original tempo. This causes the PSG track to be out of sync wih the rest of the music. Is there a specific PSG pointer found within music83.bin, and if so, where could I find it?
    Also, here's a fact relating to this, mostly for those who don't play MZ very often; If you jump, collect rings and just try to make a lot of noise generally, you can cut out that PSG track. Y'know, since generally, sound effects use the 3 PSG tracks. Pretty obvious, but I thought it was worth sharing.
    okbai
     
    Deactivated Account likes this.
  5. ProjectFM

    ProjectFM Optimistic and self-dependent Member

    Joined:
    Oct 4, 2014
    Messages:
    912
    Location:
    Orono, Maine
    Chnaging the first byte of the tempo (byte 02) to 03 or more breaks it.
     
    Kilo likes this.
  6. Kilo

    Kilo Foxy Fren Exiled

    Joined:
    Oct 9, 2017
    Messages:
    391
    Location:
    A warm and lovely place~
    So there's no real way to change MZ's tempo properly? I just tested editing the second byte of the word, and that kind of scrambled the music. Well that sucks. I guess I either put up with the out of sync PSG, or just no Encore/Easy MZ.
     
  7. nineko

    nineko I am the Holy Cat Member

    Joined:
    Mar 24, 2008
    Messages:
    1,902
    Location:
    italy
    Yes, it is possible, but it's not trivial. I'm posting from my phone so I can't check the actual files right now, but I assume that you're encountering the well-known problem with high tempo multipliers. Basically, note durations (which can range between $1 and $7F) are multiplied by that value when the music data is processed, and the result is stored as a byte in RAM. If the tempo multiplier is 1 or 2, there can't be any problems; however, if you use 3 or more, longer notes can cause an overflow. For example, $55 × 3 = $FF, which means that $55 is the longest note duration you can use with a tempo multiplier of 3. You can work around this if you find all the longer notes in the smps data and split them into two or more parts with the E7 coordination flag. It's a lot of work, especially if you do it in raw hex as you have to recalculate most of the pointers (if not all of them), it might be easier with smps2asm (not sure as I never worked with asm'd songs), but still very time consuming.

    Sorry for the short reply but I hate to type on a phone. I hope it's understandable, if not I'm sure that someone else will soon build over this.
     
    Last edited: Oct 2, 2018
    Deactivated Account and AkumaYin like this.
  8. Pineapple Arse

    Pineapple Arse I ironically hate cold temperatures. Member

    Joined:
    Jun 19, 2016
    Messages:
    129
    Location:
    A cold place.
    I have finally imported boss art into my hack, but I noticed that the boss items overlap it. Is there a way to remove the items?

    upload_2018-10-2_20-58-29.png
     
  9. ProjectFM

    ProjectFM Optimistic and self-dependent Member

    Joined:
    Oct 4, 2014
    Messages:
    912
    Location:
    Orono, Maine
    Under Obj73_Main, change
    Code:
    moveq    #3,d1
    to
    Code:
    moveq    #1,d1
    You also might as well remove from Obj73_ObjData:
    Code:
    dc.b 6, 7, 4
    dc.b 8, 0, 3
    as well as removing the routines "Obj73_FlameMain" and "Obj73_TubeMain," their entries in object 73's routine table, and object 74. Don't forget to replace the pointer to object 74 in "Object pointers.asm" with "ObjectFall" or something.
     
    Niko and Pineapple Arse like this.
  10. Pineapple Arse

    Pineapple Arse I ironically hate cold temperatures. Member

    Joined:
    Jun 19, 2016
    Messages:
    129
    Location:
    A cold place.
    In my ROMhack, I have been changing the MZ lava tag to slow down the player, instead of inflicting damage. While it does in fact slow down the player, the time for how long the effect lasts never resets. How can I fix it so it works?

    Code:
    ; ---------------------------------------------------------------------------
    ; Object 54 - invisible    lava tag (MZ)
    ; ---------------------------------------------------------------------------
    
    Obj54:                    ; XREF: Obj_Index
            moveq    #0,d0
            move.b    $24(a0),d0
            move.w    Obj54_Index(pc,d0.w),d1
            jmp    Obj54_Index(pc,d1.w)
    ; ===========================================================================
    Obj54_Index:    dc.w Obj54_Main-Obj54_Index
            dc.w Obj54_Slow-Obj54_Index
    
    Obj54_Sizes:    dc.b $96, $94, $95, 0
    ; ===========================================================================
    
    Obj54_Main:                ; XREF: Obj54_Index
            move.w    #$10,($FFFFD034).w ; time limit for the power-up
            move.w    #$300,($FFFFF760).w ; change Sonic's top speed
            move.w    #$12,($FFFFF762).w
            move.w    #$10,($FFFFF764).w
    
    Obj54_Slow:
            tst.b    ($FFFFFE54).w    ; does Sonic have slow down?
            beq.s    Obj54_ExitChk    ; if not, branch
            tst.w    $34(a0)        ; check    time remaining
            beq.s    Obj54_ExitChk
            subq.w    #1,$34(a0)    ; subtract 1 from time
            bne.s    Obj54_ExitChk
            move.w    #$600,($FFFFF760).w ; restore Sonic's speed
            move.w    #$C,($FFFFF762).w ; restore Sonic's acceleration
            move.w    #$80,($FFFFF764).w ; restore Sonic's deceleration
            move.b    #0,($FFFFFE54).w ; cancel slowdown
    
    Obj54_ExitChk
            rts
     
  11. MainMemory

    MainMemory Well-Known Member Member

    Joined:
    Mar 29, 2011
    Messages:
    922
    It appears that your initialization is writing the timer to Sonic's object RAM, but the rest of the code is checking the current object's RAM. All of the lines need to use either ($FFFFD034).w or $34(a0), not a mix of the two.
     
    AURORA☆FIELDS likes this.
  12. RouRouRou

    RouRouRou Ain't no fun if the aliens can't have none. Member

    Joined:
    Nov 20, 2016
    Messages:
    97
    I just don't seem to listen, do I?

    I have once again tried to port the Clone Driver V2 into a Sonic 2 disassembly. But recently, I decided to see what it can do other than "nY00W SONGES" and I liked what I saw. I knew that it had MegaPCM (Well, a modified version.) but I do like that I can use more PSG instruments & sound effects, among other things. (Whoa, PAL mode. Maybe It'll be easier to look for hardware to use.)

    Anyway, after getting some help for the initial parts of it, I've hit a rather odd roadblock.
    It all seems to assemble fine, but at the end it says "ERROR: Compressed sound driver may not fit. Please increase the size of Size_of_snd_driver_guess to at least $998 and try again."
    So, I did this but I got the same error. "It said at least $998." I thought to myself. So I increased it further. No success. Further. No success. Setting it to a ridiculous amount just to see if it would even work. Well, you know what happens next.

    I'm wondering if this is because of where I put Clone_Driver_Ram, as I put it at RAM address $F100, as it until $F5FF are unused.

    Also, I'm on mobile data at the moment, so if I don't respond it's most likely because I'm trying to save data.

    Thanks in advance.

    EDIT: Another question, how come in the empty level slots in S2 it uses Tails' life icon for the HUD? I've been testing with adding new levels by restoring Wood Zone, (It went well.) and want to know how I'd fix this. Thanks.

    Update, sort of: I figured out what causes WZ's Tails icon. As it turns out, the PLC WZ loads is actually the Tails icon for playing as him. I don't know how to fix this, which sucks but hey, I got my answer. As for the Clone Driver thing, I looked into it and Flamewing's S3K driver is more what I'm looking for. The only problem is I can't put either into my hack to compare & judge them. Oh well.
     
    Last edited: Oct 12, 2018
  13. Tanman Tanner

    Tanman Tanner Well-Known Member Member

    Joined:
    Dec 23, 2016
    Messages:
    116
    Location:
    Buffalo, New York
    As MainMemory stated, the code is writing a timer to the Sonic's object RAM, but it's checking for the current object's RAM for the timer. When you use a mix of the two, it's going 'okay we're here, then we're over here, then we're back here, then we're over here once more'.
    I believe below fixes this (I'm rough to ASM, so don't take my word 100% for it that it's totally fixed.)
    I added some comments for my own benefit, you can remove them if you please.
    Code:
    ; ---------------------------------------------------------------------------
    ; Object 54 - invisible    lava tag (MZ)
    ; ---------------------------------------------------------------------------
    
    Obj54:                    ; XREF: Obj_Index
           moveq    #0,d0
           move.b    $24(a0),d0 ; Since I don't have a compiler on me at the moment, I can't say for sure this is fine or not.
           ;move.b ($FFFFD024).w,d0 ; If it doesn't work still, this might work. Otherwise \_(._.)_/
           move.w    Obj54_Index(pc,d0.w),d1
           jmp    Obj54_Index(pc,d1.w)
    ; ===========================================================================
    Obj54_Index:    dc.w Obj54_Main-Obj54_Index
           dc.w Obj54_Slow-Obj54_Index
    
    Obj54_Sizes:    dc.b $96, $94, $95, 0
    ; ===========================================================================
    
    Obj54_Main:                ; XREF: Obj54_Index
           move.w    #$10,($FFFFD034).w ; time limit for the power-up
           move.w    #$300,($FFFFF760).w ; change Sonic's top speed
           move.w    #$12,($FFFFF762).w
           move.w    #$10,($FFFFF764).w
    
    Obj54_Slow:
           tst.b    ($FFFFFE54).w    ; does Sonic have slow down?
           beq.s    Obj54_ExitChk    ; if not, branch
           tst.w    ($FFFFD034).w      ; check    time remaining
           beq.s    Obj54_ExitChk ;
           subq.w    ($FFFFD034).w    ; subtract 1 from time
           bne.s    Obj54_ExitChk ; e
           move.w    #$600,($FFFFF760).w ; restore Sonic's speed
           move.w    #$C,($FFFFF762).w ; restore Sonic's acceleration
           move.w    #$80,($FFFFF764).w ; restore Sonic's deceleration
           move.b    #0,($FFFFFE54).w ; cancel slowdown
    
    Obj54_ExitChk
           rts
    
    (Also, bizarre mechanic idea... are you changing it to like a mud flow or quicksand type of thing?)
     
    Pineapple Arse likes this.
  14. Deactivated Account

    Deactivated Account Well-Known Member Exiled

    Joined:
    Aug 26, 2016
    Messages:
    244
    How can I listen the PSG Noise in the channel 14 in Mid2smps? When I assign the channel 14 in my FL Studio, in a midi, it sounds how PSG Square wave, I don't know if I'm doing something wrong or I must change something.
    I tried to assign in the DAC in Mappings Editor in my S3K library but, seems to be than doesn't take effect.

    Thanks for advice and I hope someone answer my question.
     
  15. ValleyBell

    ValleyBell Well-Known Member Member

    Joined:
    Dec 23, 2011
    Messages:
    166
    The assignments in the Mappings Editor only apply to notes that are playing on channel 10.

    There are a few tricks with channel 14. At first, you need to explicitly put it into "noise" mode, using MIDI CC #3, with a value of 3 ("periodic noise", makes a sawtooth-like tone) or 7 ("white noise", that's what most games use for hi-hats).
    Then you can play notes on channel 13 or 14, which will be played on the noise channel. The "feature" of channel 14 is, that the frequencies played are different from channel 13.
    Ch 13 uses frequencies for PSG tone channels, ch 14 has frequencies adjusted for the periodic noise, so common frequencies are in a more comfortable range.
     
    Deactivated Account and AkumaYin like this.
  16. Deactivated Account

    Deactivated Account Well-Known Member Exiled

    Joined:
    Aug 26, 2016
    Messages:
    244
    Very good works fine, thank you ValleyBell, I assigned the MIDI CC #3 and I'm testing the values.
    Now I will continue The Machine song from Sonic Spinball without problems :) .
     
  17. Devon

    Devon Down you're going... down you're going... Member

    Joined:
    Aug 26, 2013
    Messages:
    1,372
    Location:
    your mom
    So, I've managed to get rotation to work on the Sega CD, but I have one more problem: it's not centered at the middle of the screen, but rather at the top left. Right now, I have the start X and Ys in the trace vector table use the standard rotation algorithm (x*cos(angle) - y*sin(angle) and x*sin(angle) + y*cos(angle)) and I have the deltas be the cosine and sine of the angle. I am not sure how I would put centering into the equation. Would anyone here know?

    EDIT: Solved, I subtracted the center to the x and y and then add them back at the end and it worked.
     
    Last edited: Oct 14, 2018
  18. Kilo

    Kilo Foxy Fren Exiled

    Joined:
    Oct 9, 2017
    Messages:
    391
    Location:
    A warm and lovely place~
    So I'm working on Sonic 1 Encore, and due to the large and odd names of some of our members, I had to use the LS/Debug font for the credits font instead of the original. However, when trying to save in PlaneED or Captain PlaneED, the credits mappings would just go blank. I found out why, it's because the tile offset and index weren't the right size in the project files. Now this is $10 tiles less than the original file, and the project file says that the original tile index and offset was $5A0. So naturally I tried to change it to $590. But that didn't work, although it didn't completely wipe the file as it did last time, still wasn't what I wanted however. So if there's anyone who could explain tile offsets and indexes to me, that'd be great. I've also left this picture in case you need to count the tiles.
    Capture.PNG
     
    Deactivated Account likes this.
  19. Deactivated Account

    Deactivated Account Well-Known Member Exiled

    Joined:
    Aug 26, 2016
    Messages:
    244
    I know than Sonic 1 doesn't supports some effects with the instruments but, someone can tell me how can I make to activate AMS and FMS?
    I tried to configure the Amplitude Modulation in all channels and adjust the LFO in 3.98, AMS in 5.9 and FMS in (+-20) but seems to be not work.
    I'm fixing a song from Sub-Terrania and I want to know if it's possible activate those effects.
    Thank you.
     
  20. nineko

    nineko I am the Holy Cat Member

    Joined:
    Mar 24, 2008
    Messages:
    1,902
    Location:
    italy
    Deactivated Account likes this.