News:

Printed Amstrad Addict magazine announced, check it out here!

Main Menu

sampling sound using cpc+ analogue port

Started by arnoldemu, 12:25, 18 March 10

Previous topic - Next topic

0 Members and 1 Guest are viewing this topic.

arnoldemu

I was asked this many years ago.

So, is it possible to sample sound using the cpc+ analogue joystick port?

I know the accuracy would be 6-bit, but is it possible to read the hardware fast enough to sample sound? I think the analogue joystick registers are not updated by the asic fast enough?

EDIT: Updated 200 times per second = 200Hz samples. hmmm.. too slow.  :o
My games. My Games
My website with coding examples: Unofficial Amstrad WWW Resource

Bryce

I built a device for the Atari 800XL which allowed you to sample music through its analogue port. For the time (some time in the 80's) it was ok, music / voices were recognisable, but by no means anything like the 44Khz MP3s we have got used to these days. It was used to create masterpieces such as the voice in Codemasters Super Robinhood (if you can remember what that sounded like) . As long as you don't expect too much and you play it back at the correct speed, it can add some cool effects to games or demos.

Bryce.

nocash

> 200Hz samples. hmmm.. too slow.  :o

You can shortcut all 8 inputs with each other, then you have 1600Hz :-) Of course that isn't much better, and you'd need to modify some things inside of the computer to get the extra 4 inputs. So that idea isn't recommended at all.

Cholo

Back in the day i visited a fellow Amstrad user and got a sample program he had written himself. Idea of the program was quite simple. It would record up to about 20 second of audio from a audio tape. Simply had to insert a tape in my 464 and it would read the audio back and create a rsx for playback. You could then save the whole thing and use it in your basic programs.
What impressed me back then was the quality of the audio, as it was much "cleaner" than the usual game samples. Fun and easy recording your own voice yelling "King of the world" then let the 464 tapedeck read it into memory and then hear it play back from the speakers.

MacDeath

#4
Perhaps the 464+ is not the shitfest unusefull shit we may think...

Let me explain : a device (software), french if I remember well, permited to sample using the Tape recorder/drive from the 464... As you explained us.

So a 464 may do this too (while a 6128, tapeless as we know, can't!...)

And it has the extra PLUS DMA stuff...so is fully compatible with a 6128+PLUS...


Bref...brief...


Do you think an update from the soft permiting samplings from tape drive may be updated to the 464+ ?
And with the additionnal Tape port and any modern digital sound device (so a clear signal...) enable a sweet sample ?

with even better capacity than on a good old 464 ? (thanks perhaps to the DMA channels or even a Ram upgrade ???)


Yet, thx to the modern era, we may get compatible samples just by any kind of software ripping from a PC... no ?

Bryce

Connecting an ADC (Analogue to Digital Convertor) to the expansion port, mapped to an address, would be simple and not particularly expensive to build and would work on all CPCs, I'd put together a schematic if somebody really wants it, but is the interest there? How many people are interested in building a piece of hardware with such limited functionality?

Bryce.

arnoldemu

Quote from: MacDeath on 01:35, 19 March 10
Perhaps the 464+ is not the shitfest unusefull shit we may think...
Fantastic. I love the use of 464+ and shitfest here.

I have a 464+ (and a 6128+), and indeed it is like having a geforce 8 graphics card with 32k of ram  :P
My games. My Games
My website with coding examples: Unofficial Amstrad WWW Resource

arnoldemu

Quote from: Cholo on 01:03, 19 March 10
Back in the day i visited a fellow Amstrad user and got a sample program he had written himself. Idea of the program was quite simple. It would record up to about 20 second of audio from a audio tape. Simply had to insert a tape in my 464 and it would read the audio back and create a rsx for playback. You could then save the whole thing and use it in your basic programs.
What impressed me back then was the quality of the audio, as it was much "cleaner" than the usual game samples. Fun and easy recording your own voice yelling "King of the world" then let the 464 tapedeck read it into memory and then hear it play back from the speakers.
This sounds like the common sample using the tape-input, 1-bit samples.

It is actually suprising how well it can do this especially since the tape hardware is effectively turning an analogue input into a 1-bit digital output.

My games. My Games
My website with coding examples: Unofficial Amstrad WWW Resource

arnoldemu

Quote from: Bryce on 09:20, 19 March 10
Connecting an ADC (Analogue to Digital Convertor) to the expansion port, mapped to an address, would be simple and not particularly expensive to build and would work on all CPCs, I'd put together a schematic if somebody really wants it, but is the interest there? How many people are interested in building a piece of hardware with such limited functionality?

Bryce.
hmmm.. I'm not interested to be honest,  I was more wondering if the existing analogue on the cpc+ can be used.
But it seems no, it is useless. I am not sure that putting all the ADC channels together would actually increase the sample rate. I suppose it all depends on how each of the adc channels are updated. e.g. if they are all updated in parallel or if they are updated serially.

Serially, then you could improve the sample rate because you would spread the samples over the time, parallel then all your getting is a better sample value (e.g. 16-bit compared to 8-bit) but still every 200Hz  :P
My games. My Games
My website with coding examples: Unofficial Amstrad WWW Resource

redbox

Quote from: Bryce on 09:20, 19 March 10
Connecting an ADC (Analogue to Digital Convertor) to the expansion port, mapped to an address, would be simple and not particularly expensive to build and would work on all CPCs, I'd put together a schematic if somebody really wants it, but is the interest there? How many people are interested in building a piece of hardware with such limited functionality?

I'm pretty sure Dragonbreed Wetware did this back in the day... they had some 4-bit samples on a classic CPC that sounded really good.

Can't find a link to the DSK on any of the normal FTP servers though  :(

arnoldemu

Quote from: redbox on 10:55, 19 March 10
I'm pretty sure Dragonbreed Wetware did this back in the day... they had some 4-bit samples on a classic CPC that sounded really good.

Can't find a link to the DSK on any of the normal FTP servers though  :(
I've seen these, but I don't have any of them anymore :(
My games. My Games
My website with coding examples: Unofficial Amstrad WWW Resource

MacDeath

#11
http://cpcwiki.eu/index.php/Ultra_Son

Ultra Son, I was searching how it was named.

Has some of you tried it on a 464+ yet ?
Do you think the software be updated to get extra stuff for the PLUS range  or extra memory ? is this even possible ?

Or is it better to get a proper hardware extension card indeed ?

QuoteFantastic. I love the use of 464+ and shitfest here.
I was in BDC-IRON mode... ;D
But yeah, a shame a PLUS from Amstrad still got only 64K while any Amstrad's Speccy had their 128K on...Oh, and tapes of course...


Yet it may be a usefull use to add the Tape connector socket to a 6128+...

zhulien

From memory I put the Dragonbreed sampled I think We're Alone Now on the 1994 CPC Decade CDROM for Amstrad CPC if you can find it... It does have a very good quality sample - which makes me wonder if it uses a similar method to the 14 bit Samples on OCS Amigas.  But CPC has really only 3 bits and a noise - with the PlayCity we now have 9bits and 3 noises, so maybe a better quality 8+ bit sample method can play on that combination.  By playing all 3 AY's at different volumes hopefully with minimal or no overlap - then playing the sample bits out to all 3 chips.  The downside is that it will sound crap if you are listening in stereo - so might want to run the outputs back to the CPC's audio line in on the expansion bus so that all 3 chips come out through the internal speaker.

Shining

Back in 87 or 88 I was jealous about something I've seen on an evil commodore machine. The thing played a song called holiday rap (https://en.wikipedia.org/wiki/Holiday_Rap). Then some time later the german mag CPCAI published a rsx-extension to record via tape and play this back. So I did a version, for sure superior to the evil version, of this rap. Also using some loops, years before we had something like the digitrakker. Since I did not own this song, I recorded it from fm-radio. So the cpc-version is recorded from a recorded version  :) .


So for reference, here an attached dsk with the rap and the rsx-extension.


I think, I still have the CPCAI issue. So if there is interest (especially perhaps for our basic-coders here), I can translate the article.
TGS is back

Download my productions at:
cpc.scifinet.org

PulkoMandy

Quote from: arnoldemu on 10:42, 19 March 10
But it seems no, it is useless. I am not sure that putting all the ADC channels together would actually increase the sample rate. I suppose it all depends on how each of the adc channels are updated. e.g. if they are all updated in parallel or if they are updated serially.

Serially, then you could improve the sample rate because you would spread the samples over the time, parallel then all your getting is a better sample value (e.g. 16-bit compared to 8-bit) but still every 200Hz  :P


It's quite likely to be done serially, as this allows a single real DAC unit, and an analogue multiplexer to connect it to the various outputs. In a typical converter there is a "sample and hold" (https://en.wikipedia.org/wiki/Sample_and_hold) unit, and then the actual conversion is done on the stored value. It is easy to sample from multiple sources serially, then.

TFM

Why to invent the wheel again?


We got the very wonderful CPC Booster+ which allows to sample stereo in 8 bit. For playback you can use it too (stereo) or you also can use the DigiBlaster (however in mono only).


And for MP3 playback somebody could make some more FuturePlayers.  ;D
TFM of FutureSoft
Also visit the CPC and Plus users favorite OS: FutureOS - The Revolution on CPC6128 and 6128Plus

ASiC

Quote from: TFM on 16:06, 29 September 16


And for MP3 playback somebody could make some more FuturePlayers.  ;D


Yeah, but we'll need an mp3 encoder for the CPC ...
I'm assuming speed will be around one track per month?!  :P

zhulien


TFM

#18
Quote from: ASiC on 21:43, 29 September 16

Yeah, but we'll need an mp3 encoder for the CPC ...
I'm assuming speed will be around one track per month?!  :P

Why using an encoder, you can everything online in these days. And CPC can play up to 128 kbps. Never tried more, it may be possible.

Quote from: zhulien on 15:00, 30 September 16Really cpc booster+ can do that?

Yes, you just read or write to a port. Everything else (also the timing!) can be done by the CPC Booster+. But don't confuse it with the cut down Mini-Booster, the Mini-Booster can't.
TFM of FutureSoft
Also visit the CPC and Plus users favorite OS: FutureOS - The Revolution on CPC6128 and 6128Plus

PulkoMandy

One of the two jacks is the audio/analog input. The other is audio/PWM output. So yes, it can do that.
I think the only software using this is ROM Orange: http://ftp.cpc-power.com/index.php?page=detail&num=7683

TotO

Quote from: TFM on 15:47, 30 September 16But don't confuse it with the cut down Mini-Booster, the Mini-Booster can't.
Exactly, the CPC Booster offer an ADC feature while the MiniBooster offer a SPI interface.
"You make one mistake in your life and the internet will never let you live it down" (Keith Goodyer)

TFM

Quote from: TotO on 18:12, 30 September 16
Exactly, the CPC Booster offer an ADC feature while the MiniBooster offer a SPI interface.


Can you please tell how to use the SPI for sound-sampling and playback? Sorry for asking, but I'm more a Softie Software person.  ;) :)
TFM of FutureSoft
Also visit the CPC and Plus users favorite OS: FutureOS - The Revolution on CPC6128 and 6128Plus

TotO

The MiniBooster offer two PWM channels for playback.
About sampling, we can probably do something funny with that: https://www.adafruit.com/product/856


:-*
"You make one mistake in your life and the internet will never let you live it down" (Keith Goodyer)

TFM

Quote from: TotO on 19:52, 30 September 16
The MiniBooster offer two PWM channels for playback.
About sampling, we can probably do something funny with that: https://www.adafruit.com/product/856
:-*


Ah cool!  :)  How to connect to PWM channels to an amplifier?

TFM of FutureSoft
Also visit the CPC and Plus users favorite OS: FutureOS - The Revolution on CPC6128 and 6128Plus

Bryce

Quote from: TFM on 22:02, 30 September 16

Ah cool!  :)  How to connect to PWM channels to an amplifier?

PWM is a digital signal, it would need to be decoded, not just amplified.

Bryce.

Powered by SMFPacks Menu Editor Mod