Jump to content
makary

PWMish sound in a tracker

Recommended Posts

I've tried to get a sort of PWM sound in a tracker. And I don't mean an accidental effect, but something more or less stable and predictable. The idea is a development of Raster's idea from his 'Delta' cover and 'C64 synth' instrument. Here is a mediocre example, but I hope you can hear and see what is going on the first channel. XEX included as well.

 

KORTO.xex

Edited by makary
  • Like 9

Share this post


Link to post
Share on other sites

Yeah good stuff. And it's such an unexplored area - a lot of existing stuff is using filters, high frequency or other tricks yet there's 2-tone still waiting. And low frequency digital/forced volume could accomplish a lot as well and cheaply. A 200 Hz variable pulse wave costs next to nothing in terms of CPU cycles.

Share this post


Link to post
Share on other sites

The low sounds play easily stable and can be used in any POKEY tracker.

According to your thread on Atarionline: Raster did the "SID" voice, by just using the 1st channel one pitch higher.

In every tracker it is possible to use the PWM sound.

It's the only way to have something like "music" in 15kHz. But people don't want it , thus no special Tracker exists.

It's just to bring the two filter channels to a common start, which works perfectly, if there is a short playing of both channels at the highest frequency. So the offset on both channel only varies in between the length of the smallest wave, which shows less differences , the lower a note gets.

 

The most satisfying part is that higher notes get a better pitch and can be adjusted in the "pulse Density" for better volume vontrol.

 

Things can be done better, but the tunes in the "POKEY DEMO" run all stable in the meaning of sound creation.

 

 

It's just that dark orbit that people don't seem to like. So no real development there in any tracker...

Share this post


Link to post
Share on other sites

Thanks.

 

You're right Heaven. 'Underrated' is the right word here. It's TMC2.0 in fact, a quite advanced tool, created with Grayscale guys as support.

 

Yeah Rybags, a lot to explore. There are some musicians exploring couple interesting ideas, not very active here for some reasons. I hope we'll hear some nice stuff sooner or later.

 

Edit: source file added (.tm2)

KORTO.zip

Edited by makary
  • Like 1

Share this post


Link to post
Share on other sites

it's not a dark orbit people 'don't like' it's an orbit folks without the tools or vehicle can't achieve is all. But this looks like that is changing and we may soon see more folks in orbit as they leave the stratosphere.

Share this post


Link to post
Share on other sites

There are some musicians exploring couple interesting ideas, not very active here for some reasons.

Yeah, only God knows of their evil burns.

Share this post


Link to post
Share on other sites

The low sounds play easily stable and can be used in any POKEY tracker.

According to your thread on Atarionline: Raster did the "SID" voice, by just using the 1st channel one pitch higher.

In every tracker it is possible to use the PWM sound.

It's the only way to have something like "music" in 15kHz. But people don't want it , thus no special Tracker exists.

It's just to bring the two filter channels to a common start, which works perfectly, if there is a short playing of both channels at the highest frequency. So the offset on both channel only varies in between the length of the smallest wave, which shows less differences , the lower a note gets.

 

Yes, listen to the guy this time .. I was playing a bit with it yesterday, and you can indeed reset the phase reliably by using 0 frequency for 1 frame on both filter channels. In RMT you can control both channels individually .. you just need to use 2 instruments, and check the filter checkbox on the left on one of them .. you simply don't use the 6 command and the 'dot' under the envelope.

And yes, it's mostly useful in 15kHz. Even in 64k you can get some nice sounds out of it, but you can't use it on a bass.

  • Like 1

Share this post


Link to post
Share on other sites

I'm curious R0ger, because I went through this some time ago. So are you referring to some sort of pulse width modulation or are you referring to setting a constant pulse width of a waveform? The latter works when using this checkbox/no 6/no dot/two instruments setting. But I'd love to hear the former, this PWM working fine using this technique. Can you provide some RMT/XEX/instrument file please?

Edited by makary

Share this post


Link to post
Share on other sites

I've tried to get a sort of PWM sound in a tracker. And I don't mean an accidental effect, but something more or less stable and predictable. The idea is a development of Raster's idea from his 'Delta' cover and 'C64 synth' instrument. Here is a mediocre example, but I hope you can hear and see what is going on the first channel. XEX included as well.

 

That sounds fantastic - can't wait to try on the proper stereo with the subs!

Share this post


Link to post
Share on other sites

Here I'm including examples of resetting the phase in RMT with 100 command (frequency 0).

 

If you play the xex, first there is just some different noise in channels 1 and 3, to show the effect works with Pokey in random state.

 

After that there are 3 series of tones. I suggest turning on the oscilloscopes in Altirra.

 

Everything is in 15kHz.

 

First there is bass made by instruments Bass1a and Bass1b. This is supposed to generate tone with increasing pulse width, but always starting at zero.

Bass1a is on channel 1, it uses Audctl bit Fi1+3. First frame has zero volume, and frequency 0 (command 100). After that you have simple A distortion, and no command.

Bass1b does not use any Audctl bits, and it plays on channel 3. Since Bass1a turned the filter on, Bass1b doesn't have to. Bass1b also uses first frame with 0 frequency (100). Second frame uses command 200, but that does nothing in this instrument, let's ignore it for the moment. It will get more use later.

And in third frame there is loop with command 201 .. in other words, play frequency lower by 1. This continuously makes the phase of channel 3 lag behind channel 1, and it makes the pulse wider and wider. The channel itself generates no tone, it has 0 volume. You can add some of this channel (distortion A, volume 4) into the mix, it makes the bass beefier. I left it simple for the demonstration.

This instrument is similar to default RMT filter, except the phase is reset every time. It also demonstrates how to make filter manually using 2 channels.

 

After that there is bass with more complex phase control. The tone starts with low pulse width .. but not zero. It makes the pulse go wider for a moment, then back to the starting value, and then it stops at constant pulse width. It's done using instruments Bass2a and Bass2b.

Bass 2a is exactly the same as in the first case. Frame with 100, constant tone after that.

Bass2b is similar to Bass2a, but there are few differences.

First frame is the same, command 100. Second frame is different. There is command 204. This means playing lower frequency for one frame .. in other words, make the pulse grow wider for one frame. It's basically used to define starting pulse width. You can change this parameter to different values to get different starting pulse width (more about this later). Third frame uses no modulation, command 200. Which would normally mean constant pulse width.

But in this instrument I also use tone table. It allows for slower change of frequency (which means pulse width). The tone table is in frequency mode, the first frame has 01 in it, which is the same as using 201 command. So for the duration of the first tone table frame the pulse grows wider.

After that there is FF. This will make the pulse go narrower. And after that there is loop on 0, which will fix the pulse width.

 

Third example is fixed pulse width. It uses instruments Bass3x. For every different pulse width I need new instrument in RMT. But only for the second channel. Bass3a in channel 1 is the same as in previous examples. Bass3b is similar as before. The second frame is important. That one sets the initial pulse width. Bass3b uses command 201. Bass3c uses 203. Bass3d 205 and bass 3d 207. Third, looped frame uses 200, in other words fixed phase, and no tone table is used.

The track is done so channel 1 only uses Bass3a, and on channel 3 there is variation of the different pulse widths.

 

 

bass.zip

  • Like 3

Share this post


Link to post
Share on other sites

Thanks for more comments.

 

Well done R0ger! I'm not using RMT anymore but I'm definitely going to dig into your files thoroughly. People at Discord might be interested as well.

Edited by makary

Share this post


Link to post
Share on other sites

I've looked into the files.

 

 

First there is bass made by instruments Bass1a and Bass1b. This is supposed to generate tone with increasing pulse width, but always starting at zero.

Bass1a is on channel 1, it uses Audctl bit Fi1+3. First frame has zero volume, and frequency 0 (command 100). After that you have simple A distortion, and no command.

Bass1b does not use any Audctl bits, and it plays on channel 3. Since Bass1a turned the filter on, Bass1b doesn't have to. Bass1b also uses first frame with 0 frequency (100). Second frame uses command 200, but that does nothing in this instrument, let's ignore it for the moment. It will get more use later.

And in third frame there is loop with command 201 .. in other words, play frequency lower by 1. This continuously makes the phase of channel 3 lag behind channel 1, and it makes the pulse wider and wider. The channel itself generates no tone, it has 0 volume. You can add some of this channel (distortion A, volume 4) into the mix, it makes the bass beefier. I left it simple for the demonstration.

This instrument is similar to default RMT filter, except the phase is reset every time. It also demonstrates how to make filter manually using 2 channels.

 

 

I see that it must be done this way. In TMC I just need this sort of instrument to get the result (some variation of the sound I used in my track from the first post):

 

post-45308-0-03116900-1542661024.png

 

No two instruments + two notes + double patterns to get just one sound. In TMC it is just one instrument that is handling everything and is used as any regular 'filtered' instrument. In this example above: the first frame is that high frequency/reseting part. Later on you can see the envelope command 4 doing more or less the 'filter frequency' work of your bass1b. Here is the crucial difference RMT vs TMC. RMT doesn't have anything similar so that's why you need to multiply instruments, patterns and notes etc. to get the result. BTW: the PWM works in higher octaves with some restrictions. It needs to be slowed down by widening the envelope loop.

 

 

Third example is fixed pulse width. It uses instruments Bass3x. For every different pulse width I need new instrument in RMT. But only for the second channel. Bass3a in channel 1 is the same as in previous examples. Bass3b is similar as before. The second frame is important. That one sets the initial pulse width. Bass3b uses command 201. Bass3c uses 203. Bass3d 205 and bass 3d 207. Third, looped frame uses 200, in other words fixed phase, and no tone table is used.

The track is done so channel 1 only uses Bass3a, and on channel 3 there is variation of the different pulse widths.

 

post-45308-0-91021700-1542661114.png

 

Something interesting above. I can set pulse width of a given instrument by using R:4 command from the pattern. Its value sets the 'filter frequency' so it can work as your different instruments bass3b-d. This way the pulse width can be set to various fixed values, no need to multiply instruments and patterns. There are some constraints due to the pattern density and arrangement of course so it depends on a given context, the commands share the column with notes unfortunately.

 

I'll make something more substantial to illustrate the above ;)

Share this post


Link to post
Share on other sites

That's neat. But basically it means you are also using 0 frequency for phase reset ?

It is exactly that.

The difference is that RMT offers that Command 6 for joined channels.

It is also possible to use a separated channel with filter active, and to change the pitch with command 4 . Sou you could change the filter programming on channel one while it is possible to exchange the "instrument" on channel 2 of the filter voices.

Share this post


Link to post
Share on other sites

Hm .. at the moment RMT sets different frequencies to individual channels for liter. It uses F+1 on the second channel by default. You can change it with 6 command, but it's too late and the phase is unreliable.

But we could try to mod RMT so it sets the same frequency on both channels. To get to old effect, you would have to use 601 or 6ff manually. But you would be less limited in doing stuff like phase reset.

Have to try ..

Share this post


Link to post
Share on other sites

Hm .. at the moment RMT sets different frequencies to individual channels for liter. It uses F+1 on the second channel by default. You can change it with 6 command, but it's too late and the phase is unreliable.

But we could try to mod RMT so it sets the same frequency on both channels. To get to old effect, you would have to use 601 or 6ff manually. But you would be less limited in doing stuff like phase reset.

Have to try ..

It could help to keep higher notes better stable.

It would help even more, if someone could path the RMT for playing the highest note for approx. 32 cycles on both channels on the start of a "filter" instrument.

Share this post


Link to post
Share on other sites

Why 32 cycles ? AFAIK the current counter has to be exhausted before new frequency is loaded. Maximum possible value is 255. In 15kHz mode that is 255/15.000 (roughly) .. which is almost one full frame on PAL, and MORE than one frame on NTSC. With 64kHz settings it's roughly 4 times less.

Share this post


Link to post
Share on other sites

Why 32 cycles ? AFAIK the current counter has to be exhausted before new frequency is loaded. Maximum possible value is 255. In 15kHz mode that is 255/15.000 (roughly) .. which is almost one full frame on PAL, and MORE than one frame on NTSC. With 64kHz settings it's roughly 4 times less.

It's about playing the high tone as short as possible, to heave it unhearable , and not interfering the flow of the tune.

Edited by emkay

Share this post


Link to post
Share on other sites

Thing is you have to play it long enough so the value is even used. And 'long enough' is one frame in 15kHz.

Share this post


Link to post
Share on other sites

 

So you are using TMC2.0 now?

 

BTW. Music ProTracker is interesting alternative as well. In addition to pokey sounds, samples can be used too. Old one, but still impressive.

Share this post


Link to post
Share on other sites

Thing is you have to play it long enough so the value is even used. And 'long enough' is one frame in 15kHz.

And why does it work in 4x speed ?

Share this post


Link to post
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.

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...