vDrive: With MDV sound? I wonder.
-
- Gold Card
- Posts: 433
- Joined: Tue Mar 11, 2014 8:00 pm
- Location: Oxford, UK.
- Contact:
vDrive: With MDV sound? I wonder.
A conversation on the QL Facebook page got me wondering how easy it would be to get the digitised sound of a microdrive running to play when the vDrive was accessed.
I came across this interesting project, with uses the internal flash in an ATtiny85 chip as a sample storage and outputs audio directly. http://www.technoblogy.com/show?QBB&fbc ... 0-_7zAhHQ0
The device is 5V tolerant so can be powered directly from the vDrive's regulator. It could be triggered using the LED output, though that may need a transistor.
I'm not sure if the beeper on the vDrive could be coaxed into playing a normal sound or if you'd need a separate speaker.
I came across this interesting project, with uses the internal flash in an ATtiny85 chip as a sample storage and outputs audio directly. http://www.technoblogy.com/show?QBB&fbc ... 0-_7zAhHQ0
The device is 5V tolerant so can be powered directly from the vDrive's regulator. It could be triggered using the LED output, though that may need a transistor.
I'm not sure if the beeper on the vDrive could be coaxed into playing a normal sound or if you'd need a separate speaker.
Re: vDrive: With MDV sound? I wonder.
You mean play that whirring sound instead of the beep? That would be great. One of the nicer sounds I remember on the QL is when a microdrive was working perfectly and it would just do a whir for a sector read, stop, and then do the next one and continue all the way through to the end. That would be nice vDrive add-on.
-
- Gold Card
- Posts: 433
- Joined: Tue Mar 11, 2014 8:00 pm
- Location: Oxford, UK.
- Contact:
Re: vDrive: With MDV sound? I wonder.
Well, I've managed to program an ATTiny85 device with a sampled recording of a Microdrive running.
It's a bit too quiet and needs a low-pass filter. I'd also need a transistor to allow the output of the red LED to trigger the device.
https://youtu.be/JjI5IM0YOJQ
It's a bit too quiet and needs a low-pass filter. I'd also need a transistor to allow the output of the red LED to trigger the device.
https://youtu.be/JjI5IM0YOJQ
-
- Gold Card
- Posts: 433
- Joined: Tue Mar 11, 2014 8:00 pm
- Location: Oxford, UK.
- Contact:
Re: vDrive: With MDV sound? I wonder.
I've now managed to get the vDrive to control the power to the ATTiny85, not before accidentally blowing up the LED when I had the base and collector wired the wrong way araound, but that's easily fixable.
https://youtu.be/KWYmWIQzo5A
I need to add an opamp and a low-pass filter to get the proper rumble.
https://youtu.be/KWYmWIQzo5A
I need to add an opamp and a low-pass filter to get the proper rumble.
-
- Gold Card
- Posts: 433
- Joined: Tue Mar 11, 2014 8:00 pm
- Location: Oxford, UK.
- Contact:
Re: vDrive: With MDV sound? I wonder.
Actually I think I'm there, other than making a PCB and soldering the components.
I've created a new and better sample, with a higher volume and cutting out some of the peaks and then set the ATTiny85 to play at double the speed it was previously, which was already a factor of 4 faster than the sample code said it should be and...
https://youtu.be/VhUG1TIi_j8
P.S. I've only been testing this with the vDrive ZX at the moment but does it make difference to the experience! It just feels and sounds right. It's as if you're using a real Microdrive. It make soooo much difference.
I'll generate a schematic and post the code so that others can make this. Maybe Charles can change the vDrive and add this instead of the beeper? The cost of the components is probably in the region of 50p or less.
I've created a new and better sample, with a higher volume and cutting out some of the peaks and then set the ATTiny85 to play at double the speed it was previously, which was already a factor of 4 faster than the sample code said it should be and...
https://youtu.be/VhUG1TIi_j8
P.S. I've only been testing this with the vDrive ZX at the moment but does it make difference to the experience! It just feels and sounds right. It's as if you're using a real Microdrive. It make soooo much difference.
I'll generate a schematic and post the code so that others can make this. Maybe Charles can change the vDrive and add this instead of the beeper? The cost of the components is probably in the region of 50p or less.
-
- Gold Card
- Posts: 433
- Joined: Tue Mar 11, 2014 8:00 pm
- Location: Oxford, UK.
- Contact:
Re: vDrive: With MDV sound? I wonder.
Here are the schematics for the vDrive sampled sound board plus source code and compiled HEX file to load onto the ATTiny85 20U.
http://www.lingula.org.uk/~steve/share/vdrive-sound/
http://www.lingula.org.uk/~steve/share/vdrive-sound/
-
- Gold Card
- Posts: 433
- Joined: Tue Mar 11, 2014 8:00 pm
- Location: Oxford, UK.
- Contact:
Re: vDrive: With MDV sound? I wonder.
I've built the first version of the sound unit today and it does actually work.
The card itself fits nicely under the SD card holder.
The card itself fits nicely under the SD card holder.
Re: vDrive: With MDV sound? I wonder.
Cool idea, congratulations!stephen_usher wrote:I've built the first version of the sound unit today and it does actually work.
Crazy how far the gap between wishes for QL style hardware is. Ranging from "several generations newer than Q60" down to "simulate 1984 technology - but please with sound"...
-
- Font of All Knowledge
- Posts: 3973
- Joined: Mon Dec 20, 2010 11:40 am
- Location: Sunny Runcorn, Cheshire, UK
Re: vDrive: With MDV sound? I wonder.
Hi,
Is it possible to programme the sound, so that we can have custom sounds?
Is it possible to programme the sound, so that we can have custom sounds?
Regards,
Derek
Derek
-
- Gold Card
- Posts: 433
- Joined: Tue Mar 11, 2014 8:00 pm
- Location: Oxford, UK.
- Contact:
Re: vDrive: With MDV sound? I wonder.
Yes, as it's merely a WAV file which has been converted into a C array of unsigned byte values which is then sent to the chips digital to analogue converter. The sample can't be very long though as the chip only has a small memory for the program.
i.e.
i.e.
Code: Select all
// Audio encoded as unsigned 8-bit, 8kHz sampling rate
const uint8_t mdvsnd_wav[] PROGMEM = {
0x52, 0x49, 0x46, 0x46, 0xa2, 0x0a, 0x00, 0x00, 0x57, 0x41, 0x56, 0x45,
...
0x52, 0x24, 0x69, 0x95, 0x96, 0xac
};
unsigned int mdvsnd_wav_len = 2730;
// Sample interrupt
ISR (TIMER0_COMPA_vect) {
char sample = pgm_read_byte(&mdvsnd_wav[p++]);
OCR1A = sample; OCR1B = sample ^ 255;
// End of data? Go to sleep
if (p == mdvsnd_wav_len) {
p = 0;
}
}