Jump to content
IGNORED

Voice without intellivoice


artrag

Recommended Posts

I ended with this, that works but it looks ugly


VoicePlayerInit:	PROCEDURE
		SndFlag = 1
		nsfx = 17:	rem test value
		on (nsfx) goto v0,v1,v2,v3,v4,v5,v6,v7,v8,v9,v10,v11,v12,v13,v14,v15,v16,v17,v18
v0:		#frames = VARPTR frame0(0):goto ok
v1:		#frames = VARPTR frame1(0):goto ok
v2:		#frames = VARPTR frame2(0):goto ok
v3:		#frames = VARPTR frame3(0):goto ok
v4:		#frames = VARPTR frame4(0):goto ok
v5:		#frames = VARPTR frame5(0):goto ok
v6:		#frames = VARPTR frame6(0):goto ok
v7:		#frames = VARPTR frame7(0):goto ok
v8:		#frames = VARPTR frame8(0):goto ok
v9:		#frames = VARPTR frame9(0):goto ok
v10:	#frames = VARPTR frame10(0):goto ok
v11:	#frames = VARPTR frame11(0):goto ok
v12:	#frames = VARPTR frame12(0):goto ok
v13:	#frames = VARPTR frame13(0):goto ok
v14:	#frames = VARPTR frame14(0):goto ok
v15:	#frames = VARPTR frame15(0):goto ok
v16:	#frames = VARPTR frame16(0):goto ok
v17:	#frames = VARPTR frame17(0):goto ok
v18:	#frames = VARPTR frame18(0):goto ok
ok:
	END
	
VoicePlayer:	PROCEDURE
		if peek(#frames)<>-1 then
			if	(ECS) then
				Sound 5,peek(#frames+0),peek(#frames+3)
				Sound 6,peek(#frames+1),peek(#frames+4)
				Sound 7,peek(#frames+2),peek(#frames+5)
			else
				Sound 0,peek(#frames+0),peek(#frames+3)
				Sound 1,peek(#frames+1),peek(#frames+4)
				Sound 2,peek(#frames+2),peek(#frames+5)
			end if
			#frames = #frames+6
		else
			SndFlag = 0
		end if
	END

Am I missing something ?

Link to comment
Share on other sites

I have a doubt...

At the interrupt, the music player updates the PSG registers before the ON FRAME GOSUB procedure is called, doesn't it ?

 

I'm trying to use Music and Voice at the same time

Try this rom on psg and/or on ecs

 

Use the keypads to activate the sfx

 

On psg only, the music is stopped by the voice, so I guess that the the music player updates the PSG registers before my code is executed

 

 

PS

Music by First Spear

psgLoFi.rom

Edited by artrag
  • Like 1
Link to comment
Share on other sites

I've released another version of the stand alone voice encoder


In order to install it without having Matlab, follow the instructions in the readme.txt


This time the encoder is specialized to use the PSG (3 channels) or the ECS (3 channels).

You can pass (have to pass) on the command line the number of channels to be used in the encoding.

The only two possible values are 3 and 5. In case of incorrect values, the encoder will assume 5 channels.


The wav files have to go in wavs subdir.

The data in the genarated *.bas files are periods and volumes ready to be loaded in the PSG at each ISR


No noise added, only more precision in the pitch estimation. Let me know how it goes.


The player (for 3 channels) can be modeled on this one







INCLUDE "constants.bas"

Mode 0,6,0,6,0
Wait
Border 6,0
Scroll 4,4,0
For borderNew=0 to 200 Step 20 : Poke $200+borderNew, $2000: Poke $213+borderNew, $2000 : Next borderNew
Wait
Wait
Print At 22 Color 5 , "Voice Samples"
Print At 121 Color 6 , "-- ARTRAG"

temp = peek($4000)
poke $4000,temp+1


if peek($4000)=temp+1 then
Print At 61 Color 7 , " on ECS "
ECS = 1
else
Print At 61 Color 7 , " on PSG "
ECS = 0
end if


if (ECS) then
Sound 9,$FF,&00111000
else
Sound 4,$FF,&00111000
end if

Wait
Play Simple
Wait
Play MyMusic
Wait

ON FRAME GOSUB VoicePlayer

nsfx = 15
gosub VoicePlayerInit

WAIT
DEFINE DEF00,5,drawings
WAIT
x1=80
y1=56

WHILE CONT.B2=0

FOR X=1 TO 80
WAIT
GOSUB test
NEXT X

FOR X=80 TO 1 STEP -1
WAIT
GOSUB test
NEXT X


WEND




Print At 195 Color (Rand and 7) , "Bye."
For spinWait = 0 to 110
Wait
Next

endloop:
GOTO endloop


test: PROCEDURE
SPRITE 0, ( 40+X) + VISIBLE + ZOOMX2, 20 + ZOOMY2, SPR00 + SPR_WHITE
SPRITE 1, (120-X) + VISIBLE + ZOOMX2, 60 + ZOOMY2, SPR01 + SPR_BLUE
SPRITE 2, 20 + VISIBLE + ZOOMX2, ( 8+X) + ZOOMY2, SPR02 + SPR_RED
SPRITE 3, 140 + VISIBLE + ZOOMX2, (96-X) + ZOOMY2, SPR03 + SPR_TAN
SPRITE 4, X1 + VISIBLE + ZOOMX2, (Y1- + ZOOMY4, SPR04 + SPR_GREEN

IF CONT1.UP THEN IF Y1>0 THEN Y1=Y1-1
IF CONT1.DOWN THEN IF Y1<104 THEN Y1=Y1+1
IF CONT1.LEFT THEN IF X1>0 THEN X1=X1-1
IF CONT1.RIGHT THEN IF X1<168 THEN X1=X1+1

nsfx = CONT1.KEY
if (nsfx<12) and (SndFlag=0) then
gosub VoicePlayerInit
end if
nsfx = CONT2.KEY
if (nsfx<12) and (SndFlag=0) then
nsfx = nsfx+11
gosub VoicePlayerInit
end if
END


VoicePlayerInit: PROCEDURE
SndFlag = 1
on (nsfx) goto v0,v1,v2,v3,v4,v5,v6,v7,v8,v9,v10,v11,v12,v13,v14,v15,v16,v17,v18
SndFlag = 0:goto ok

v0: #frames = VARPTR frame0(0):goto ok
v1: #frames = VARPTR frame1(0):goto ok
v2: #frames = VARPTR frame2(0):goto ok
v3: #frames = VARPTR frame3(0):goto ok
v4: #frames = VARPTR frame4(0):goto ok
v5: #frames = VARPTR frame5(0):goto ok
v6: #frames = VARPTR frame6(0):goto ok
v7: #frames = VARPTR frame7(0):goto ok
v8: #frames = VARPTR frame8(0):goto ok
v9: #frames = VARPTR frame9(0):goto ok
v10: #frames = VARPTR frame10(0):goto ok
v11: #frames = VARPTR frame11(0):goto ok
v12: #frames = VARPTR frame12(0):goto ok
v13: #frames = VARPTR frame13(0):goto ok
v14: #frames = VARPTR frame14(0):goto ok
v15: #frames = VARPTR frame15(0):goto ok
v16: #frames = VARPTR frame16(0):goto ok
v17: #frames = VARPTR frame17(0):goto ok
v18: #frames = VARPTR frame18(0):goto ok
ok:
END

VoicePlayer: PROCEDURE
if SndFlag then
if peek(#frames)<>-1 then
if (ECS) then
Sound 5,peek(#frames+0),peek(#frames+3)
Sound 6,peek(#frames+1),peek(#frames+4)
Sound 7,peek(#frames+2),peek(#frames+5)
else
Sound 0,peek(#frames+0),peek(#frames+3)
Sound 1,peek(#frames+1),peek(#frames+4)
Sound 2,peek(#frames+2),peek(#frames+5)
end if
#frames = #frames+6
else
SndFlag = 0
if (ECS) then
Sound 5,,0
Sound 6,,0
Sound 7,,0
Sound 9,0,$38
else
Sound 0,,0
Sound 1,,0
Sound 2,,0
Sound 4,0,$38
end if
end if
end if
END

'ASM ORG $C100
CONST nfiles = 19

CONST nvoices = 3


frame0:
include "gradiusgaiden_0000.wavfrm_inty.bas"
DATA -1
frame1:
include "gradiusgaiden_0001.wavfrm_inty.bas"
DATA -1
frame2:
include "gradiusgaiden_0002.wavfrm_inty.bas"
DATA -1
frame3:
include "gradiusgaiden_0003.wavfrm_inty.bas"
DATA -1
frame4:
include "gradiusgaiden_0004.wavfrm_inty.bas"
DATA -1
frame5:
include "gradiusgaiden_0005.wavfrm_inty.bas"
DATA -1
frame6:
include "gradiusgaiden_0006.wavfrm_inty.bas"
DATA -1
frame7:
include "gradiusgaiden_0007.wavfrm_inty.bas"
DATA -1
frame8:
include "gradiusgaiden_0008.wavfrm_inty.bas"
DATA -1
frame9:
include "gradiusgaiden_0009.wavfrm_inty.bas"
DATA -1
frame10:
include "gradiusgaiden_0100.wavfrm_inty.bas"
DATA -1
frame11:
include "gradiusgaiden_0111.wavfrm_inty.bas"
DATA -1
frame12:
include "gradiusgaiden_0180.wavfrm_inty.bas"
DATA -1
frame13:
include "gradiusgaiden_0209.wavfrm_inty.bas"
DATA -1
frame14:
include "gradiusgaiden_0350.wavfrm_inty.bas"
DATA -1
frame15:
include "gradiusgaiden_0615.wavfrm_inty.bas"
DATA -1
frame16:
include "gradiusgaiden_1022.wavfrm_inty.bas"
DATA -1
frame17:
include "gradiusgaiden_1035.wavfrm_inty.bas"
DATA -1
frame18:
include "gradiusgaiden_9999.wavfrm_inty.bas"
DATA -1


drawings:
REM Invader
BITMAP "#..##..#"
BITMAP "########"
BITMAP ".#.##.#."
BITMAP ".######."
BITMAP "..####.."
BITMAP "..#..#.."
BITMAP "..#..#.."
BITMAP ".##..##."

REM Spaceship
BITMAP "...##..."
BITMAP "...##..."
BITMAP "..####.."
BITMAP "..#..#.."
BITMAP "..####.."
BITMAP "..####.."
BITMAP ".######."
BITMAP "##.##.##"

REM Stickman
BITMAP "...##..."
BITMAP "...##..."
BITMAP ".######."
BITMAP "...##..."
BITMAP "...##..."
BITMAP "..####.."
BITMAP "..#..#.."
BITMAP ".##..##."

REM Lama
BITMAP ".##....."
BITMAP "###....."
BITMAP ".##....."
BITMAP ".#######"
BITMAP ".######."
BITMAP ".##..##."
BITMAP ".##..##."
BITMAP "###.###."

REM SDK Logo
BITMAP "..#.#..."
BITMAP ".#####.."
BITMAP ".#.##.#."
BITMAP ".####.#."
BITMAP "###.##.#"
BITMAP "###.##.#"
BITMAP ".#.#####"
BITMAP "...#####"

ASM ORG $D000

REM music courtesy of First Spear

MyMusic:
Data 4
Music - , - , -
Music D3#X , - , -
Music C3# , - , -
Music D3# , - , -
Music - , - , -
Music D3# , - , -
Music S , - , -
Music D3# , - , -
Music S , - , -
Music S , - , -
Music S , - , -
Music S , - , -
Music S , G2#W , -
Music C3# , - , -
Music B2 , G2# , -
Music A2# , - , -
Music G2# , - , -
Music F2# , - , -
Music S , - , -
Music S , - , -
Music S , - , -
Music G2# , - , -
Music S , - , -
Music S , - , -
Music S , - , -
Music S , - , -
Music S , - , -
Music S , - , -
Music S , - , -
Music S , - , -
Music S , G2# , -
Music S , - , -
Music S , G2# , -
Music - , - , -
Music G2# , - , -
Music S , - , -
Music S , - , -
Music S , - , -
Music S , - , -
Music S , - , -
Music S , - , -
Music S , - , -
Music S , - , -
Music S , - , -
Music S , - , -
Music S , - , -
Music F2# , - , -
Music S , - , -
Music S , G2# , -
Music S , - , -
Music A2# , G2# , -
Music S , - , -
Music C2# , - , -
Music S , - , -
Music E2 , - , -
Music S , - , -
Music S , - , -
Music S , - , -
Music F2# , - , -
Music S , - , -
Music A2# , - , -
Music S , - , -
Music C3# , - , -
Music S , - , -
Music S , - , -
Music S , - , -
Music A2# , G2# , -
Music S , - , -
Music S , G2# , -
Music S , - , -
Music B2# , - , -
Music S , - , -
Music S , - , -
Music S , - , -
Music S , - , -
Music S , - , -
Music S , - , -
Music S , - , -
Music repeat


Edited by artrag
  • Like 1
Link to comment
Share on other sites

Very cool. I can't get it to work quite yet but I think I'm close.

 

I think I have the converter working - at least, it's creating .bas files for me for the sample .wav files you included. I'm just taking the DATA statements from one .bas file and pasting it into frame0 for now - that should work, yes? If I follow the code, frame0, frame1, etc - these are just references to the individual sound clips.

 

Right now I just get electronic noise, whether I use the ECS or not. And whether or not I use your new .bas files or the ones I'm generating. It feels close, so I'll keep poking at it. Hopefully someone else figures it out because I just feel like I'm missing something obvious.

Link to comment
Share on other sites

If you want to use 5 channels on inty you could play 3 channels on psg and 2 on ecs

You have to modify the player accordingly.

 

One could also play the first 3 channels on psg and skip the last 2 if ecs is not present.

Edited by artrag
Link to comment
Share on other sites

with 5 channels use +0,+1,+2,+3,+4 as periods and +5,+6,+7,+8,+9 as volumes.
Move #frames of 10 positions each isr.

Play these data on 3 channels of psg and 2 of the ecs.

I have limited the encoder to 5 channels because of the msx (they are used in the scc chip that has 5 channels). I could extend the processing to any number of tones in case of need.

Edited by artrag
Link to comment
Share on other sites

OK kids, here's a ROM with a bunch of unrelated sound clips, all using 5 sound channels so you'll need the ECS turned on in your emulator. I first dug up an old WAV archive that I probably haven't touched since the 90s, and found the ones that converted the best. I then grabbed a bunch of random movie clips from some website and did the same. This is about as clear as this method gets when it comes to using random audio files. Personally, I find some of them remarkably clear. I can easily identify the actor - granted, these are all lines I've heard a hundred times so that helps.

 

Try these, they should most/all work:

 

6-12 on controller 1

1-6 on controller 2

 

I'm curious if other people can identify the clips. Some are better than others. I find that this method works well on higher pitched voices - I'm going to try to find some female voices and see if that works better. There's one VERY clear clip but that's because it's not a human voice :)

 

I didn't modify artrag's program beyond the speech generation so it still has his sprites and whatnot in there. None of it does anything, just press keypad buttons to trigger the audio clips. A dozen clips, maybe 20-30 seconds in total, give us a ROM that's about half the maximum possible size. Kinda impressive all things considered. This would have blown people's minds in 1980.

 

Warning: probably NSFW. There's a very 90s clip in here, those who know who it is will understand the warning.

 

Edit - on a real console, they're not quite as clear. The RF audio does degrade them a bit.

pcm_voice_samples.rom

Link to comment
Share on other sites

OK kids, here's a ROM with a bunch of unrelated sound clips, all using 5 sound channels so you'll need the ECS turned on in your emulator. I first dug up an old WAV archive that I probably haven't touched since the 90s, and found the ones that converted the best. I then grabbed a bunch of random movie clips from some website and did the same. This is about as clear as this method gets when it comes to using random audio files. Personally, I find some of them remarkably clear. I can easily identify the actor - granted, these are all lines I've heard a hundred times so that helps.

 

Try these, they should most/all work:

 

6-12 on controller 1

1-6 on controller 2

 

I'm curious if other people can identify the clips. Some are better than others. I find that this method works well on higher pitched voices - I'm going to try to find some female voices and see if that works better. There's one VERY clear clip but that's because it's not a human voice :)

 

I didn't modify artrag's program beyond the speech generation so it still has his sprites and whatnot in there. None of it does anything, just press keypad buttons to trigger the audio clips. A dozen clips, maybe 20-30 seconds in total, give us a ROM that's about half the maximum possible size. Kinda impressive all things considered. This would have blown people's minds in 1980.

 

Warning: probably NSFW. There's a very 90s clip in here, those who know who it is will understand the warning.

 

Edit - on a real console, they're not quite as clear. The RF audio does degrade them a bit.

I understood them all, but about half took repeated listening. certain parts of some of the sentences were definitely clearer than others. Reminds me of the old "Help, I'm trapped in the computer" sample from back in the original IBM Xt single speaker days.

I still think we are better off making the samples work with the Intellivoice since it off-loads the work onto the device. Bank switch a bunch of cleaned up samples and the sky is the limit (or at least LTO board specs are the limit)

  • Like 1
Link to comment
Share on other sites

 

I still think we are better off making the samples work with the Intellivoice since it off-loads the work onto the device. Bank switch a bunch of cleaned up samples and the sky is the limit (or at least LTO board specs are the limit)

 

We are, but the only people who've figured out how to load allophones onto the Intellivoice seem to think there's some lucrative market they need to corner, and as such are apparently unwilling to share their tools with the community at large.

 

I'm sure as heck not smart enough to figure out how to do it :(

Link to comment
Share on other sites

 

We are, but the only people who've figured out how to load allophones onto the Intellivoice seem to think there's some lucrative market they need to corner, and as such are apparently unwilling to share their tools with the community at large.

 

I'm sure as heck not smart enough to figure out how to do it :(

You also aren't smart enough to convert between Pacific and Mountain timezones

Link to comment
Share on other sites

One of the possibile improvements could be to try to keep into account the fact the psg generates square waves and not sine waves.

If you play the msx rom generated by the encoder with an scc cartridge inserted in slot 2, you will find that even 6 psg channels (psg + ecs) sound worse than the 5 scc channels (configured as tones).

Link to comment
Share on other sites

One of the possibile improvements could be to try to keep into account the fact the psg generates square waves and not sine waves.

If you play the msx rom generated by the encoder with an scc cartridge inserted in slot 2, you will find that even 6 psg channels (psg + ecs) sound worse than the 5 scc channels (configured as tones).

 

Ah. That would explain why certain samples really sound clipped. Makes sense, given my limited understanding of audio.

Link to comment
Share on other sites

Just to be sure, have you enabled correctly the tone channels on the two psgs in your player?

 

You should use sound command with parameters 4 and 9 indicating the bit masks corresponding to the 5 channels you are feeding.

 

To be honest, your results sound very bad. I would bet you are playing only 2 channels out of 5.

Maybe, just to be sure, if you send me your wav files, I could try to convert them and double check the result.

Edited by artrag
Link to comment
Share on other sites

Just to be sure, have you enabled correctly the tone channels on the two psgs in your player?

 

You should use sound command with parameters 4 and 9 indicating the bit masks corresponding to the 5 channels you are feeding.

 

 

You shouldn't need to - sound channels work automatically with IntyBASIC.

 

I essentially commented out the IF (ECS) lines, so your SOUND 4 and SOUND 9 commands are being issued continually anyway. The player is just this:

  if    SndFlag then
        if peek(#frames)<>-1 then
                Sound 0,peek(#frames+0),peek(#frames+5)
                Sound 1,peek(#frames+1),peek(#frames+6)
                Sound 2,peek(#frames+2),peek(#frames+7)
                Sound 5,peek(#frames+3),peek(#frames+
                Sound 6,peek(#frames+4),peek(#frames+9)

            #frames = #frames+10
        else
            SndFlag = 0

                Sound 5,,0
                Sound 6,,0
                Sound 7,,0
                Sound 9,0,$38

                Sound 0,,0
                Sound 1,,0
                Sound 2,,0
                Sound 4,0,$38

        end if
    end if
Link to comment
Share on other sites

 

I like the idea of having the Intellivoice do the work, but I also like the idea of not having another box daisy chained to the console. Maybe we will reach a level where we can build to either option, Intellivoice for in-game sound with clarity that doesn't eat the main CPU and non-Intellivoice for adding flavor/punctuation to a game where resource contention is not an issue.

 

 

I understood them all, but about half took repeated listening. certain parts of some of the sentences were definitely clearer than others. Reminds me of the old "Help, I'm trapped in the computer" sample from back in the original IBM Xt single speaker days.

I still think we are better off making the samples work with the Intellivoice since it off-loads the work onto the device. Bank switch a bunch of cleaned up samples and the sky is the limit (or at least LTO board specs are the limit)

Link to comment
Share on other sites

Try this before the on frame gosub

Sound 9,$FF,&00111000

Sound 4,$FF,&00111000

 

They're both in there - I just commented out the IF ECS check.

 

Like I said, you shouldn't need to set the mixer at all for these. SOUND 0-2 and 5-7 "just work" without touching the mixer register.

Link to comment
Share on other sites

This technique does not eat practically any cpu.

No, it eats sound and music, interrupting any music playing or any sound effects in progress. That would be annoying just to have a sound sample, hence letting the Intellivoice do the work it was designed to do...play samples.

Link to comment
Share on other sites

No, it eats sound and music, interrupting any music playing or any sound effects in progress. That would be annoying just to have a sound sample, hence letting the Intellivoice do the work it was designed to do...play samples.

Almost no cpu used and if you have ECS, no music is interrupted.

Maybe you should release some coding tool for intellivoice before complaining about this method.

 

I'm pretty sure Intellivoice is owned by less than 1/10 the active intellevision user base, this could explain why none want to spend energies on a niche of a niche ....

Edited by artrag
Link to comment
Share on other sites

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.
Note: Your post will require moderator approval before it will be visible.

Guest
Reply to this topic...

×   Pasted as rich text.   Paste as plain text instead

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

Loading...
  • Recently Browsing   0 members

    • No registered users viewing this page.
×
×
  • Create New...