ChanServ changed the topic of ##yamahasynths to: Channel dedicated to questions and discussion of Yamaha FM Synthesizer internals and corresponding REing. Discussion of synthesis methods similar to the Yamaha line of chips, Sound Blasters + clones, PCM chips like RF5C68, and CD theory of operation are also on-topic. Channel logs: https://freenode.irclog.whitequark.org/~h~yamahasynths
andlabs has joined ##yamahasynths
<cr1901_modern> https://github.com/onitama/mucom88/pull/9 Worth a shot. IME most Japanese programmers can speak English fine too. Sample size: The Japanese NetBSD developers.
<whitequark> that seems like it'd result in self-selection for english knowledge
<cr1901_modern> Probably LOL
<cr1901_modern> When valsound was in this room that one night, he explicitly said he was using an autotranslator (which was sufficient for us to have a convo)
<TD-Linux> also that's like a sample size of 2
<cr1901_modern> ryoshu, ryo onedera, tsutsuii are three :P
<cr1901_modern> There's a few more, since they seem to be the ppl interested in keeping NetBSD/68k and OpenBSD 88k alive
<TD-Linux> >88k
<cr1901_modern> not a typo :P
<TD-Linux> I know, didn't realize that port was a thing and that's also well above my level of M
<cr1901_modern> level of M?
<TD-Linux> but about the openbsd level
<TD-Linux> masochism
<cr1901_modern> indeed
<cr1901_modern> OpenBSD's gcc is so old it supports Motorola 88k still. So Kenji Aoyama (sp?) keeps the port alive...
<cr1901_modern> okay I'm procrastinating from learning MML... time to at least TRY to make sounds
andlabs has quit [Ping timeout: 246 seconds]
<cr1901_modern> http://valsound.fc2web.com/fm_lib.html Library of patches for those interested
<cr1901_modern> Looks like it matches exactly the format that mucom88 expects
<kode54> oh hey, cr1901_modern
<cr1901_modern> hello!
<kode54> does this project also use get/set window long?
<cr1901_modern> dunno, I only compiled the command line portion
<kode54> for things like DWL_USER or GWL_USER
<kode54> Get/SetWindowLong should be converted to the more generic Get/SetWindowLongPtr and DWLP/GWLP constants for 32/64 parity
<kode54> just guessing, I haven't searched the code base for their use
<kode54> also used for subclassing windows, but this doesn't seem likely to be doing that, either
<cr1901_modern> English MML reference
<cr1901_modern> and by that I mean "Google translate"
andlabs has joined ##yamahasynths
<cr1901_modern> mucom88 is consistently returning a nonzero error code when I run it, so now I have to deal with that before putting it into a Makefile... yay
<whitequark> $ cat >Makefile
<whitequark> all: -false
<whitequark> $ make all
<whitequark> false
<whitequark> make: [Makefile:2: all] Error 1 (ignored)
<whitequark> er, irssi ate a newline
<whitequark> oh, that's a GNUism
<cr1901_modern> whitequark: I used a python wrapper script to work around it. Noted tip for the future tho :D!
<cr1901_modern> mucom is hardcoded to return "1" when compiling, there's a comment I can't read explaining why
<cr1901_modern> so I look for either "1" or "0" and pass all other error codes unchanged
<cr1901_modern> cursed, but it works
<whitequark> cr1901_modern: i mean you could also use || true
<cr1901_modern> true... (does that work from cmd.exe? I only went through all this trouble to make it so I could play MML files directly from IDE)
<whitequark> cr1901_modern: yes
<whitequark> Z:\home\whitequark>copy || type nul
<whitequark> Argument missing
<whitequark> Z:\home\whitequark>echo %errorlevel%
<whitequark> 0
<whitequark> (that's wine's cmd but it's the same)
<Wohali> cr1901_modern: i'd take and post a pcb photo for you but i have a cat on me :3
<Wohali> i don't want to put a pic on social media until i have the store up, though
<cr1901_modern> whitequark: Thx
<cr1901_modern> wohali: The happiness of our fuzzy little overlords take priority :D
<Wohali> yes, she does.
<Wohali> they feel great though
<cr1901_modern> Wohali: The PCBs or the cats feel great :D?
<Wohali> both!
ej5 has quit [Read error: Connection reset by peer]
<cr1901_modern> https://www.youtube.com/watch?v=drwX7MbB_IE VRC7 is OPL2 right... in "Theme of Iris/Isis" (first track on video), how did they manage to get an echo using only a single channel?
<cr1901_modern> I understand that if you sum the operators up in OPL2 mode (and delay the attack on one of the operators), you can get two sinusoids where one is a delayed copy of the other
<cr1901_modern> but the echo'd channel doesn't sound like a pure tone. This seems like you'd need 4 operators- 2 operators generate a complex tone. And the other 2 operators generate a time-delayed version of said tone
<whitequark> okay, got ym2413bs
<cr1901_modern> Guess I could cheat and look at the VGM file for Theme of Iris
<whitequark> ah shit
<whitequark> 0116 datecode
<cr1901_modern> def misread as ym2413 "bs"
<cr1901_modern> which... might be apt here
<ValleyBell> cr1901_modern: Easy - you mix the actual melody with the echo on the same channel.
<cr1901_modern> I don't understand what you mean or how to do that :(
<ValleyBell> like: note 1 (1/8, normal), note 2 (1/16, normal), note 1 (1/16, echo), note 3 (1/16, normal), note 2 (1/16, echo)
<cr1901_modern> it _sounds_ like both the "normal" tone and the echo are playing at the same time
<cr1901_modern> is that my head screwing w/ me?
<ValleyBell> Maybe they were using 2 channels when?
<whitequark> what
<whitequark> it's an ym2413
<whitequark> remarked as ym2413
<cr1901_modern> did you forget a letter?
<whitequark> as ym2413b*
<cr1901_modern> valleybell- does vgmtools come w/ a vgm dump program that converts a vgm stream to something humans can read?
<cr1901_modern> ahhh
<whitequark> what's the difference between those?
<ValleyBell> The echo is missing from 0:16 on.
<ValleyBell> There is vgm2txt, but for YM2413 stuff you better use VGMTool2r5
<cr1901_modern> whitequark: https://sites.google.com/site/undocumentedsoundchips/yamaha/ym2413 Low power version
<ValleyBell> I never bothered with YM2413 support in vgm2txt, because VGMTool always had superior output.
<cr1901_modern> link to vgmtool2r5?
<ValleyBell> just search for it on SMSPower
<cr1901_modern> (Btw, I feel bad cheating, but I guess it's a testament to how I'm not really a good musician)
<ValleyBell> I think that composing or arranging and "reverse-engineering" music are different skill.
<cr1901_modern> perhaps, but analogous to how tracing an artists' work is extremely amoral, I feel the same when REing the actual writes sent to a chip
<cr1901_modern> like I didn't go through the process/struggle of actually creating music, I just looked at how someone else did it to save me a bunch of pain to get to the same result
<ValleyBell> Studying other people's styles may help you to do covers in that style.
<ValleyBell> I don't think it's a bad thing.
<cr1901_modern> I can't disable channels playing in vgmplay, correct?
<superctr__> you can edit the config
<superctr__> but it's more convenient if you use in_vgm or foo_input_vgm where you can disable channels during playback
<superctr__> yes, you can set MuteMask=0xffffffff and unmute channels individually with MuteCh0=False etc
<whitequark> cr1901_modern: pretty sure tracing someone's art to learn how to draw is perfectly fine
<whitequark> all artists copy someone else's stuff, just don't copy something in its entirety
* cr1901_modern nods
<cr1901_modern> https://twitter.com/whitequark/status/1115880825457926144 Btw, do you have a picture of the remnant markings?
<superctr__> i don't know why they keep remarking those chips
<superctr__> they are obviously pulls
<superctr__> at least you didn't get a bona fide fake, like 50% of YM2151s you get :P
<cr1901_modern> Idk if my 2151s are fake
<cr1901_modern> the GPIO outputs do work on all 3 of them
<superctr__> the fake ones have a different package and sound noticably worse
<superctr__> the notch on the side is round on real ones, on the fake once they're like a rounded rectangle
<cr1901_modern> mine appear to be real then
futarisIRCcloud has quit [Quit: Connection closed for inactivity]
<whitequark> any photo of real 2413b?
futarisIRCcloud has joined ##yamahasynths
<cr1901_modern> ValleyBell: It's using two channels to implement the echo
<cr1901_modern> ValleyBell: Do later versions of the Master System FM addon use YM2413B?
<whitequark> does anyone know what YMF286 is?
<whitequark> is this a OPNB-C?
<whitequark> this sort of implies it's like OPNB and it's YMF so I'm thinking it's CMOS
<whitequark> cr1901_modern: kinda hard to get a photo of those
<superctr__> the Master System never had an FM addon
<superctr__> the japanese SMS had FM built in and the Mark III addon was never released overseas
<superctr__> though the western SMS is basically a Mark III with a boot ROM
<superctr__> furthermore the japanese SMS was discontinued as soon as the MD released so i'm not sure if they ever had time to introudce the YM2413B
<cr1901_modern> whitequark: Ack
<cr1901_modern> superctr__: Must be misremembering
<cr1901_modern> whitequark: https://twitter.com/whitequark/status/1115909002016301056 Nice list... I can think of two missing chips, but we talked about them before so it's totally possible you omitted them deliberately :P
<cr1901_modern> YM21280 (OPS)/YM21290 (Envelope Generator)- Used in the DX7 synth. It predates single chip solutions.
<cr1901_modern> YM2414 (OPZ)
<whitequark> cr1901_modern: iirc not on ebay
<whitequark> yeah
<cr1901_modern> Ahhh okay... all of the chips in that spreadsheet have a link to where you can buy them
<whitequark> yeah
<cr1901_modern> It's a nicely organized spreadsheet- adds a modicum of sense to the hell that is Yamaha part numbering
<superctr__> yamaha part numbering never made sense
<whitequark> i've just slapped together something to not completely lose track of my yamaha chip "collection"
<cr1901_modern> OPOMGWTFBBQ
<superctr__> YM2602 is the master system video chip, YM7101 is the mega drive video chip, but the sound chip is YM2612
<whitequark> quotes because i don't intend to collect them
<cr1901_modern> Isn't the YM2602 just TI IP?
<superctr__> no, it's different
<cr1901_modern> or did they actually make changes to it compared to the TI VDP?
<superctr__> it's based on the TMS9918, but they made changes to improve the sprite limit and colors etc
<cr1901_modern> >because i don't intend to collect them <-- They're still going towards a greater cause :P
<superctr__> also Yamaha didn't make the original Mark III/SMS chipset, but they got involved somewhere when Sega wanted to increase the amount of sources or something (i think the original SMS VDP was manufactured by NEC or Oki)
<whitequark> cr1901_modern: i mean
<whitequark> once i image them i am going to get rid of all the chips
<cr1901_modern> ahhh
<whitequark> with the exception of a board that has one of each with digital output
<whitequark> i guess
<whitequark> like i don't actually like them that much i guess?
<whitequark> shrug
<Sarayan> wq: LN made me remember that my sc01a probably went to dig and that's how we got the good die shots we have :/
<Sarayan> (hi everyone)
<superctr__> bottom left
<cr1901_modern> From what I could gather, you would probably have the most fun implementing an FM synth without regard to the limited precision of the Yamaha chips
<cr1901_modern> Still appreciate the work you've been doing regardless
<whitequark> i could get it
<Sarayan> wq: It's a little expensive :/
<Sarayan> also, ships to ca and us only, beautiful
<cr1901_modern> And I thought SIDs were expensive
<cr1901_modern> Trying to look for a link I pasted a few months ago... someone create a Lisp REPL for emitting sound. It would be fun to create an FM operator primitive in that REPL, which you could compose and add together to create algorithms.
<cr1901_modern> You could even create algorithms that aren't possible on the Yamaha chips (or other physical silicon after Yamaha patents expired)
<cr1901_modern> Sun Vox has this capability, but it's not FOSS anymore.
<cr1901_modern> https://github.com/Themaister/libfmsynth Can also use this of course
<cr1901_modern> https://github.com/Themaister/libfmsynth/blob/master/src/fmsynth.c#L664-L680 Btw, if anyone knows what this is actually doing, I'd be very appreciative
<cr1901_modern> INV_FACTORIAL_*_2PIPOW* appear to be the first few entries of the sine Taylor series?
<cr1901_modern> ... ... ... yea, it's calculating sin(x) by using the Taylor approximation (perhaps it can be better optimized?)...
<superctr__> you could always replace it with a lookup table + optional linear interpolation if you care
<cr1901_modern> the library doesn't emulate a particular synth. I guess opting to use floating point directly makes the math easier.
<cr1901_modern> Of course if you're emulating a particular synth, model everything you can :P.
<cr1901_modern> It's clear over the years that floating point emu wasn't sufficient for the YM chips
<superctr__> none of the synths use floating point math (except for the serial DAC output)
<cr1901_modern> superctr__: No no no, I explained poorly
<cr1901_modern> what I mean was: "people were able to tell the difference from silicon versus emulation of said chip using floating point"
<superctr__> i understood already
futarisIRCcloud has quit [Quit: Connection closed for inactivity]
<superctr__> you're saying this library doesn't emulate a particular chip, and thus is free to implement it in whatever way
<cr1901_modern> right. Subtext: If I were doing a library in the same manner, I would most likely use a LUT
<cr1901_modern> b/c it's what I'm used to and I don't feel like dealing w/ floating point
<superctr__> yes, the YM chips were inaccurately emulated using FP and whatever, they weren't completely understood at the time anyway
l_oliveira has joined ##yamahasynths
<cr1901_modern> Would be curious to hear a comparison video between "YM core emulated properly", and "the same thing, but using floating point to implement the operator instead of the provide sin LUT"
<cr1901_modern> everything else stays the same, or "as close as possible" to the same
<superctr__> it's going to be a lot cleaner
<superctr__> some high feedback / modulation effects are going to sound different
<cr1901_modern> Well at least it's a legitimate difference, compared to "CD vs analog vinyl" comparisons
<superctr__> aliasing actually is quite important for some sounds, and effects of this are different even if you run the same chip at a different clock frequency (relative to the tone)
<cr1901_modern> Not sure I follow... tones are typically represented as a divisor/f_num... wouldn't the normalized frequency (to 1.0 or pi, whatever you want) always be the same regardless of clock freq?
<superctr__> the frequency adjusts the phase (and thus the index into the lookup table)
<superctr__> since there is no interpolation between lookup entries, there will be aliasing
<superctr__> and this is further amplified since operators modulate the phase of each other
<cr1901_modern> ... still not sure I follow. Can I take a rain check?
<cr1901_modern> I can't give this convo the bandwidth it deserves. I haven't taken DSP in 8 years now lol
<cr1901_modern> Remember most of it, but some of the finer points got lost over the years
<superctr__> ok, it's just basic resampling stuff
<superctr__> the size of the lookup table is effectively smaller when the operator frequency is higher relative to the chip frequency
<superctr__> it must be resampled
<cr1901_modern> the operator frequency can either be 0.5, 1, 2, 3, 4, etc times the chip_frequency/(f_num * constant factor)
<superctr__> you also have the detune parameter
<superctr__> and LFO
<cr1901_modern> changing the chip frequency doesn't change the proportion of the frequency of the operators
<superctr__> not the operators themselves
<superctr__> but rather the size of the lookup table
<cr1901_modern> but the number of LUT entries that are jumped over "per n clock ticks" is only dependent on the f_num
<cr1901_modern> AFAICT, the chip doesn't give a shit which frequency it's run at
<cr1901_modern> all it cares about is the f_num for the given channel to determine how to index into the LUT
<superctr__> yeah, the chip doesn't care
<superctr__> you care, if you want your notes to be tuned at a certain frequency
* cr1901_modern nods
<cr1901_modern> (Also, I can empirically prove the chip doesn't care what freq it's run... the OPL2/3 web gateway overclocks the chips when generating audio to send back to the client :P)
<cr1901_modern> (but it still sounds correct when it comes back to the client)
<superctr__> i can formulate it differently and say the effects of aliasing change for different tones for a constant clock frequency
<cr1901_modern> that makes more sense
<superctr__> if you program an FM chip to do a frequency sweep you'll notice it guaranteed
<superctr__> And this is also something i test when i see a new "accurate FM emulator"
<cr1901_modern> w/ floating point, there's probably some level of precision where the same issue applies. Because floating point is, well, discrete. And floating point numbers aren't evenly distributed (though I don't think that matters).
<cr1901_modern> I doubt a floating point FM synth would ever reach those precision problems tho
<superctr__> it depends on the precision yeah
<superctr__> float vs double
<cr1901_modern> The LUT is a quarter-sine wave, but the entire sine wave can be regenerated from that one quarter. So, aliasing effects start kicking in at the f_num that causes the operator to increment by 512 entries
<cr1901_modern> 256 entires in the LUT, 1024 entries in the full sine wave
<cr1901_modern> 512 entries would be equivalent to pi radians
<cr1901_modern> and pi radians is nyquist (QED)
<superctr__> here's an example on the YM2151: https://youtu.be/a4cdFqxEB0Q?t=19
<cr1901_modern> indeed, the PS1 version sounds "pacified" compared to the 2151 version
<cr1901_modern> especially the drums
<superctr__> don't care about the PCM
<cr1901_modern> oh it's not FM drums?
<superctr__> Just the sweep, which is done on a real 2151 in the PSX version
<superctr__> The rest of the song is played entirely on a PCM synth
<superctr__> On emulation you really only hear the sweep up, on the real chip (via the PSX version) the aliasing causes a down sweep too
<cr1901_modern> the sweep isn't even going in the right direction half the time
<superctr__> yeah, that's what i'm talking about
<cr1901_modern> Anyways, is the vgmrips emulation "bad"?
<superctr__> it sounds really bad on the web player because the C140 sample rate is low
<superctr__> if you play the same vgm file in vgmplay and adjust the settings it will sound good again
<cr1901_modern> I'm a little bit confused...
<cr1901_modern> First off, I assume you meant a "recording" of a real 2151 on the PSX version?
<superctr__> the PSX uses redbook audio
<cr1901_modern> right
<superctr__> The music is recorded from an arcade PCB
futarisIRCcloud has joined ##yamahasynths
<cr1901_modern> But it's not the YM2151 emulation's fault that it sounds bad, it's the C140 and bad sample rate interactions, correct?
<cr1901_modern> (on the vgm)
<superctr__> yeah. There are many problems with the render of that vgm
<cr1901_modern> Basically I don't see how this ties into LUT entires in the 2151 being skipped if it's the C140's fault the emulation sounds off.
<superctr__> the C140 sample rate is one problem, the aliasing in the sweep is the FM though
<cr1901_modern> >2015-07-08
<superctr__> Ok, i'll just mute the PCM and play the sweep only
<cr1901_modern> I would've expected the MAME core to emulate the LUT increments by then
<cr1901_modern> sure it sounds wrong
<cr1901_modern> I don't understand why it sounds wrong if the LUT increment is being emulated in the core
<cr1901_modern> (which it SHOULD be by 2015)
<superctr__> to be fair, I don't either
<superctr__> it has to do with aliasing though
<cr1901_modern> that's a very reasonable conclusion :) :P
<superctr__> it could be an off-by-one error somewhere
<superctr__> https://www.dropbox.com/s/bfcltus27uqxqck/2019-04-10_14-59-58.png?raw=1 here are the voice parameters, in case someone cares to bother looking into it :P
nukeykt has joined ##yamahasynths
<cr1901_modern> where'd you get that diagram from?
andlabs has quit [Quit: My MacBook has gone to sleep. ZZZzzz…]
<superctr__> Quattroplay
<superctr__> my own program, it shows the chip parameters during playback
<cr1901_modern> Not that I have an aversion to this, but why does it look like a text mode program that drew directly to the VGA framebuffer?
<superctr__> same font
<superctr__> it's actually SDL2
<cr1901_modern> well, it's something for me to look into later... maybe hook it up to a physical YM2151
<cr1901_modern> Sweep is implemented by changing fnum, correct?
<superctr__> yeah
* cr1901_modern files this away for later
<cr1901_modern> My immediate plans are to: take a nap and file my taxes
<cr1901_modern> yay
<cr1901_modern> once that BS is done I'll be back
<l_oliveira> ctr, you happen to have a vgm of that frequency sweep?
<superctr__> it's right there on vgmrips
<superctr__> hover over the song title in the playlist and select "download vgz"
futarisIRCcloud has quit [Quit: Connection closed for inactivity]
andlabs has joined ##yamahasynths
nukeykt has quit [Quit: Page closed]
andlabs has quit [Ping timeout: 268 seconds]
andlabs has joined ##yamahasynths
andlabs has quit [Quit: My MacBook has gone to sleep. ZZZzzz…]
SceneCAT^APUG has quit [Quit: *Mreow*]
SceneCAT has joined ##yamahasynths
ahihi2 has joined ##yamahasynths
ahihi has quit [Read error: Connection reset by peer]
ahihi2 is now known as ahihi
<cr1901_modern> ahihi: Do you use an automatic script or something to ghost your old name on a disconnect?
andlabs has joined ##yamahasynths
ej5 has joined ##yamahasynths
andlabs has quit [Quit: My MacBook has gone to sleep. ZZZzzz…]