4 ms·
Oddly this sounds more like a 40% pulse wave than a 50% square wave. I assume the original was played on a 50% square wave. EDIT: Upon reading the original cod
by nyanpasu64 5y ago
Oddly this sounds more like a 40% pulse wave than a 50% square wave. I assume the original was played on a 50% square wave.
EDIT: Upon reading the original code:
int volume = 60;
periodMicros = 1000000/((long)freq);
onMicros = periodMicros * volume/100;
offMicros = periodMicros * (100-volume)/100;
volume doesn't control the volume, but the duty cycle (timbre and harmonic content) of the waveform. And it looks like I guessed the 40% (audibly equivalent to 60%) duty cycle exactly!
- sgt 5y agoYou've got a good ear!
- ttsiodras 5y agoSpot on! I planned initially to control the volume with a potentiometer - but abandoned the plan when I got to the "sounds good enough" :-)
- SamBam 5y agoCan you tell me what you're hearing? I don't recall the original music well enough, but this one sounds slightly muddy -- would a 50% square waves sounds crisper?
- nyanpasu64 5y agoI used to make chiptune (and still do to some extent). Pulse waves (periodically alternating high and low sound pressures) are a type of waveform, and the width or duty cycle of the waveform (the percent of the time the sound pressure is high rather than low) controls the harmonic spectrum and perceived timbre. I could identify by listening that it was greater than 25% but less than 50% by listening by ear, and hone in on a guess by comparing to FamiTracker's emulated VRC6 (which can output duty cycles between 6.25% and 50% in steps of 6.25%). I don't know what you mean by "muddy", but I did notice the speaker (perhaps mic too) has a crappy frequency response, and the bass notes are quiet and difficult to identify the pitch of.
- jeffalyanak 5y agoJust to add a datapoint, I've been making chip music for nearly 15 years and being able to accurately hear pulsewidth, waveform (assuming a simple, fundamental chiptune waveform like square, saw, triangle) is actually relatively common with a bit of experience. When I got started I was awed by it in others I talked to on IRC, but it wasn't too long before I was familiar with it, too. It's also pretty easy for me—and I'd bet for nyanpasu64 as well—to identify the actual PSG or platform used and even to get a good idea of what sort of sequencing/programming is involved to get any particular sound I hear. For me it's pretty specialized, though. I absolutely can't do that with traditional music production. I wouldn't be able to tell you too much about music I heard produced with modern tools.
- tobr 5y agoDescribing timbre in text is difficult, but I wouldn’t say a symmetric square wave is “crisper”. Maybe more hollow, tooty, clarinet-like. Asymmetric pulses first sound richer but less clear, brighter, more nasal, then as you get to more extreme settings it starts to sound thin and fragile.
- rosstex 5y agoIs there a website for experimenting with waves and duty cycles and observing how the sound changes?
- nyanpasu64 5y agohttps://webaudiodemos.appspot.com/oscilloscope/index.html https://webaudiodemos.appspot.com/oscilloscope/index.html seems okay but it only supports one note.
- lashkari 5y agoHeads up: I opened this link in a new tab and it immediately started playing a very loud, constant tone. If you're wearing headphones or have your speakers turned up, be careful!
- endymi0n 5y agoI just love how good us humans can get at nichy distinction topics if we just keep at the task long enough (and start early). We once had a film crew in our school trying to get some shots of us at the computer. I overheard them having big problems getting the CRT flicker free on camera and trying to find out the refresh rate. I was maybe 12 at the time and just told them point blank it‘s 60Hz. They asked me how I knew and I just told them I could see it from the feel of the flicker. Was a good guess as well since it was one of the standard VESA frame rates. The cameraman came back to that kid 3 minutes later, showing me the shutter set to exactly 59.7 Hz with a still very surprised face.