GenDev SpritesMind Website SpritesMind.Net
Sega Megadrive/Genesis development
 
 FAQFAQ   SearchSearch   MemberlistMemberlist   UsergroupsUsergroups   RegisterRegister 
 ProfileProfile   Log in to check your private messagesLog in to check your private messages   Log inLog in 

how can i do music on megadrive?
Goto page Previous  1, 2, 3 ... 17, 18, 19, 20  Next
 
Post new topic   Reply to topic    SpritesMind.Net Forum Index -> Megadrive/Genesis
View previous topic :: View next topic  
Author Message
TmEE co.(TM)
Very interested


Joined: 05 Dec 2006
Posts: 1394
Location: Estonia, Mahtra village

PostPosted: Sun Oct 14, 2007 5:53 pm    Post subject: Reply with quote

I know how that blip sounds... and it is evident in MD, but, yes, very quiet... once I get FM out of my sound driver, and finish instrument editor in my tracker, I can spend some time on the blip mystery...
_________________
Mida sa loed ? Nagunii aru ei saa Wink
Back to top
View user's profile Send private message Send e-mail Visit poster's website AIM Address Yahoo Messenger MSN Messenger
Eke
Very interested


Joined: 28 Feb 2007
Posts: 383
Location: Toulouse, France

PostPosted: Thu Jan 24, 2008 2:24 pm    Post subject: Reply with quote

I give up with this one, after many tests, it is now clear that this is ONE particular instrument setting on Channel 3 (with special mode enabled) that is bugged.

Steve Snake is the only person knowing exactly where the bug exactly comes from but is definitely not quite in the mood of sharing info with anybody (I try direct asking since he seems to be back on eidolon's inn... with no success) Embarassed

I still don't believe that if he could have discovered this some years ago, nobody can do it again now Confused

Anyway, if someone want to do some test programs to run on the real thing, here is the setttings always used (beside two parameters, annoted as "variable") on Channel 3 for every soundtrack that rely on that "bug":

CHANNEL 3 settings:

KEYMODE: disabled
CH3 SPECIAL: enabled
TIMER A: enabled
TIMER B: disabled
LFO: enabled (0x00)
ALGO: 4
Quote:

M1 --- C1 --|
M2 --- C2 --|


FEEDBACK: 4
L CHANNEL enabled
R CHANNEL enabled
AMS: 0
FMS: 0

SLOTS SETTINGS:

SLOT1 (MODULATOR M1):
DT1: 3
MUL: 15
TL: variable
AR: 31
KS: 1
AM disabled
D1R: 15
D2R: 28
T1L: 8
RR: 4
SSG-EG: 0
FNUM, BLOCK: 117,4

SLOT2 (CARRIER C1):
DT1: 7
MUL: 12
TL: 8
AR: 31
KS: 3
AM: enabled
D1R: 0
D2R: 16
T1L: 4
RR: 9
SSG-EG: 0
FNUM, BLOCK: 95,4

SLOT3 (MODULATOR M2):
DT1: 1
MUL: 15
TL: 0
AR: 28
KS: 3
AM enabled
D1R: 0
D2R: 0
T1L: 0
RR: 4
SSG-EG: 0
FNUM, BLOCK: 94,4

SLOT4 (CARRIER C2):
DT: 7
MUL: 0
TL: variable
AR: 31
KS: 3
AM disabled
D1R: 17
D2R: 16
T1L: 4
RR: 9
SSG-EG: 0
FNUM, BLOCK 0,4



I don't know, maybe it has something to do with D1R/D2RTL/T1L set to 0 with AM enabled, I guess someone should test each parameter


For the moment, in the YM2612 MAME core, I implemented some kind of preliminary hack to detect this particular instrument setting:
Quote:

case 0x40: /* TL */
set_tl(CH,SLOT,v);
if ((c==2) && (ym2612.OPN.ST.mode & 0x40) && !v)
{
/* set Channel 3 OFF (this is a hack, on real hardware,
it seems more like the channel is very attenuated)
*/
ym2612.OPN.pan[ c*2 ] = 0;
ym2612.OPN.pan[ c*2+1 ] = 0;
}
break;


As far as I tested, it has no impact on other soundtracks and obviously, the infamous blipblip sound is gone Smile
Back to top
View user's profile Send private message Visit poster's website
Stef
Very interested


Joined: 30 Nov 2006
Posts: 561
Location: France - Amiens

PostPosted: Sat Jan 26, 2008 9:39 pm    Post subject: Reply with quote

Hey,

I did some time ago what you just did these last days.
As you said, it seems to be a real bug from the hardware, very strange indeed. The channel 3 sounds like very attenuated in this case, looks like TL value are not interpreted correctly in some case.
Good work for your researchs though ! it would be awesome to understand what happen exactly and why Smile
I'm following this topic with lot of interest =)
Back to top
View user's profile Send private message Visit poster's website MSN Messenger
Eke
Very interested


Joined: 28 Feb 2007
Posts: 383
Location: Toulouse, France

PostPosted: Sun Jan 27, 2008 12:09 pm    Post subject: Reply with quote

Thanks Stef
I extracted the incriminated instrument with Shiru's last tool and imported it in TFMaker to play with the settings...

http://www.megafileupload.com/en/file/41925/flash-2-tfi.html

Indeed, if you lower the TL values for operators #3 and #4 (C1 and C2) to half value (63), it sounds more like on real harware (i.e very attenuated but not completely shut off)


Another mysterious thing about the YM2612 would be to know how the SSG-EG part really work
Question
Back to top
View user's profile Send private message Visit poster's website
Stef
Very interested


Joined: 30 Nov 2006
Posts: 561
Location: France - Amiens

PostPosted: Sun Jan 27, 2008 10:39 pm    Post subject: Reply with quote

Eke wrote:
Thanks Stef
I extracted the incriminated instrument with Shiru's last tool and imported it in TFMaker to play with the settings...

http://www.megafileupload.com/en/file/41925/flash-2-tfi.html

Indeed, if you lower the TL values for operators #3 and #4 (C1 and C2) to half value (63), it sounds more like on real harware (i.e very attenuated but not completely shut off)


Another mysterious thing about the YM2612 would be to know how the SSG-EG part really work
Question


Yep, i tried to implement the SSG-EG envelop in Gens as SSG-EG should work in theory. As far i remember a very few number of game uses this feature and only one rely on it for correct sound ! a formula one type game ot something like that. When i added the SSG-EG the game music was fixed but it added some weird bug in others games. I know my SSG-EG support is buggy, i do it quickly and didn't tested it enough... anyway again a strange stuff about the YM2612, it seems the SSG-EG support isn't complete, but it partially works...
Back to top
View user's profile Send private message Visit poster's website MSN Messenger
Eke
Very interested


Joined: 28 Feb 2007
Posts: 383
Location: Toulouse, France

PostPosted: Tue Mar 18, 2008 8:34 am    Post subject: Reply with quote

I downloaded my first Wii Virtual Console game yesterday: Comix Zone

Beside the fact it is running at 50Hz with vertical borders Rolling Eyes , to my surprise, the FM emulation is pretty good, and the YM2612 bug is apparently emulated: there is no "blip blip" in some of the soundtracks (#5, #10 I think) like in most emulators

I wonder if this means that complete documentation of YM2612 exists somewhere or if the emulator that they are using is a port of Kega (I think Steve Snake already made such deal with Kgen for a Sega retro compilation)

Question
Back to top
View user's profile Send private message Visit poster's website
Mask of Destiny
Very interested


Joined: 30 Nov 2006
Posts: 113

PostPosted: Tue Mar 18, 2008 2:52 pm    Post subject: Reply with quote

Eke wrote:

I wonder if this means that complete documentation of YM2612 exists somewhere or if the emulator that they are using is a port of Kega (I think Steve Snake already made such deal with Kgen for a Sega retro compilation)

Question

I seem to recall that Kega is written in pretty much 100% x86 assembly. Since the Wii is using a PowerPC processor a port of Kega doesn't seem to likely.
Back to top
View user's profile Send private message
Christuserloeser
Very interested


Joined: 28 Jan 2007
Posts: 103
Location: DCEvolution.net

PostPosted: Thu Mar 20, 2008 10:06 pm    Post subject: Reply with quote

A friend of mine said that sound emulation in Kid Chameleon would be really buggy...
_________________
http://www.DCEvolution.net - Gigabytes of free Dreamcast software for you

Back to top
View user's profile Send private message Send e-mail Visit poster's website AIM Address
TmEE co.(TM)
Very interested


Joined: 05 Dec 2006
Posts: 1394
Location: Estonia, Mahtra village

PostPosted: Mon Apr 28, 2008 12:59 am    Post subject: Reply with quote

2 year old topic.... so many memories.... I wrestled with 6KHz 2Ch playback code and now I have (or had) 56KHz 2Ch code, plus music and sound effects !!! I said "I will I will", and I now, I've done it !!! (it took quite some time though). I feel good Smile
_________________
Mida sa loed ? Nagunii aru ei saa Wink
Back to top
View user's profile Send private message Send e-mail Visit poster's website AIM Address Yahoo Messenger MSN Messenger
tomaitheous
Very interested


Joined: 11 Sep 2007
Posts: 182

PostPosted: Wed Apr 30, 2008 2:45 am    Post subject: Reply with quote

TmEE co.(TM) wrote:
2 year old topic.... so many memories.... I wrestled with 6KHz 2Ch playback code and now I have (or had) 56KHz 2Ch code, plus music and sound effects !!! I said "I will I will", and I now, I've done it !!! (it took quite some time though). I feel good Smile


TmEE: Hey - do you have enough cycles left over on the z80 to do a fixed point math counter (two 8bit variables)? Or at least an 8bit incrementor? I'm assuming you're using an INC for the read position on the source wave.
Back to top
View user's profile Send private message
TmEE co.(TM)
Very interested


Joined: 05 Dec 2006
Posts: 1394
Location: Estonia, Mahtra village

PostPosted: Wed Apr 30, 2008 7:56 am    Post subject: Reply with quote

there's no free cycles left... anything I'll add will have tiny effect on sample quality... but so far, it sounds good, so why not.

Why is there a need for such thing ? Additional timing ?
_________________
Mida sa loed ? Nagunii aru ei saa Wink
Back to top
View user's profile Send private message Send e-mail Visit poster's website AIM Address Yahoo Messenger MSN Messenger
tomaitheous
Very interested


Joined: 11 Sep 2007
Posts: 182

PostPosted: Fri May 02, 2008 4:02 am    Post subject: Reply with quote

TmEE co.(TM) wrote:

Why is there a need for such thing ? Additional timing ?


Oh - just for frequency scaling. One way is to use two bytes. The low byte acts as the float part and the upper byte is the whole part. Just add the whole part/byte to the wave/sample pointer. That way you don't have to store multiple samples of the same instruments at different prescaled notes.

Another fast method is to have the sample prescaled into all the notes for a given octave, then you can easily move up or down in an octave by using power of 2 for the wave incrementor. Not very efficient, but you can easily get a 3 octave range but just storing one octave range of notes. Gives you a balance of speed and space.
Back to top
View user's profile Send private message
Chilly Willy
Very interested


Joined: 17 Aug 2007
Posts: 640

PostPosted: Fri May 02, 2008 7:56 am    Post subject: Reply with quote

tomaitheous wrote:
TmEE co.(TM) wrote:

Why is there a need for such thing ? Additional timing ?


Oh - just for frequency scaling. One way is to use two bytes. The low byte acts as the float part and the upper byte is the whole part. Just add the whole part/byte to the wave/sample pointer. That way you don't have to store multiple samples of the same instruments at different prescaled notes.

Another fast method is to have the sample prescaled into all the notes for a given octave, then you can easily move up or down in an octave by using power of 2 for the wave incrementor. Not very efficient, but you can easily get a 3 octave range but just storing one octave range of notes. Gives you a balance of speed and space.


A byte really isn't enough for a decent instrument sample. I used a word when I did some MIDI instruments on the Amiga. Most of my instruments weren't 64K long, but most WERE longer than 256 bytes. You probably could do some really simple instruments in 256 bytes, though.

Anywho, I used a long for the sample step - it was a 16.16 fixed point number. I could simply do a swap, use the word index addressing mode, then swap back. The 68K is nice that way. If you were doing a 32X or SEGA CD game, you could use the main 68K CPU that way. It's also fast enough to add several instruments together in that manner. On a 14 MHz 68020, I could mix 16 stereo instruments and 16 stereo sound effects together with that sort of pitch scaling using only about 5% of the CPU time (on a stock A1200). All instruments and sound effects were a 11025 Hz sample rate. It'd take more CPU time on a 7.6 MHz 68000, but for a 32X/SEGA CD game, you have that CPU time available.
Back to top
View user's profile Send private message
TmEE co.(TM)
Very interested


Joined: 05 Dec 2006
Posts: 1394
Location: Estonia, Mahtra village

PostPosted: Fri May 02, 2008 11:29 am    Post subject: Reply with quote

my engine does no resampling whatsoever... and I can't add it becasue of the way samples are played back... everything happens in 256 byte chunks... and if I change it, I'd rather have no sample playback at all since I lose the rate, and I need it for good sounding cymbals... if banks would be changed by a single (or two writes) I would have happily had resampling, but since resampling is pretty dynamic business, I have to change banks really often and that just kills the rate.... lest kick Sega in the nuts !!!
_________________
Mida sa loed ? Nagunii aru ei saa Wink
Back to top
View user's profile Send private message Send e-mail Visit poster's website AIM Address Yahoo Messenger MSN Messenger
AamirM
Very interested


Joined: 18 Feb 2008
Posts: 437

PostPosted: Fri May 02, 2008 12:20 pm    Post subject: Reply with quote

Hi,

Stef wrote:
Yep, i tried to implement the SSG-EG envelop in Gens as SSG-EG should work in theory. As far i remember a very few number of game uses this feature and only one rely on it for correct sound ! a formula one type game ot something like that. When i added the SSG-EG the game music was fixed but it added some weird bug in others games. I know my SSG-EG support is buggy, i do it quickly and didn't tested it enough... anyway again a strange stuff about the YM2612, it seems the SSG-EG support isn't complete, but it partially works...


Shiru's and HardWareMan's TurboFM player uses SSG-EG in some background instruments. Alisia's Dragon also seems to use it. SSG-EG is not supported in my FM core right now. But it will be supported in upcoming version (releasing on linux first). Play the TurboFM player in Regen then in Kega (the Top Gun music) to hear the difference.

BTW, Could somebody please test the blip, blip sound (like in Ariel, Scooby Doo Mystery etc...) in real hardware and in Regen (SuperHQ on) then tell me how far is Regen from reality?

stay safe,

AamirM
Back to top
View user's profile Send private message Visit poster's website
Display posts from previous:   
Post new topic   Reply to topic    SpritesMind.Net Forum Index -> Megadrive/Genesis All times are GMT
Goto page Previous  1, 2, 3 ... 17, 18, 19, 20  Next
Page 18 of 20

 
Jump to:  
You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot vote in polls in this forum


Powered by phpBB © 2001, 2005 phpBB Group