Jump to content
IGNORED

One Note


emkay

Recommended Posts

Here are just some demonstrations of sound creation, just using the Pulse Width Modulation feature of POKEY.

 

">
" type="application/x-shockwave-flash" wmode="transparent" width="425" height="350">

 

This one uses the direct output in RMT , filter and 15kHz. It plays always the same Note.

 

 

 

 

 

And this one uses a higher note, same settings and directly recorded from A800, as Altirra cannot handle this correctly.

 

 

 

It varys between a high noise but low energy tone and a low noise high energy tone.

Edited by emkay
  • Like 2
Link to comment
Share on other sites

What it exactly means to have this modulation abilities, shows this video:

 

 

Have a look at the wave indicator, due to the raw manipulations possible in RMT, it show only a part of what is really possible.

The modulation turns the double squares sometimes into a sawtooth wave.

And, also , the video shows that the sound gets never to the cancelling point of the generators, which shows that the modulations really can be repetetively handled.

 

It could be interesting to have a tool that allows the manipulations in some CPU cycles, instead of VBI cycling.

Link to comment
Share on other sites

Showing that 8 bit resolution , 4 bit volume and "Square-Waves" weren't the limits .

The sounds are based on "OPL 2" and "OPL 3" , just using the offset programming, aka Pulse width modulation + Ring Modulation... name it as you like.

 

If , probably, someone wants to create a fully working POKEY Tracker, he , probably, considers to add the features...

Link to comment
Share on other sites

Could it be possible to have a tracker that is able to create those instruments that fit better to a tune?

A Piano, a Guitar ... and so on... you press a key and the tracker is playing the predefined instrument and settings...?

 

 

This is one of my "most wanted" "most original" playback tunes.

 

The "piano" has a touch of a "piano" and the Guitar has a "guitar" flanger effect. I put a more obvious different "face" into the guitar, to show that the variations were stable.

 

Those programmed variation can also get an "AA" "EE" "II" "OO" "UU" touch. With the same note being played...

 

Also, the Guitar uses only one setup of "corrections" and it shows a well stability from the lowest to the highest notes. And, even the highest notes have some stable variations ...

 

  • Like 1
Link to comment
Share on other sites

Could it be possible to have a tracker that is able to create those instruments that fit better to a tune?

A Piano, a Guitar ... and so on... you press a key and the tracker is playing the predefined instrument and settings...?

 

 

This is one of my "most wanted" "most original" playback tunes.

 

The "piano" has a touch of a "piano" and the Guitar has a "guitar" flanger effect. I put a more obvious different "face" into the guitar, to show that the variations were stable.

 

Those programmed variation can also get an "AA" "EE" "II" "OO" "UU" touch. With the same note being played...

 

Also, the Guitar uses only one setup of "corrections" and it shows a well stability from the lowest to the highest notes. And, even the highest notes have some stable variations ...

 

These are cool sounding.

Link to comment
Share on other sites

I love the first 2 tests with the PWM.... how did you create them?

15khz mode

Filter and the pitch at the main channel one "up" or "down" and back.

As pokey stores the last position of a wave, which results in a different position for the same frequency, you get the resulting pulse width.

Edited by emkay
Link to comment
Share on other sites

These are cool sounding.

These a really cool. Particular the big frequency range, the guitar is following, it's never yelling. Have you realized how high the sounds get without a disturbing noise?

 

 

 

btw. the "octaves" tune plays the similar high "sawtooth" sound at 64khz. The 1st "filter" sound is standard filter, the 2nd filter sound uses Ringmodulation to enhance the background.

 

At least RMT helps to show many of the possibilities.

And, I'm pretty sure, we could let POKEY "sing" without using all CPU cycles ;)

Link to comment
Share on other sites

I might use this thread to show (again) my little tool to experiment with the "new sounds"

You can try out some pulse waves with different duty cycles (5% - 55%).

it also features a (VBI based) ADSR envelope for the volume (hold keys down longer)

Downside is, you have to play the notes your self with the keyboard.

 

Maybe I try to add the modulations emkay used here, however, it is maybe difficult to make it editable with the simple GUI :(

 

sdesi.xex

  • Like 2
Link to comment
Share on other sites

CreatureXL, can you describe how the following sequence works?

 

 

STX AUDF1
STA AUDF3
STA STIMER
STX AUDF3

I'm guess that X contains the frequency you want to play and A contains an appropriate value to create the desired phase offset between channels 1 and 3 after resetting the POKEY counters with STIMER. Am I right? How do you calculate the value for A?

Edited by Xuel
Link to comment
Share on other sites

Cool, so if you want duty cycle D, then A=X*D, yes?

 

I'm still curious about the actual mechanism. How does writing the registers in that sequence cause the phase difference?

It's unfair to ask this of me. I just checked the timestamp sof the code. Last i touched it was 16th of September 2012 :)

However, I am pretty sure I got eh information from the thread Analmux posted ( or one of his other posts). When I remember correctly I had to think for a moment abou tit and asked him for conformation if I understood it correctly. What I am saying, if you do not get it at once it's fine. If I recall how it works I post again.

Now I will try to add some modulations to teh pulse width. I curious how they sound...

 

 

EDIT:

FYI, in my code I use pre-calced tables. For example:

notes_15lll:	.byte   255,255,255,255,255,255,255,255,255,255,255,242
notes_15ll: 	.byte    229, 216, 204, 192, 182, 171, 162, 153, 144, 136, 128, 121
notes_15l: 	.byte    114, 108, 102,  96,  91,  85,  81,  76,  72,  68,  64,  60
notes_15: 	.byte     57,  54,  51,  48,  45,  42,  40,  38,  36,  34,  32,  30
notes_15h: 	.byte     28,  27,  25,  24,  22,  21,  20,  19,  18,  17,  16,  15
notes_15hh: 	.byte     14,  13,  12,  12,  11,  10,  10,   9,   9,   8,   8,   7
notes_15hhh:	.byte     7,  6,  6,  6,  5,  5,  5,  4,  4,  4,  4,  3
notes_pulse05:	.byte	44,42,40,38,36,34,32,30,28,26,24,23		; 15ll / 5
		.byte	23,22,20,19,18,17,16,15,14,13,12,11		; 15l / 5
		.byte	11,10,10,9,9,8,8,7,7,6,6,6			; 15 / 5
		.byte	5,5,5,4,4,4,4,3,3,3,3,3				; 15h/5
		.byte	3,2,2,2,2,2,2,1,1,1,1,1				; 15hh / 5

So yeah you are right.

And i just remembered the thing which makes the phase shift work :)

It is the fact that POKEY changes the frequency AFTER its current rectangle-cycle is over. So that is how you get the phase shift.

 

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

I'm still curious about the actual mechanism. How does writing the registers in that sequence cause the phase difference?

 

POKEY'S generators start at the same phase, when the chip gets powered. Doing the start of two different channels at a defined time difference, makes them play the waves at the defined time difference. Running two channels with the filter at the same phase, makes them fully cancelling the sound. The time offset creates a "later cancelling effect" , resulting in a variable pulse width signal.

 

 

 

The problem with resetting POKEY timers is that it doesn't make you happy, because it resets all registers.

So once the tune gets started, a reset is useful. Then we can use the pitch correction to keep the sound as stable as possible.

Many sound combinations vary when the tune gets restarted, so the pokey timer reset helps well there.

 

Well, another scenario would be to have POKEY with Digis and the main voice is intended to play as good as possible. So 16 bit filter with 100% stable instrument start ... well, do the math ;)

Edited by emkay
Link to comment
Share on other sites

I'm still confused about the "high pass filter", mentioned in the ATARI book and WikiPedia. IMHO there isn't any at all. ;)

 

Cool, so if you want duty cycle D, then A=X*D, yes?

Exactly. F.e. using AUDCTL = 4, thus when AUDF3 clocks AUDF1, and we have base clock 64 kHz. Let now P be the desired 'phase' or 'duty cycle', thus 0 <= P < 1. Then A = INT(P*(X+1))-1 after calculating a numerical approximation. We can redefine A'=A+1 and X'=X+1, so that A' = INT(P*X').

 

Now, for example, if we chooce an AUDF1 pulse running 10 cycles (w.r.t. base clock 64 kHz), and with phase 30%, then the A':X'-ratio equals A = INT(3*(X+1)/10)-1. Thus 10 = X' = X+1 so that X=9 and A = INT(3*10/10) = INT(3)-1 = 3-1 = 2. Thus X=9 and A=2:

 

LDX #9
LDA #2
STX AUDF1
STA AUDF3
STA STIMER
STX AUDF3

I'm still curious about the actual mechanism. How does writing the registers in that sequence cause the phase difference?

More about the countdown timers:

 

AUDF1 Pulses:      |---------|---------|---------|---------|--------- ...
AUDF3 Pulses:      |--|---------|---------|---------|---------|------ ...
Countdown Timer 1: 98765432109876543210987654321098765432109876543210 ...
Countdown Timer 3: 21098765432109876543210987654321098765432109876543

                   ___       ___       ___       ___       ___
Resulting Signal:     _______   _______   _______   _______   _______
                   11100000001110000000111000000011100000001110000000

Now note that it really works like a binary 'ring mod'. The flip-flop of the filter output is caused by both AUDF1 and AUDF3. Any AUDF1 pulse generates a flip-flop 0 -> 1 or 1 -> 0. AUDF3 ONLY generates flip-flop 1 -> 0.

  • Like 1
Link to comment
Share on other sites

Sounds good but one quick question:

 

Where does this leave us in terms of run time to do everything else? Does it just update the music player same as always, need multiple updates per frame, need handholding throughout the entire frame, etc.?

It mostly can run in a standard VBI player. It's just the granted start of a wave that is missed in "all" players.

Just a command "here and there" for resetting the timers, and a short routine for updating the pitch correction in one VBI cycle instead of 3 VBI cycles.

The offset for the pulse width is only limited by the available wavelength. All of my tests use 8 bit, but 16 bit is also possible.

Edited by emkay
Link to comment
Share on other sites

I tried sweeping the duty cycle but it sounds really choppy:

 

dutycycle.xex

 

I'm reseting STIMER every 3 frames. If I pull up the Audio Monitor in Altirra I can see a long pulse on the frames where STIMER is reset.

 

post-21021-0-53813200-1411774131_thumb.png

 

I guess this is unavoidable? It seems like it really limits the musical potential if you can't sweep the duty cycle cleanly though.

 

EDIT: Source on github.

 

EDIT2: Fixed duty cycle offset. Now when the line is on the right hand of the screen, the duty cycle is 100% and when on the left it's 0%, and the duty cycle is 50% when the line is in the middle.

Edited by Xuel
Link to comment
Share on other sites

Also, resetting STIMER will cause choppiness in the tones that are playing on the other two channels as well, right. So it seems like you'd never want to do it in the middle of a long note.

Reducing the volume in the "click" time could help.

 

This "start of a long note is the real handycap. In RMT it takes up to 3 VBI cycles, to have a clean start. This STIMER programming would give a better stability to the sound generating and thus more variable sound programming.

 

On the envelop of an instrument, the pitch correction is the solution.

 

 

You only hear "clicks" in the long note, when you want them there .

 

  • Like 1
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...