Is drive sound emulation possible?

Support and general discussion.
Post Reply
Banjo
Posts: 6
Joined: Mon 03 Sep, 2018 3:14 pm

Is drive sound emulation possible?

Post by Banjo » Sun 09 Sep, 2018 2:03 pm

Since I'm new to PCem, forgive me if this is commonly asked or indeed can be done and I just don't know it yet... but can we use "drive sounds" for floppy drives in PCem like you can in things like WinUAE (Amiga emulator)?

Until I started messing with PCem, I didn't think I'd ever want such a thing, but the nostalgic beeps of emulating an old XT now makes me really want to hear those grinding floppy drive sound effects too!

If it's not possible, fair enough, but I just wanted to ask as a quick search didn't show up a definitive answer that I could see

(I also miss the distinctive hum and shutdown whine of my old Amstrad 286's fan, but I expect fan noise is outside the scope of most peoples' emulation wishes!)

User avatar
SarahWalker
Site Admin
Posts: 1581
Joined: Thu 24 Apr, 2014 4:18 pm

Re: Is drive sound emulation possible?

Post by SarahWalker » Sun 09 Sep, 2018 4:48 pm

This isn't currently implemented, but has been on my list for a while. Much of the infrastructure for floppy drive sound emulation is already present, I just haven't got round to finishing it off.

User avatar
xXLuckyXx
Posts: 66
Joined: Tue 06 Feb, 2018 3:52 pm

Re: Is drive sound emulation possible?

Post by xXLuckyXx » Sun 09 Sep, 2018 8:09 pm

Yeah. We already have that beep sound when a machine is turning on. Floppy sounds would be a great addition.

User avatar
leilei
Posts: 597
Joined: Fri 25 Apr, 2014 4:47 pm

Re: Is drive sound emulation possible?

Post by leilei » Mon 10 Sep, 2018 12:47 am

<ponderousfeaturecreepbrainfart> For far additional immersion spackle we'd also need fan whirs, speed-modulated hard drive whirs and writes, monitor hums (based on emulated sync) and mechanical keyboard clacking (key press and release sounds with a pitch variance table for each key), and maybe some OpenAL EFX usage to spatialize and filter these sounds for 5.1 or binaurally or have it in a VR video backend driver through OpenGL 3.0 (which would need all of the parts modeled, no easy feat). Sadly no way to emulate the scent of a fresh computer though. </ponderousfeaturecreepbrainfart>


I don't have a good microphone though so sampling drive noises would be rather noisy. Can probably at least do the keyboard stuff. PCem asset production could be interesting.

Cheez
Posts: 8
Joined: Tue 19 Dec, 2017 4:08 am

Re: Is drive sound emulation possible?

Post by Cheez » Mon 10 Sep, 2018 2:41 am

xXLuckyXx wrote:
Sun 09 Sep, 2018 8:09 pm
Yeah. We already have that beep sound when a machine is turning on. Floppy sounds would be a great addition.
But that's part of the machine. It's not an external noise.
leilei wrote:
Mon 10 Sep, 2018 12:47 am
speed-modulated hard drive whirs and writes, monitor hums (based on emulated sync)
Let's be real here, i'd want these. Hell, for hard drives, go all the way. Emulate various classics. I got dozens of them, i'd just need a program to give them controlled activity patterns to get some useful sound effects.

Banjo
Posts: 6
Joined: Mon 03 Sep, 2018 3:14 pm

Re: Is drive sound emulation possible?

Post by Banjo » Tue 11 Sep, 2018 9:16 am

I'd love all those sounds, but drive sounds are my only real "must have" for a nostalgic feel.

Getting various fan whines and hums would be awesome, but probably a lot of work for something that would (at least in my case) be drowned out by my real PC's fans, keyboard clacks, etc. anyway. Nothing sounds like that distinctive floppy "grind" though, as I've been reminded as I bought a new external USB FDD recently to image some old disks, and found the sound it makes both nerve-wracking ("is that disk corrupted?!") and deeply nostalgic. :)

I do long for the smell my old PCs used to make, though. Not sure if it's false memory, but I don't find new ones smell the same, though that's probably because the old ones were likely badly cooled or overheating and we didn't know it! My old Amstrad 286 had a scent I can still recall (and when it shut down, it gave a cute little whine that's not too dissimilar to ORAC's shutdown sound effect from Blake's 7). My most vivid memory of my 486/DX (which cost a small fortune, and I had to get a loan for it!) is the smell and ambient hum it gave off, too.

User avatar
leilei
Posts: 597
Joined: Fri 25 Apr, 2014 4:47 pm

Re: Is drive sound emulation possible?

Post by leilei » Tue 18 Sep, 2018 11:49 am

this may or may not be something i'm working on


Some theories crossed my mind during sleep and thus, sound_stuff.c was born on Sep 16 2018

- reads 2 48khz 16bit mono raw PCM samples from roms/
- there's a very subtle speed variation with a sine on the whirr
- the write sound is just naively read from readflash as I haven't looked deep into the disc code to do it for real yet
- many iir filters are used, and a light reverb effect is applied. No OpenAL EFX involved
- sounds BAD when execution drops. this stuff probably needs a second thread and sound buffer
- i thought about doing floppy sounds since i couldn't find much of the 'ddnoise' stuff that wasn't hooked up as far as i can tell. I had my own ideas for that and i may/may not implement floppy sounds.

ChronicEel93
Posts: 17
Joined: Thu 29 Sep, 2016 7:17 pm

Re: Is drive sound emulation possible?

Post by ChronicEel93 » Tue 18 Sep, 2018 2:29 pm

I'm actually in love with where this thread is going. I'd recommend using a shorter sample for the clicking sounds, if it's too long (and it is) it can sound a bit weird when it clicks a lot. (sort of like when physics objects get stuck in the ground in Half Life). I'd also recommend toning down the reverb on the clicking, but that's just a personal preference! It sounds awesome, and I hope to see this become a feature.

shareware123
Posts: 8
Joined: Tue 22 May, 2018 8:23 pm

Re: Is drive sound emulation possible?

Post by shareware123 » Wed 19 Sep, 2018 3:31 pm

LOVE THIS!

Banjo
Posts: 6
Joined: Mon 03 Sep, 2018 3:14 pm

Re: Is drive sound emulation possible?

Post by Banjo » Wed 19 Sep, 2018 3:48 pm

leilei wrote:
Tue 18 Sep, 2018 11:49 am
this may or may not be something i'm working on


Some theories crossed my mind during sleep and thus, sound_stuff.c was born on Sep 16 2018

- reads 2 48khz 16bit mono raw PCM samples from roms/
- there's a very subtle speed variation with a sine on the whirr
- the write sound is just naively read from readflash as I haven't looked deep into the disc code to do it for real yet
- many iir filters are used, and a light reverb effect is applied. No OpenAL EFX involved
- sounds BAD when execution drops. this stuff probably needs a second thread and sound buffer
- i thought about doing floppy sounds since i couldn't find much of the 'ddnoise' stuff that wasn't hooked up as far as i can tell. I had my own ideas for that and i may/may not implement floppy sounds.
That's pretty darn awesome!

As I said, floppy drive sounds are my only "must have" but those HDD sounds and - even more so - that ambient noise are amazingly atmospheric and nostalgic!

User avatar
SarahWalker
Site Admin
Posts: 1581
Joined: Thu 24 Apr, 2014 4:18 pm

Re: Is drive sound emulation possible?

Post by SarahWalker » Sat 22 Sep, 2018 3:43 pm

That's a noisy hard drive you have there. The speed variation sounds pretty good to me.

For floppy stuff, it might be (well, probably is) worth looking at what I did for B-em, of which you've already found vestigial references. Code is at https://github.com/stardot/b-em/blob/ma ... /ddnoise.c (using Allegro unfortunately), 3.5" samples at https://github.com/stardot/b-em/tree/master/ddnoise/35 - there are also 5.25" samples there but they're at too slow a step rate for PC stuff. The 3.5" samples were sampled from an Acorn Electron Plus 3 (Chinon F353 single-sided drive), but sound a lot like the drive in my original 486.

User avatar
leilei
Posts: 597
Joined: Fri 25 Apr, 2014 4:47 pm

Re: Is drive sound emulation possible?

Post by leilei » Sun 23 Sep, 2018 12:16 am

I actually sampled a PD sample of a table saw and sampled an old keyboard (with heavy cleanup). My mics are too noisy to sample my real drives.

One idea for floppy sound I have would be playing sounds from different positions in a long floppy read sample according to what sector's read/written to. i'd have to record a bad diskette getting cloned for that

MAME does have floppy drive samples but they don't sound anything close to work with IMO.

Since the video, i've implemented just reading sounds from roms/whatevermachineromset/idle.pcm etc, i'd do a sounds/whatevermachineromset/ etc or sounds/reallyloudolddeskstar but that'd mean entering the Wx zone since i've never messed with Wx gui editing before and so far all of this stuff is in one new c file

(what's unmentioned but heard in the video is pc speaker echo/pan, which was an important learning step prior to making hdd noise)

BigAlUK
Posts: 33
Joined: Mon 15 Feb, 2016 8:27 pm

Re: Is drive sound emulation possible?

Post by BigAlUK » Sun 23 Sep, 2018 10:14 am

I'm tempted to suggest that you add the sound that a real drive makes when its bearings finally wear out.

Or the sound that old capacitors make when they finally burst and explode.

These sounds may be soon lost to humanity as the real machines we emulate finally bite the dust.

:)

User avatar
leilei
Posts: 597
Joined: Fri 25 Apr, 2014 4:47 pm

Re: Is drive sound emulation possible?

Post by leilei » Sun 23 Sep, 2018 11:21 am

Maybe the clang of an Orchid Voodoo......

User avatar
SarahWalker
Site Admin
Posts: 1581
Joined: Thu 24 Apr, 2014 4:18 pm

Re: Is drive sound emulation possible?

Post by SarahWalker » Sun 23 Sep, 2018 2:14 pm

BigAlUK wrote:
Sun 23 Sep, 2018 10:14 am
I'm tempted to suggest that you add the sound that a real drive makes when its bearings finally wear out.

Or the sound that old capacitors make when they finally burst and explode.
Having had an old capacitor explode and hit me in the forehead recently, I suspect this has a high chance of triggering PTSD.

BigAlUK
Posts: 33
Joined: Mon 15 Feb, 2016 8:27 pm

Re: Is drive sound emulation possible?

Post by BigAlUK » Mon 24 Sep, 2018 7:29 am

Yes - hurts, doesn't it.
I've been hit by a deep fried chip too :)
And it's the surprise that hurts the most
Followed by a sudden feeling of deep depression.

ChronicEel93
Posts: 17
Joined: Thu 29 Sep, 2016 7:17 pm

Re: Is drive sound emulation possible?

Post by ChronicEel93 » Sat 29 Sep, 2018 12:46 am

Could possibly use contact mics to sample drive sounds? Could then mix them properly (simulated speakers for headphone users!!!) for maximum nostalgia! That would also probably be pretty hard.

User avatar
leilei
Posts: 597
Joined: Fri 25 Apr, 2014 4:47 pm

Re: Is drive sound emulation possible?

Post by leilei » Thu 04 Oct, 2018 12:15 pm

OK I've made floppy sounds now and i've done it this way:

- there's two samples used for the head moving, and 2 samples used for the step, and 2 sounds used for the motor (which right now only turns on when seek is called and loops 6 times then stops)
- fdc.c has a bunch of stuff_floppy_seek calls to make the simulated head move from track to track
- the head samples are tiny (~4kb) and get looped quickly and slowly changing in speed depending on where the head is. The volumes also variate (louder on one sample than the other depending on the direction moving)
- I sampled my floppy drive for sounds, that was noisy and a lot of the sound ended up cleaned out roughly, so it's missing all the necessary highs for a believable floppy drive.
- There's also an adgold_lowpass_iir on the samples depending on where the head is
- I hastily hacked in a delay to get the fdd to stop thinking until the head stops (it's the only way i could hear more of that boot seek to tune my head movement speed), unfortunately this is the wrong way to go about things as you can see the floppy access is really really slow in this video. I actually trimmed a minute of it out
- scandisk on a write-protected disk is intended to produce the rapid stepping noise (I had that in my recording as reference to see how fast it would be allowed)
- the code is a mess and does not yet handle multiple drives :D EDIT: now it does. yay structs


EDIT 2: I've recently attempted keyboard simulation and my first attempt (reading pcem_key, lookup table to have pans and pitches) have been bad so far. The arrows and the insert/pgup/etc keys seem to fire off way too many sounds)


Post Reply