I'm thinking about using a realtime FM synth for music and sound effects in my next game. I'd write a library myself, but I don't want to waste my time if there's already something good out there. The thing is, google turned up no results. Am I going to have to get cracking on my own?
>>10
That's kinda the whole point of using a limited soundchip. You don't get the luxury to think with generic terms like "crash cymbal". You have to learn its language in a process of self-discovery, obliterating the needs for naming things once you discover its real intent, leaving in front of you only a necessary, self-evident world of pure sound.
In short, you have to let it seize you by the throat and drag you to your apex.
>>16
Not really. The point of a limited soundchip is "we know we can make instrumental sounds with FM because we've been doing it since before we had dedicated synthesis hardware, and this is cheap."
>>19
No, in 2009 it's about retro style. But nobody actually builds *limited FM chips* for game consoles any more outside the purposes of being cheap. Bryond game consoles, said FM chips are not in any way limited and haven't been since the '80s.
>>20,22
I have a DX7. My taint has more appreciation and understanding of this than either of you do.
>>24
Congratulations, you own something material. Ironically, you don't know the first thing about the material being the message. I can't believe you are so arrogant as to decide what other people use to make things and why. You don't even know what you yourself are making. Crack a book, anon. You're clueless.
>>25
No, you missed the point. Sure we like to work with constraints, in a way that defines art. But those constraints are largely natural ones, and FM synthesis is no exception.
>>24
Just because you claim to own the most popular FM hardware, which is probably the first example on wikipedia for FM synthesis, doesn't mean you're immune from having to understand the points you attempt to refute.
>>26
That's like saying that a concert grand piano that costs more than ten cars is better than some cheap upright that wasn't tuned for ages: objectively correct, and artistically stupid.
Attempt to make something that sounds like it came from a MD with only a DX7 or whatever else that does FM and is expensive: unless you're making a cover or an uninspired copy, you'll fail.
There's a reason some people did MIDI their MD. Artists, as opposed to mere synthesis nerds, consider the limitations and artifacts of these chips an important part of its vocabulary.
>>27,28
You're still missing the point guys. It's comment on history and the roots of FM sound, not a critique on what "art" is. Try at least to argue against what is being presented if you need to argue. Especially you, >>27
>>30
If you don't like pianos, we can reformulate this example by replacing "expensive grand piano" and "cheap upright piano" with the two following things that people who dislike pianos enjoy: PHP and Nazis.
This whole discussion only depends on what was meant by "the whole point of using a limited soundchip". >>16 speaks from the perspective a musician who gets to choose his hardware, >>18 understood it from the perspective of a console vendor.
Now let's talk about MJ and nazis.
>>28
The only source that has even suggested that MJ wrote the music was someone who knew someone else who worked on the game. It's entirely hearsay, and unless Sega issues a press release or someone who actually was involved in the game puts something out officially, it will continue to be nothing but hearsay and rumors, and invented proof that doesn't actually prove anything.
I can find any two songs that sound remotely similar and claim that the same person wrote them, but that sure doesn't mean it's a true statement.
>>33
Read the link. New info surfaced, a close MJ collaborator said he wasn't satisfied with the results and refused to be credited.
Many sega sources suggested as much over the years. Even Naka was all "I'm not allowed to speak" in interviews. Still no hard evidence, but it's obviously not the simple case of a couple of songs sharing chords you imply it is.
Name:
Anonymous2009-12-13 18:27
OP here. Anyone who understand how FM synthesis works and doesn't just enjoy the way it sounds, please shed some light for me.
As I understand it, FM synthesis works as follows: Constantly output a sine wave (actual waveform doesn't matter, but I'll use it for simplicity's sake) of a certain frequency to your speaker. Use another sine wave to alter that sine wave's frequency. At low frequencies, it will sound like vibrato, but as up increase the frequency, the sound becomes distorted. Use more sine waves to alter that sine wave, route different sine waves to the speaker, etc, until you have a decent sounding instrument.
If that is true, it would not be terribly difficult to create an FM synthesizer. Samples are integers, correct? Therefore, all we would need would be a sample output library and a sine generating function. 48000 times per second (maybe more, I don't know much more than the basics of FM), we calculate a sine wave based off of the time elapsed. The value of this sine wave is then routed to another sine wave, and so on, until we reach the sine that will be heard by the speaker. The value of this sine we convert into a sample and forward to the sound output library.
Is that all that is needed to do FM synthesis on a modern computer? ADSR envelopes, filters, etc can be implemented as well. Don't bite my head off if I'm forgetting something stupid; all that I know about FM, I've learned from dicking around with Analog Box 2 and reading random articles on the internet.
>>35
yeah i wrote a really basic thing one that output wave forms ..using SDL i think under windows... i mapped the keyboard keys to notes (tracker style)..no asdr or anything..
Name:
Anonymous2009-12-13 18:50
>>35
Yeah, that's it. You can get some good stuff going with only one modulating tone too. IIRC, the OPL chips just had one.
>>34
I did read the link. It's a conspiracy theory like any other, and the "evidence" they cite is a forum post by someone, which I find pretty hard to trust. Until I see hard and fast, indisputable evidence, I don't believe it. No one actually involved is either confirming the rumors or outright denying them, and the only ones who are saying anything at all about it had nothing to do with the game.
And just because someone who worked with Michael Jackson also was credited with Sonic 3 doesn't mean anything in itself. For a fairly random example, Terry Date has worked with both Incubus and Smashing Pumpkins, but that doesn't at all imply that Billy Corgan wrote any of the music from Make Yourself.
I'm sure if you dug hard enough, you could find many other cases where two separate albums had similar thematic elements and where some of the same people were involved. You can't extrapolate that to say that the second band wrote the first band's songs.
Name:
Anonymous2009-12-13 20:52
>>35
I wrote one back in 2003. It's as easy as you think.
Some junk like: audio[i] = sin((freq * i * 2 * M_PI / SAMPLE_RATE) * normalize(mod_signal[i]))
or whatever. I didn't check that so you should, or wait for someone else to go full retard on me for leaving out the semicolon and they'll probably catch the meaningful mistakes while they're at it. Convert it to LUTs and add AA/interpolation if you like (probably best for FM.) normalize() makes an element of audio[] suitable for use as a modulation signal, and exactly how it works is dependent on your data type.
For primary operators, initialize an empty modulation signal buffer to whatever is neutral and use the same effect. This way you can feedback into the same operator by writing to the init'd mod buffer.
Speaking of data types, use floats with DC0 = 0. Least of all benefits of this is that simply zeroing the mod buffer will be correct initialization.
I think that's right for the midi spec but I can't remember. For some reason I have it split up like this in some code I have laying around:
r = note%12;
q = note/12;
f = pow(SEMITONE_RATIO, r);
f *= pow(2, q -4);
... probably using those extra values for some other thing but I can't be arsed to check.
There you go. Route those into each other according to whatever crazy idea you have and do ADSR (sample data multiplier maps) on the 'key' events.
If you are tempted to use LADSPA plugins for any reason, and happen to be operating in stereo but are stuck with a mono effect:
M = (L+R)/2;
S = (L-R)/2;
L = M + S;
R = M - S;
L and R being left and right channels, M (mid) being the mono signal and S (side) being the stereo phase signal. Run the mono process on M and take the output as M', combine M' with S to get the (processed) L' and R' values. Not for use with effects that demean the stereo image.
Name:
Anonymous2009-12-13 21:36
>>41 #define SEMITONE_RATIO (1.0594630943592)
FUCK YOU
>>45
Oh well the value is accurate* and the name is appropriate if not ideal.
*: I know some prefer a fixed table with fudged values on the grounds that certain ratios come out better, but a) I hate that and b) the FM engines I've investigated don't do it.
Name:
Anonymous2009-12-14 0:06
>>46
The value is worthless. Play a real interval, why don't you? The best thing about writing your own synth is that you don't have to put up with whatever shitty scale the majority assumes as universal.
>>47
You're shitting on me because you don't like the dominant western temperament? It's piss easy to implement and more importantly probably what OP is looking for. Take it up with someone else.
Name:
Anonymous2009-12-14 2:19
Going with 2612 emulation is a pretty good choice since you can dump instruments from any Genesis game using Gens KMod. Also MAME emulates the 2612 and all their code is freely available.
Of course, the 2612 is a pretty limited chip in a number of ways and it would probably be easier to compose for something more powerful. But you could still use 2612 code as a starting point that you could then turn into something cooler if you wanted to.
It's piss easy to implement
Just like everything else?
probably what OP is looking for.
Wow, you're a dickhead. OP didn't even do anything to you.
Name:
Anonymous2009-12-14 3:40
>>50
SNES instruments aren't FM, they're just samples.
Name:
Anonymous2009-12-14 3:48
>>37
IIRC OPL and OPL2 (AdLib, the original Sound Blaster) had only two operators per voice. OPL3 (SB16) could pair channels for four-operator voices, later versions added more operators and algorithms.
The Sega Saturn has a moderately interesting scheme which I haven't seen in other chips (though I assume the Dreamcast's one works the same). Each of the 32 channels can serve as an FM operator, but as there is no waveform ROM they all play either noise generated by the chip or a waveform from RAM which can be an "oscillator" signal or a normal sample. Each channel can itself have two FM modulation sources that are freely selectable, so you're not limited to a built-in set of FM algorithms. Each channel, including those working as FM operators, can be sent to either the output mixer (with individual pan and volume settings) or to one of the built-in DSP's 16 inputs for effects processing.
>>50,52
Yes, SNES is so much better than Genesis, and that's because it isn't shitty FM instruments. Nintendo hopped the wavetable train before most other people, and it paid off tremendously for them.
(Disagree? I defy you to make the claim that any FM-based MIDI output is even a fraction as realistic-sounding or even decent as a wavetable player. It's an absurd claim, the only thing FM can do passably is a bell. Everything else will sound like varying degrees of ass.)
>>53
SID is cheeseball three-channel junk that's only capable of making blippy noises, and you're a stupid hipster for pretending it's any good.
Name:
Anonymous2009-12-14 10:58
>>56
Congratulations, you have a shitty taste in old musics.
Nintendo still leads with the best sound in there games. They now use live Orchestras for there music, and if you want an uber bad ass game I suggest you do the same.
t x = case lookup x tones of
Just y -> (tone y 2000 0.75 0) :: [Int]
Nothing -> []
main :: IO ()
main = do
let notesl =["d2",
"d3",
"b2",
"f2",
"b2",
"b1",
"c2",
"d2",
"e2"]
let notes = ["##", "g3", "a3",
"b3", "d4", "c4",
"c4", "e4", "d4", -- from d4
"d4", "g4", "f4",
"g4", "d4", "c4",
"g3", "a3", "b3",
"c4", "d4", "e4",
"d4", "c4", "b3",
"a3", "b3", "g3"] -- end
{-- "f3", "g3", "a3",
"d3", "f3", "a3",
"c4", "b3", "a3",
"b3", "g3", "a3",
"b3", "d4", "c4",
"c4", "e4", "d4",
"d4", "g4", "f4",
"g4", "d4", "b3",
"g3", "a3", "b3"]--}
-- "e3", "d4", "c4"
-- ]
let blank = t "##"
let inter = (intersperse "##" notes)
let interl = (intersperse "##" notesl)
let strs = concat (map t notes)
let strsl = concat (map (\ x -> (concat (replicate 5 (t x))) ++ blank) notesl)
let bytes = map chr (zipWith (+) strs strsl)
hPutStr stdout bytes
Name:
Anonymous2009-12-14 14:41
>>57
ONE WORD, THE FORCED BACKTRACKING OF SUPER METROID
THREAD OVER
Name:
Anonymous2009-12-14 14:49
>>56
Maybe if you're retarded enough to think the purpose of a synth is to not sound like a synth. Hello: if you want it to sound like the real thing, play the real thing.
>>67
Just after the python post and everything. There should be some kind of prize for you.
Name:
Anonymous2009-12-14 14:58
>>68
A synthesizer is supposed to synthesize the sounds of real instruments. The more accurate the sound is the better the synthesizer is. Enjoy you're inferior sounds while you can, criminal scum.
>>41
This. I wrote a fast simple wave synthesizer in C a couple years back. It's really that easy. Start with a square wave, it's by far the easiest; then turn it into a sine wave generator, and use multiple passes for FM.
Name:
Anonymous2009-12-14 23:27
>>79
Sounds like the guitar sample in Turtles in Time on SNES.
Name:
Anonymous2009-12-15 1:27
>>83
what sort of library did you use for playback of the sounds you created?
>>87
(Not >>83) I suggest portaudio. It's fairly concise and is very efficient. OTOH, it involves callbacks and you'll have to write your own mixing code. If that bothers you (well it shouldn't by now, but...) you could just go with OpenAL (I don't recommend this, but there's no real problem with it.)
Name:
Anonymous2009-12-15 13:40
>>87
Use Jack on *nix if you can. If you're writing a synth, it's a fair bet you want to make music, so hooking into the usual system will be a plus.
If you want to reuse it, make it a LADSPA plugin, but don't use Jack for a video game. It introduces complexities that many of your users will not want to put up with, and none of the benefits of using Jack are applicable to (virtually) any video game.
You want either something relatively simple or an API designed for the kinds of needs your game has (or both.)
>>92
I assumed he was OP, who said: I'm thinking about using a realtime FM synth for music and sound effects in my next game.
Anyway, the LADSPA (well, DSSI to be more accurate) advice still holds if he was making an instrument, even more so in fact. Jack is the very worst way to build an instrument. If you want to use your instrument with a Jack host, writing a plugin won't stop you (or even slow you down) but if you want to go the other way, writing it for Jack would make it completely impossible.
>>117
Age is a factor in contribution? I don't think this thread came to any meaningful conclusion, so I don't see why new posts shouldn't be made to it.
>>118
Normally I'd agree with you, but... you call that a contribution?
Name:
Lostgallifreyan2012-03-13 16:43
>>56
Called, and I raise you one FS1R. If after that you still believe FM can't do more than a weak bell imitation, keep telling yourself that as you hide your eyes behind your hand pretending the world can';t see you make an arse of yourself.
if anyone knows a C code synth library that can do Yamaha's 6 op type, as found in SY99, do tell. I doubt they ever published it, bit if I do any work on this, that's where I want to start. It had some specific abilities not found in DX7 types, or in the FS1R, including an ability to do analog modelling better than their own dedicated analog modelled synths, although lacking means to do PWM properly. I sold an SY99 to a guy who owned three Minimoogs. This was very much on the strength of how I got a three-voice analog model out of it that he said sounded like a minimoog (with 16 note polyphony). He was excited by that, a lot. I eventually got another SY99, when I realised that selling was a mistake... If I could write my own synth core, I'd take this a lot further, and not be reliant on a single aging (though excellent) bit of hardware.