Jump to content
IGNORED

Pokey Explorer v1.0 release


ivop

Recommended Posts

8 hours ago, rensoup said:

 

Would it be possible to use opentmpt + a sample pack and simply export the raw pokey data ( possibly LZSed ) ?

 

That way it would be possible to export fancy stuff like stereo @ 400hz and it would be playable on a real machine.

That’s what I was thinking. Either using many samples then a converter that removes samples and puts it into this lzs format, or perhaps a pokey vst plugin.

 

I also have the pokeymax motive of a tracker that can mix Sid, pokey, PSG and samples.

 

Since I don’t make music myself I wasn’t sure if it’ll work.

Link to comment
Share on other sites

In theory, every tracker can be used, and the resulting song and pattern data can be converted to RMT or another player. But afterwards, you have to (re)create all your pokey instruments.

 

Pokey VST plugin is a nice idea. Not just for tracking, but for "real" musicians, too :)

 

Link to comment
Share on other sites

On 10/22/2020 at 7:05 AM, Synthpopalooza said:

I did some experimenting using SAP and a music routine that involves using frequency and duration on each channel.  It even worked with SKCTL.

I was talking about SAP type R (which sadly only records $d200-$d208). But you are right that normal SAP type B can handle that, provided that the SAP player has a proper 6502 and Pokey emulation.

 

SAP-R could be extened (SAP-X?) to include SKCTL, for example to also record two-tone mode, and @dmsc's LZSS player can be extended to include the extra register(s).

 

But once you start using pavros' sync methods, you can't record that to SAP-R/X as the writes have to be cycle exact. That's what I meant to say :)

 

 

Edit: in addition to the openmpt+sample pack idea: I understand that you mean a sample pack of notes/arpeggios/drums/etc of which you know the exact SAP-R representation, and can then afterwards mix them according to the song and pattern data. I think that's a lot of work. There are so many potential samples. Just preparing all the possible samples you might need will take ages. And record the SAP-R version, too. Then align them properly, create sample pack, and all mappings between notes and samples. You need a sample for every note. You can't just sample C and F#, and have the MOD tracker play the samples faster/slower according to the needed frequency. Oh, and how about glissandos? :)

 

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

Another note: @Synthpopalooza's and Pokey Explorers notion of Reverse 16-bit is NOT the same.

 

Pokey Explorer:     ; this affects AUDF (i.e. the 16-bit frequency)

    Channels 1+2:

        16-bit: LSB + MSB

        Reverse 16-bit: MSB + LSB

 

AUDC order:

    Channels 1+2:

        16-Bit: Mute + Play

        Reverse 16-bit: Play + Mute     (<---- @Synthpopalooza's reverse 16-bit)

 

 

Edit: this comment shows how both can be combined. Play+Mute (synthpopalooza's reverse 16-bit), and both LSB/MSB and MSB/LSB storage of frequency. All result in pure sawtooths.

 

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

7 hours ago, ivop said:

SAP-R could be extened (SAP-X?) to include SKCTL, for example to also record two-tone mode, and @dmsc's LZSS player can be extended to include the extra register(s).

Does it make sense for SKCTL to be recorded every frame ?

 

edit: I just dug up @Synthpopalooza's answer:

 

Quote

SKCTL is serial control.  Default value is $03. but writing $8B to it engages two tone mode.  This normally is used for cassette I/O (CSAVE, CLOAD, etc.) but has musical applications.  In $Ax distortion,  you silence first channel and play the second one.  First channel is the frequency carrier and the second modulates the frequency.  The result is a pseudo pulse wave with variable width.

 

In my usage, SKCTL is set once.  But there is theoretically the possibility of turning on and off two tone throughout the tune, I suppose.

Are there any existing tunes that actually do that ?

Edited by rensoup
spp's answer
Link to comment
Share on other sites

32 minutes ago, rensoup said:

Does it make sense for SKCTL to be recorded every frame ?

 

edit: I just dug up @Synthpopalooza's answer:

 

Are there any existing tunes that actually do that ?

Except for a Instrumentarium by @analmux, I'm not aware of any other tune.

 

As for recording SKCTL every frame, future players could switch between two-tone mode and normal mode. And if they don't, that "channel" will be LZSS compressed to just a few bytes.

 

But as said before, tight timing for @pavros's way of syncing distortion $Cx, cannot be captured this way. That requires cycle exact stores to SKCTL for poly restarts.

 

  • Like 1
Link to comment
Share on other sites

If using $Ax in two-tone mode at the standard 64 khz clock, it is not needed to switch it off and on mid tune.   The standard square wave table sounds can be had when the period differential between channel 0 and channel 1 is less than 13 semitones ... greater than that, the note jumps up an octave, and a sawtooth modulation is introduced, which increases the greater the differential is.  I have of course full documentation of this setting (in all clocks) in my POKEY table.

 

In 1.79 mhz mode, this is the famous save to Cassette sound.  The high frequency on channel 0 acts as a modulator on the second channel, making a very sonorous bell tone.  A saw wave is also produced here too.

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

OK, I ran off some sweeps from that AUDCTL=$64 $Ax 1.79+1.79 mode ... I took each sweep you suggested, and also ran them in reverse.  If you get a chance, run aubiopitch over each one, and see what values we get that match the actual frequencies. :)

 

 

$Ax AUDCTL=$64 $0A03 - $0707.wav $Ax AUDCTL=$64 $0001 - $0101.wav $Ax AUDCTL=$64 $0002 - $0202.wav $Ax AUDCTL=$64 $030A - $0707.wav $Ax AUDCTL=$64 $0100 - $0101.wav $Ax AUDCTL=$64 $0106 - $0505.wav $Ax AUDCTL=$64 $0200 - $0202.wav $Ax AUDCTL=$64 $0205 - $0303.wav $Ax AUDCTL=$64 $0502 - $0303.wav $Ax AUDCTL=$64 $0601 - $0505.wav

  • Thanks 1
Link to comment
Share on other sites

So I just took the same idea ($0101, $0202, etc.)  and applied it to $2x 1.79+1.79 ... the intervals work the same, however, as you creep up the scale, there is a vibrato modulation which slowly creeps up and slows down, then speeds up.

 

Also:  Any settings in which AUDF0 is from the $2x 1.79 table, will always be in tune ... some settings will put the tone down or up an octave or two, or up or down a 4th or 5th interval.

 

Also:  AUDF0=AUDF1 makes a solid tone ... there are also some settings where AUDF0 and/or AUDF1 is a mod 31 value, these also will produce some solid tones.

 

Make of this what you will. :)

 

Here is a quick and dirty table I was working on before this utility appeared.  Be interested to hear your thoughts on this one.

AUDC0=$2x AUDC2=$00 AUDCTL=$64 v1.0.txt

Link to comment
Share on other sites

Observations so far:

 

1. Your recordings are stereo, which is not necessary

2. The volume is pretty low. Hopefuly you can record your next sweeps at a higher volume

 

That said, first run of aubiopitch:

 

aubiopitch -i \$Ax\ AUDCTL\=\$64\ \$0001\ -\ \$0101\ -\ cleaned\ up.wav -B 48510 -H 48510 -u hertz -v -s -90 -p yin

 

More observations:

 

3. Pitch detection catches up at 11.0s. 8685 Hz

4. At 64.9s, it plays 444 Hz

5. 130.9s is the last note that is cleanly detected

6. The next note is detected as the high whistling note that slowly takes over

 

If you replace the space between values by a comma, you can import this table in a spreadsheet. Let another column run the same sweep and you have all the settings that match to the frequencies detected.

 

$Ax AUDCTL=$64 $0001 - $0101 - cleaned up.txt

 

 

Edit: and here's the reverse start value:

$Ax AUDCTL=$64 $0100 - $0101 - cleaned up.txt

 

The difference between both frequencies is marginal, if they even exist at all as the difference seems to be within the error margin of +/- 0.5Hz.

 

Considering this error margin, perhaps we need slower sweeps for the extreme bass notes.

 

Let's see if the $0202, $0303, $0505 and $0707 sweeps differ more with reversed 16-bit frequency.

 

 

Edited by ivop
I used yin instead of yinfast
Link to comment
Share on other sites

14 hours ago, ivop said:

 

As for recording SKCTL every frame, future players could switch between two-tone mode and normal mode. And if they don't, that "channel" will be LZSS compressed to just a few bytes.

 

But as said before, tight timing for @pavros's way of syncing distortion $Cx, cannot be captured this way. That requires cycle exact stores to SKCTL for poly restarts.

 

Actually, I think if a register doesn't change, LZSS only stores the initial value... (it would require a tiny bit of hacking for an extra register though)

 

As for pavros' $Cx dist, I briefly looked at the paper not understanding most of it but the unstable methods required multiple writes with short delays... perhaps multiple writes could be stored as extra "virtual" registers too inside LZSS ?

I'm guessing that would require a new tracker (or openmpt with a new pokey.dll) which would export LZSS...

Link to comment
Share on other sites

26 minutes ago, rensoup said:

Actually, I think if a register doesn't change, LZSS only stores the initial value... (it would require a tiny bit of hacking for an extra register though)

Oh, that's cool! Wouldn't expect less from @dmsc ;)

 

Quote

As for pavros' $Cx dist, I briefly looked at the paper not understanding most of it but the unstable methods required multiple writes with short delays... perhaps multiple writes could be stored as extra "virtual" registers too inside LZSS ?

I'm guessing that would require a new tracker (or openmpt with a new pokey.dll) which would export LZSS...

The main problem is, how do you replay a cycle exact recording? You could perhaps include an out of band stream that records timing information for STIMER and SKCTL. Or, if you know upfront that only, say, three methods of syncing are used, you can hard code the exact three delay sequences and only record when to execute them.

 

All in all, it is a lot of work. Adding timed recording to an emulator, write the player, etc... But I understand why you want to record everything to SAP-R/LZSS or an equivalent, because the player is one of the fastest. But a generic cycle exact recorder and a native replayer is impossible IMHO. That said, 99.9% of the tunes can be recorder to SAP-R. And as synthpopalooza said, a lot of modes involving SKCTL only need to have their initialization done once upfront, and after that you can just replay your $d200-$d208 SAP-R recording.

 

Edited by ivop
Link to comment
Share on other sites

Hi!

12 minutes ago, ivop said:

Oh, that's cool! Wouldn't expect less from @dmsc ;)

Thanks!

 

Current player stores a bit mask at the beginning representing pokey registers 1 to 8 (AUDC1 to AUDCTL), so any of those can be skipped. This could be easily be modified to add a new register, but the problem is that SKCTL is register number 15, this means that we must skip from 15 to 8 in the player loop.

 

About timing writes, I think that you only need to time the writing of SKCTL up to the write of the first "special" AUDF*, as this affects the phase from the poly counter to the frequency generation. Afterwards, when not writing 0 to AUDF* all the timing should be correct - as the frequency changes only occur after the counters are reloaded.

 

What I'm saying is: if you are using values for AUDF* that are multiples of the poly counter period, you will keep at the same phase even when changing the AUDF* value to another multiple, the timing of the AUDF* write is not important as the frequency change will be aligned.

 

Have Fun!

  • Like 2
Link to comment
Share on other sites

Both $0202 sweeps.

 

Again, at the 11.0s mark it starts to becomes hearable. 5727.6 and 5728.5 Hz. Then it slowly decends. Note that start value $0200 and $0002 are still within 1Hz.

 

For the 432Hz tuning note lovers, there's an almost perfect 432Hz at 47.3s ;)

 

First note where the overtone is detected is at 74.8s. Previous tone was 190.8 Hz.

 

$Ax AUDCTL=$64 $0002 - $0202 - cleaned up.txt $Ax AUDCTL=$64 $0200 - $0202 - cleaned up.txt

Edited by ivop
Link to comment
Share on other sites

The $0303 sweeps.

 

The very, very, very high notes are more than 1Hz apart now (i.e. start at $0205 or $0502). At that high a frequency, I doubt you can hear a difference.

 

Stable notes start at 4.4s. 14801Hz :)  At 11.0s it's 3810.6Hz.

 

52.8s is 243.6Hz.

 

At 53.9s the overtones take over.

 

$Ax AUDCTL=$64 $0205 - $0303 - cleaned up.txt $Ax AUDCTL=$64 $0502 - $0303 - cleaned up.txt

Edited by ivop
Link to comment
Share on other sites

16 minutes ago, Synthpopalooza said:

So, a question... the first number, is that the sample number?  I noticed that it skips one sometimes... I will crunch all these when I get home tonight.

The first column is the time in seconds. I had the same huh?-moment when I first started using aubiopitch. But it's quite logical. You add 1.1s every time, so at 9.9s, it goes to 11.0s. It seems like 10 is skipped, but it is not.

 

Edit: 1.1s equals 1s tone and 0.1s gap, 44100 + 4410 samples. 48510 samples for 1.1s.

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

$0505 sweeps.

 

First time that the sweeps are out of sync.

 

For example, 28.6s is 440.9Hz. But 29.7s is 440.9Hz in the other sweep.

 

Pure tones stop at around 360Hz.

 

These notes might approximate some high notes better. Same for $0707? But no bass notes there :)

$Ax AUDCTL=$64 $0106 - $0505 - cleaned up.txt $Ax AUDCTL=$64 $0601 - $0505 - cleaned up.txt

Edited by ivop
Link to comment
Share on other sites

I created a sweeps directory in the Pokey Explorer repository:

 

https://github.com/ivop/pokey-explorer/tree/master/sweeps/AUDCTL%3D%2464 NTSC

 

I ran all the aubiopitch txt files through sed 's/ /, /g'  (substitute space by comma space globally. sed is not that hard ;) )

 

So now they are all CSV files that can easily be imported in a spreadsheet.

 

  • Thanks 1
Link to comment
Share on other sites

The real interesting stuff behind the 1.79MHz filter is that it builds an "interference" at the (starting)3.58MHz resulting waves. 

Thus you don't hear the absolutely high frequencies, just the "interferencing" sound. which results in a sawtooth wave by standard. 

Could be interesting to have the tool changing the channel pitch fast enough, to get any other resulting wave coming through.  

You know: An ascending sawtooth  followed by a descending sawtooth is a triangle ;) 

As you might get from my POKEY edits, waveforms can be build all over the "musical range" . 

What is really missing, is the controlled replay of "channel addition" sounds. This is the only way to put more power to the created wave and to cut the high frequencies. 

 

Listen to the start of this tune...

(it starts very "volumetric" ) . 

This type of channel wave addition is only to control fully, if a "pokey reset" can be placed on specific points.  

 

 

 

 

 

Edited by emkay
Link to comment
Share on other sites

50 minutes ago, ivop said:

I created a sweeps directory in the Pokey Explorer repository:

 

https://github.com/ivop/pokey-explorer/tree/master/sweeps/AUDCTL%3D%2464 NTSC

 

I ran all the aubiopitch txt files through sed 's/ /, /g'  (substitute space by comma space globally. sed is not that hard ;) )

 

So now they are all CSV files that can easily be imported in a spreadsheet.

 

Good ... we can bite this off a bit at a time :)

Link to comment
Share on other sites

So I tried exporting this to a spreadsheet ... only $0101 and $0202 intervals

 

Could you look this over and see if I did this right?  I am thinking the notes I have marked may actually be off a bit.

 

Also, I may redo some of the lower sweeps at a longer duration so that we get the bass notes.

 

Edit:  I think the notes I marked are actually one step off.

 

AUDCTL=$64 $Ax sweep table.xlsx

Edited by Synthpopalooza
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...