Jump to content

  •  

Photo

Changing music pitch?


  • This topic is locked This topic is locked
13 replies to this topic

#1 Blazer

Blazer

    Da Fuck ya lookin at?

  • Member
  • 349 posts
  • Gender:Male
  • Location:Middletown, deleware

Posted 16 March 2012 - 11:31 PM

Well I have been experimenting with music for a while and i wanted to know, exactly how would i be able to change the pitch of a song?
for instance, i wanted to change the pitch of EHZ to make it sound lower by -1 (mind you all that i'm talking about the port for sonic 1 BTW). I know I have to use a hex editor for this but i wanted to know which parts do I have to edit.

Edited by Blazer, 21 March 2012 - 12:38 AM.

  • 0

#2 MarkeyJester

MarkeyJester

    Intelligence takes you so far, intuition takes you further

  • Pro User
  • 1371 posts
  • Gender:Male

Posted 17 March 2012 - 12:06 AM

For actual SMPS the pitches are located here:

Posted Image

This is GHZ from Sonic 1, of course, for Sonic 2 you'll need to decompress the sound from Saxman format first, and it will entirely depend on the number of channels present in the track.
  • 0

#3 Irixion

Irixion

    6 Chaos Emeralds

  • Pro User
  • 506 posts
  • Gender:Male
  • Location:Ontario, Canada

Posted 17 March 2012 - 05:03 AM

This is GHZ from Sonic 1, of course, for Sonic 2 you'll need to decompress the sound from Saxman format first, and it will entirely depend on the number of channels present in the track.


That is, unless you switch over to the clone driver. Less of a pain that way.
  • 0

#4 Sonic master

Sonic master

    4 Chaos Emeralds

  • Member
  • 236 posts
  • Gender:Male
  • Interests:Homebrew games for retro systems.

Posted 17 March 2012 - 02:13 PM

the only problem with the clone driver is that it runs on the 68k instead of the z80 so if you do a lot of complex hacking that uses a lot of instructions your hack may run a bit slower. I realy wish that xm4smps would support sonic 3 so that way we could all just use that driver instead of the 68k one or the sonic 2 one.
  • 0

#5 Irixion

Irixion

    6 Chaos Emeralds

  • Pro User
  • 506 posts
  • Gender:Male
  • Location:Ontario, Canada

Posted 20 March 2012 - 08:16 PM

It barely affects how the game runs. And by barely I mean barely.
  • 1

#6 Blazer

Blazer

    Da Fuck ya lookin at?

  • Member
  • 349 posts
  • Gender:Male
  • Location:Middletown, deleware

Posted 01 April 2012 - 04:22 AM

well i treid it out finally as you said and it worked, but i have one small problem. since im making a song sound lower than what it is, excatly how would i change $00 to a number different to make the pitch sound lower?

Edited by Blazer, 01 April 2012 - 04:22 AM.

  • 0

#7 MarkeyJester

MarkeyJester

    Intelligence takes you so far, intuition takes you further

  • Pro User
  • 1371 posts
  • Gender:Male

Posted 01 April 2012 - 04:33 AM

FF FE FD FC FB FA F9 etc signed negative

00 - 7F positive
FF - 80 negative
  • 1

#8 Blazer

Blazer

    Da Fuck ya lookin at?

  • Member
  • 349 posts
  • Gender:Male
  • Location:Middletown, deleware

Posted 09 April 2012 - 02:50 AM

again i have one other thing to ask. though this is not music wise but more SFX wise. i was wondering, since i am trying to make the ring SFX pitch lower, what would i change E0 to? im having a bit of trouble figuring this out.

Edited by Blazer, 09 April 2012 - 02:51 AM.

  • 0

#9 MarkeyJester

MarkeyJester

    Intelligence takes you so far, intuition takes you further

  • Pro User
  • 1371 posts
  • Gender:Male

Posted 09 April 2012 - 01:53 PM

You do not change E0, E0 is panning and YM2612 modes:

00 15 01 01 80 05 00 0A 00 05...

The 00 is what you'll want to change if you want to alter the pitch, changing it to FF will drop the pitch by 1 note, changing it to FE will drop it by 2, FD will drop by 3, and so on.
  • 0

#10 Blazer

Blazer

    Da Fuck ya lookin at?

  • Member
  • 349 posts
  • Gender:Male
  • Location:Middletown, deleware

Posted 10 June 2012 - 10:42 PM

Excuse me for this bump but this is something music wise again that I have a question for (S1). Exactly which part in a song file in a hex editor would I be able to change the tempo so if a song is too fast or too slow, I know where to change it?
  • 0

#11 redhotsonic

redhotsonic

    Also known as RHS

  • Staff
  • 1649 posts
  • Gender:Male
  • Location:United Kingdom

Posted 10 June 2012 - 10:55 PM

I'm certain it's the $04 byte starting from the start of the file.

00 D8 06 03 02 09 09 7D.....

In this case, the 02 is the tempo. The higher the number, the slower it is (IIRC).

Edited by redhotsonic, 10 June 2012 - 10:57 PM.

  • 0

#12 ValleyBell

ValleyBell

    2 Chaos Emeralds

  • Pro User
  • 51 posts
  • Gender:Male

Posted 11 June 2012 - 07:52 PM

Actually it's the byte at $05.
$04 is a multiplier that sets a "range" for the actual tempos. (higher values make slower tempos, that's right)
$05 is the actual tempo setting and can be $02 (slowest) to $100 ($00 in the file, fastest).

So to make the song slower, change either increase the value at byte $04 (coarse tempo setting) or decrease the value at byte $05 (fine tempo setting).
  • 0

#13 redhotsonic

redhotsonic

    Also known as RHS

  • Staff
  • 1649 posts
  • Gender:Male
  • Location:United Kingdom

Posted 11 June 2012 - 09:28 PM

...to $100 ($00 in the file, fastest).



Do you mean $FF? As $100 is a word. Or is the $06th byte part of the tempo too?
  • 0

#14 ValleyBell

ValleyBell

    2 Chaos Emeralds

  • Pro User
  • 51 posts
  • Gender:Male

Posted 11 June 2012 - 09:36 PM

I was a little unclear.
The tempo is a byte, but a value of $00 is treated as $100. (It decrements it first and checks the value then.)

btw: Tempo $01 doesn't work, so the usable tempi are $02, $03, ..., $FF, $00.
  • 0




0 user(s) are reading this topic

0 members, 0 guests, 0 anonymous users