Login
Back to forumReply to this topicGo to last reply

Posted By

Blacky Stardust
on 2016-01-28
14:34:19
 how to play 8bit samples

Hiya all,

I'm the project leader of the VICE emulator, and I'm making a test program for digital input/output.

For that test program I would like to output 8bit samples on the c16/plus4, could any-1 give me some code that can do this, or a link to an example ??

Posted By

Csabo
on 2016-01-28
16:05:13
 Re: how to play 8bit samples

Hi there,

First off, replaying samples in 8 bits is not possible (unless you have some extra hardware). So, assuming you just mean play 8 bit samples, check out the source of Uwol or Nyan Cat (both play digital samples). Or perhaps even easier, try Csabo's Wave Converter, this can turn your 8-bit samples into ready-to-run program files. We even have an article on this in the Encyclopedia: http://plus4world.powweb.com/plus4encyclopedia/500201

Posted By

gerliczer
on 2016-01-28
16:16:26
 Re: how to play 8bit samples

Another way to improve VICE emulation would be co-operation with the authors of the so far best two emulators, YAPE by Gaia and plus4emu by IstvanV. Gaia visits often this site. Unfortunately, lately IstvanV wasn't seen here at all, but his emulator is open source, so borrowing his ideas may be fine if he's credited for them.

Posted By

Blacky Stardust
on 2016-01-28
16:18:54
 Re: how to play 8bit samples

Hiya Csabo, thanx for replying.

What the intention is a piece of code that gets an 8bit sample and then plays it on the ted in whatever form the ted can handle.

For the vic it is done by down-scaling to 4 bits and then feed that value to the sound register of the vic.

For the sid it's something similair, so a little piece of code that gets an 8bit sample in the A register and then
'plays' it is what I'm looking for.

Posted By

Blacky Stardust
on 2016-01-28
16:21:15
 Re: how to play 8bit samples

I've had contact with Gaia in the past, he even submitted some patches to vice, the main problem is that no-1 on the vice team has in-depth plus4 knowledge.

Posted By

Csabo
on 2016-01-28
16:24:00
 Re: how to play 8bit samples

Yeah, about same for the TED (as per the KB entry above). Just try the Wave Converter utility, it'll give you the sample converted the proper way and the short player code.

Posted By

gerliczer
on 2016-01-28
16:48:56
 Re: how to play 8bit samples

There is also TedPlay written by Gaia. It is a TED music player and also an open source programme. Obviously, it also has some TED sound emulation with source code.

Posted By

MMS
on 2016-01-28
18:56:21
 Re: how to play 8bit samples

I spoke some time ago with one of the creators of a sample player, and he said, that after mixing the 3 8bit samples it was a nightmare to bring it down to 3 bit resoltion, there was always some distorsion in the calcuation. Finally there was an idea to create a table (this method is very well known and used by the scene now, but back to 1991 seemed to be a bright idea) that for each 8bit value variation they crated the 3 bit equivalent value, so with this table without very intensive and smart calculations you can set the proper value. It if did not sound right, then only one of teo values need to be changed, not the complete routine.

8bit sample could be pushed out to the Digi-blaster output of the SID card, that is an 8bit output, but this hardware is highly unsupported.
I do not know,how well is documented, or just need a register address?

Also, the User port P0-P7 bits can be used to send out the 8bit sound data to a potential DA converter (like my Ferranti ZN428E) and it will also do the conversion CPU resource free. It is NOT done yet, but wll be very CLOSE to my PC Covox card (connected to PC Printer port):


I think it is much more CPU efficient (not to mention better quality) if you bit-bang the the 8bits to a device has 8bit resolution.

Posted By

RobertB
on 2016-01-29
01:12:25
 Re: how to play 8bit samples

Blacky Stardust wrote:

> For the sid it's something similair, so a little piece of code that gets an 8bit sample in
> the A register and then 'plays' it is what I'm looking for.

For the C64 and C128, Digimaster 64 and Digimaster 128 do 8-bit sampling (up to 11 KHz) and play back through the SID.

Truly,
Robert Bernardo
Fresno Commodore User Group
http://www.dickestel.com/fcug.htm

Posted By

gerliczer
on 2016-01-29
01:21:49
 Re: how to play 8bit samples

MMS and RobertB seem somehow misunderstood what Blacky Stardust is trying to do. He is not interested in any kind of hardware extensions or how other Commodore machines work. He wants to know specifically how the 264 series machines can be used to play 8 bit digital sounds. I guess, he wants to try writing a test program to use it improving TED digital sound replay.

Csabo and Chronos released some years ago Nyan Cat with sources. I think, that would be a perfect example. HVTC also has the digi part as a stand-alone programme.

Posted By

MMS
on 2016-01-29
04:57:52
 Re: how to play 8bit samples

Thanks for clarification. In fact, it cannot. It can output only 3bit samples, only internally it is 8 bits sample happy

Posted By

Chicken
on 2016-01-29
08:03:21
 Re: how to play 8bit samples

That's not quite correct. Even without any tricks TED has 9 volume levels (00-08) that can be used for digi playback. Though, already in the 80s digi playback routines used certain values for $ff11 to approach something that comes closer to 4bit output. (Btw, the early digi playback routines didn't use timers but were timed by NOPs and loops. The first time I saw a timer used was in some demo by Boomby or so.)

Back in the days of the mailing list, we discussed digi playback using a duty cycle routine. I think TCL stated that it's possible to achieve something close to 5bit playback. However, that's done in the latest wave converters as well – without eating up all cycles wink

The easiest way to playback 8 bit samples is to use a simple look-up table. Csabo included one – supplied by TCL – in his code that approaches 8bit resolution. So it's really already there and you just have to look at it wink

Posted By

gerliczer
on 2016-01-30
11:16:18
 Re: how to play 8bit samples

While we had Blacky Stardust with us, I should have asked him if the team ever plans releasing a new official VICE version or it will stay in a continuous improvement and build phase forever? Damn, I missed my chance.



Back to topReply to this topic


Copyright © Plus/4 World Team, 2001-2024