Welcome, Guest. Please login or register.


Author Topic: Dave music capabilities (Read 3525 times)

Offline ssr86

  • EP user
  • *
  • Posts: 359
  • Country: pl
  • OS:
  • Windows 7/Server 2008 R2 Windows 7/Server 2008 R2
  • Browser:
  • Firefox 49.0 Firefox 49.0
    • View Profile
Dave music capabilities
« on: 2016.November.16. 14:06:50 »
As there are people more experienced with Dave sound generation and its capabilities I wanted to ask what are the possible channel use configurations.
The basic is use 3 channels as square or one of them for noise. You can enable some pokey-like distortion, a simple filter, ring modulation and that's about it.
But what if you use sound interrupts?
* one channel imitating pulse wave with or without pulse modulation. With lower sounds the interrupts won't be that frequent so this won't use that much cpu then, I think...
* use constant timer frequency (7812.5Hz fires once about every second raster line (?) so I don't know if getting higher than that would make it feasible to use for something more than a static screen...)
And you need to sacrifice one entire channel for the timer frequency - at least I couldn't get a good sound with one channel as timer and sound - too much of high frequency noise. However one could use the right and left amplitude control for different sounds so I guess you recover the lost channel somewhat with this... Then it's basicly (?) two 6bit sample-based instrument playback...
The DAC mode will sacrifice the entire left or right amplitude for sample playback (right?). And you still need the interrupts with a high frequency

Here's a link to the 1st part (of six) of maxymizer (an atari st chiptracker) https://www.youtube.com/watch?v=YjW8fn1n9YY (somewhat related I think).


Offline endi

  • EP addict
  • *
  • Posts: 7305
  • Country: hu
  • grafikus, játékfejlesztõ, programozás, scifi, tudományok, vallás
  • OS:
  • Windows 7/Server 2008 R2 Windows 7/Server 2008 R2
  • Browser:
  • Chrome 54.0.2840.87 Chrome 54.0.2840.87
    • View Profile
    • Honlapom
Re: Dave music capabilities
« Reply #1 on: 2016.November.16. 14:46:19 »
if you use a high freq interrupt, better to use it for playing digi sounds
Vigyázat! Szektás vagyok! :)

Offline ssr86

  • EP user
  • *
  • Posts: 359
  • Country: pl
  • OS:
  • Windows 7/Server 2008 R2 Windows 7/Server 2008 R2
  • Browser:
  • Firefox 49.0 Firefox 49.0
    • View Profile
Re: Dave music capabilities
« Reply #2 on: 2016.November.16. 15:18:34 »
if you use a high freq interrupt, better to use it for playing digi sounds
With the sound interrupts I had in mind playing sawtooth/sine/pulse waveform instruments from 256 byte samples. However whese don't sound very good in my experiments... The samples provided with rockmonitor(I think I may have made a mistake with the name) samples sound not bad - especially the guitars and could be compressed to 1bit samples and still preserve the distortion guitar sound. I wouldn't want to use bigger samples (maybe only for digidrums)...

Offline ergoGnomik

  • EP lover
  • *
  • Posts: 836
  • Country: hu
  • Stray cat from Commodore alley
  • OS:
  • Windows 7/Server 2008 R2 Windows 7/Server 2008 R2
  • Browser:
  • Opera 9.80 Opera 9.80
    • View Profile
Re: Dave music capabilities
« Reply #3 on: 2016.November.16. 17:37:38 »
If I were you, I'd never do anything digital. I'd go the native way. You should try making a native editor and player like Music Box or something more fancy with access to all the bells and whistles of DAVE, then try to contact someone like Yerzmyey. People like him could even give you advice how to improve your editor and player.

I could give you some vague basic hints how a player should work, based on the little knowledge I have about C64 music players and what people tried to do on the Plus/4. But the pros are a better source.

Offline ssr86

  • EP user
  • *
  • Posts: 359
  • Country: pl
  • OS:
  • Windows 7/Server 2008 R2 Windows 7/Server 2008 R2
  • Browser:
  • Firefox 50.0 Firefox 50.0
    • View Profile
Re: Dave music capabilities
« Reply #4 on: 2016.November.17. 10:29:06 »
If I were you, I'd never do anything digital. I'd go the native way.
Why?
Quote
You should try making a native editor and player like Music Box or something more fancy with access to all the bells and whistles of DAVE, then try to contact someone like Yerzmyey. People like him could even give you advice how to improve your editor and player.
That's what I'm currently trying to tackle to be honest. However (as maybe some of you noticed) I never finish what I start so... But currently I'm playing with doing an instrument editor in Java based on Dave emulation code ripped from ep128emu. And I'm looking for info what is possible outside the noise and dull square. I may be starting from the bad side...as I dont have a native player written or even really planned out - just the dave code plugged in to a "simple view" and experimenting with that.

Quote
I could give you some vague basic hints how a player should work, based on the little knowledge I have about C64 music players and what people tried to do on the Plus/4. But the pros are a better source.
What did people try to do on the Plus/4? The TED has only two channels, right?

Offline ergoGnomik

  • EP lover
  • *
  • Posts: 836
  • Country: hu
  • Stray cat from Commodore alley
  • OS:
  • Windows 7/Server 2008 R2 Windows 7/Server 2008 R2
  • Browser:
  • Opera 9.80 Opera 9.80
    • View Profile
Re: Dave music capabilities
« Reply #5 on: 2016.November.17. 19:17:07 »
Why?
Because all that would be yet another 8-bit machine playing digital music. It'd completely miss the Enterprise characteristics.

That's what I'm currently trying to tackle to be honest. However (as maybe some of you noticed) I never finish what I start so... But currently I'm playing with doing an instrument editor in Java based on Dave emulation code ripped from ep128emu. And I'm looking for info what is possible outside the noise and dull square. I may be starting from the bad side...as I dont have a native player written or even really planned out - just the dave code plugged in to a "simple view" and experimenting with that.
It may not look much, but there is channel synchronization, "filter" effects and stereo volume control. The first two would need a lot of time sunk into them because it could be done easier in practice than trying to rationally think over their use. However, volume control could be used, as it can be done in the IS-BASIC, to make stereo panning and envelopes. And this latter can be made with comparatively not much resource use in higher definition than the once per frame as in BASIC. That could liven even boring square waves.

What did people try to do on the Plus/4? The TED has only two channels, right?
Yes, TED has only two channels, with only 10 bits pitch control, so frequencies range from ~110 Hz up to ~110 kHz. Furthermore, it has only 9 volume levels including off. Its noise generator is an only 11 bits LFSR, and it can play on only one channel and can't be mixed with the square wave (either square or noise, they are mutually exclusive). And volume control is shared between those two channels.

There was a very severe dearth of musical talent on the platform in the 90s, therefore they mostly tried to convert C64 music. Although there were people writing their own music and others who disassembled C64 music and rewritten it for Plus/4, that was not the mainstream. The mainstream had two courses: frequency conversion and waveform conversion.

Frequency conversion was running the original music, read the frequency values and the waveform, converted the frequency to TED and selected square or noise waveform. The converter was set up to play one selected channel continuously (lead), and the other two channels were multiplexed on the other TED channel, but sometime even that wasn't done. There were FRQ players that tried to do some crude ADSR envelope emulation, too. I guess, you can imagine how unappealing the results were.

Waveform conversion also run the original music, and tried to emulate the SID waveforms with digital playback of sampled waveforms and also applied crude ADSR emulation. Well, besides they are the worst possible resource hogs, wave converters also couldn't really achieve easy to bear sound quality, which shouldn't surprise you since the volume control is seriously limited.

After a while talented people said "Screw it, second-hand music doesn't cut it." So they started to compose native music, which can be considered sufficiently nice, if you are willing to make concessions out of pity for the poor capabilities. If you are interested in it, I could recommend you some examples. And, of course we could discuss some music player basics up to the limits of my knowledge.

Offline ssr86

  • EP user
  • *
  • Posts: 359
  • Country: pl
  • OS:
  • Windows 7/Server 2008 R2 Windows 7/Server 2008 R2
  • Browser:
  • Firefox 50.0 Firefox 50.0
    • View Profile
Re: Dave music capabilities
« Reply #6 on: 2016.November.21. 15:29:05 »
Hmmm...
Because all that would be yet another 8-bit machine playing digital music. It'd completely miss the Enterprise characteristics.
But I think that if it's more or less feasible then the tracker should allow to use it. But I don't know yet what are the good configurations of channels/digi etc.
I like the sound-interrupt-based pulse modulation as it uses just one channel, sound good - no high frequency noise like with sample based waveforms. And it shouldn't be that cpu-intensive at low frequency sounds.
Quote
It may not look much, but there is channel synchronization, "filter" effects and stereo volume control. The first two would need a lot of time sunk into them because it could be done easier in practice than trying to rationally think over their use. However, volume control could be used, as it can be done in the IS-BASIC, to make stereo panning and envelopes. And this latter can be made with comparatively not much resource use in higher definition than the once per frame as in BASIC. That could liven even boring square waves.
What can you do with sync?
The ring modulation and filter are somewhat troublesome because their frequency must be controlled by another channel... However I like the ring modulation because it is possible to get something similar to the pulse modulated sound.

Quote
Yes, TED has only two channels, with only 10 bits pitch control, so frequencies range from ~110 Hz up to ~110 kHz. Furthermore, it has only 9 volume levels including off. Its noise generator is an only 11 bits LFSR, and it can play on only one channel and can't be mixed with the square wave (either square or noise, they are mutually exclusive). And volume control is shared between those two channels.

There was a very severe dearth of musical talent on the platform in the 90s, therefore they mostly tried to convert C64 music. Although there were people writing their own music and others who disassembled C64 music and rewritten it for Plus/4, that was not the mainstream. The mainstream had two courses: frequency conversion and waveform conversion.

Frequency conversion was running the original music, read the frequency values and the waveform, converted the frequency to TED and selected square or noise waveform. The converter was set up to play one selected channel continuously (lead), and the other two channels were multiplexed on the other TED channel, but sometime even that wasn't done. There were FRQ players that tried to do some crude ADSR envelope emulation, too. I guess, you can imagine how unappealing the results were.

Waveform conversion also run the original music, and tried to emulate the SID waveforms with digital playback of sampled waveforms and also applied crude ADSR emulation. Well, besides they are the worst possible resource hogs, wave converters also couldn't really achieve easy to bear sound quality, which shouldn't surprise you since the volume control is seriously limited.

After a while talented people said "Screw it, second-hand music doesn't cut it." So they started to compose native music, which can be considered sufficiently nice, if you are willing to make concessions out of pity for the poor capabilities. If you are interested in it, I could recommend you some examples. And, of course we could discuss some music player basics up to the limits of my knowledge.
I was trying to do something like the waveform-emulation with the samples but I guess It won't ever sound very good and takes too much cpu I guess.

As for the tracker, how would you solve the problem  of channel dependancy for filter and ring modulation? Some sequence tables with pitch shifts taht should be added to the base channel's frequency and then set as the dependent channel frequency?

There's also the problem of distortion pokey-like sound that could be used for leads also but the frequencies are sometimes higher/lower/off or mute and so I guess these would need an additional note frequency conversion lookups or frequency corrections....

Another thing that I would appreciate an advice on is the tone control sequence in relation to the envelope sequences. For now I think I will be making the left envelope an indepoendant sequence of volumes - its own length, loop start/end, speed. The right envelope sequence and tone control sequence (distortion/filter/rm options values 0-f) will be dependant - that is they'll be sharing length and loop. There's also the noise channel control which is shared on all channels... I think I'll be doing this as part of the right envelope/tone control sequence and each channel instrument will be allowed to change it but the priority of channels within the player routine will decide on the outcome... The same woulg go for filter and rm if the dependant channel would be changing its frequence independantly...
« Last Edit: 2016.November.21. 16:21:57 by ssr86 »

Offline ssr86

  • EP user
  • *
  • Posts: 359
  • Country: pl
  • OS:
  • Windows 7/Server 2008 R2 Windows 7/Server 2008 R2
  • Browser:
  • Firefox 50.0 Firefox 50.0
    • View Profile
Re: Dave music capabilities
« Reply #7 on: 2016.November.24. 12:38:44 »
A little off-topic but I find it strange there are no pokey tune ports (or just similar sounding) for the dave and an emulator of the ay and tunes ported from the spectrum. Well I know that the reason is the speccy/cpc ports but dave sound capabilities are much closer to POKEY than the AY IMO: square wave or noise, polynomial distortion, crude high pass filter.

Offline Zozosoft

  • EP addict
  • *
  • Posts: 13519
  • Country: hu
  • OS:
  • Windows XP Windows XP
  • Browser:
  • Firefox 50.0 Firefox 50.0
    • View Profile
    • http://enterprise.iko.hu/
Re: Dave music capabilities
« Reply #8 on: 2016.November.24. 12:50:24 »
Until now I don't know anything about POKEY :oops:  8 bit Atari machines are not too popular in Hungary.

At ZX/CPC musics the player code also written for Z80, then easy to ported. But the POKEY are with 6502 CPU...

Offline ssr86

  • EP user
  • *
  • Posts: 359
  • Country: pl
  • OS:
  • Windows 7/Server 2008 R2 Windows 7/Server 2008 R2
  • Browser:
  • Firefox 50.0 Firefox 50.0
    • View Profile
Re: Dave music capabilities
« Reply #9 on: 2016.November.24. 13:01:27 »
http://krap.pl/mirrorz/atari/homepage.ntlworld.com/kryten_droid/Atari/800XL/atari_hw/pokey.htm

Yeah, different cpus so emulation would be inefficient but still better than the sid I guess.
However I've wanted to address the feasibility of writing music sounding like the pokey although dave has one channel less and you can't merge channels...

Offline ergoGnomik

  • EP lover
  • *
  • Posts: 836
  • Country: hu
  • Stray cat from Commodore alley
  • OS:
  • Windows 7/Server 2008 R2 Windows 7/Server 2008 R2
  • Browser:
  • Opera 9.80 Opera 9.80
    • View Profile
Re: Dave music capabilities
« Reply #10 on: 2016.November.25. 19:48:40 »
Hmmm...
I'm actually really happy, that you did start with Hmmm... instead of a This is fat BS. I wasn't quite sure that my opinion will be appreciated.

But I think that if it's more or less feasible then the tracker should allow to use it. But I don't know yet what are the good configurations of channels/digi etc.
I like the sound-interrupt-based pulse modulation as it uses just one channel, sound good - no high frequency noise like with sample based waveforms. And it shouldn't be that cpu-intensive at low frequency sounds.
I don't say that you shouldn't do it no matter what. I tried to say that digital instruments only songs are characterless, thousand times heard things. However, if you can do it somewhat similarly to what the C64 guys did, like, let's say, as one independent track that plays instruments that are hard to do, go for it. It depends only on the amount of resources you are willing allocate to this purpose. But digi only is not really something you should pursue in my view.

What can you do with sync?
Sync is very handy when you want to do stable superposition effects. I don't know what your plans are for your player, but, I guess, you wouldn't really want to write a constant runtime cycle-exact routine. But without that properly synchronizing the channels is a hard thing to do. And I'm fairly sure that sooner or later the musician(s) you hope to entice to make music for the EP will request it. They can hear the tiniest anomalies, which you and I couldn't perceive even if our life hangs on it.

I was trying to do something like the waveform-emulation with the samples but I guess It won't ever sound very good and takes too much cpu I guess.

As for the tracker, how would you solve the problem  of channel dependancy for filter and ring modulation? Some sequence tables with pitch shifts taht should be added to the base channel's frequency and then set as the dependent channel frequency?

Another thing that I would appreciate an advice on is the tone control sequence in relation to the envelope sequences. For now I think I will be making the left envelope an indepoendant sequence of volumes - its own length, loop start/end, speed. The right envelope sequence and tone control sequence (distortion/filter/rm options values 0-f) will be dependant - that is they'll be sharing length and loop. There's also the noise channel control which is shared on all channels... I think I'll be doing this as part of the right envelope/tone control sequence and each channel instrument will be allowed to change it but the priority of channels within the player routine will decide on the outcome... The same woulg go for filter and rm if the dependant channel would be changing its frequence independantly...
Yes, waveform emulation is a solution isn't worth to experiment with in my view, too.

Actually, there is no perfect solution for the filter and ring problem. Maybe there is not even a half right thing to do. But it is not necessarily a show stopper. For example the SID has only one filter, so the only solution is using it exclusively. The problem here must be tackled the same way. You have to construct a priority scheme. It could be static or dynamic, it depends on how much resources you want to allocate to it. The static priority could be something like all filter and ring modulation effects has priority, they are free to interrupt the necessary channels (the interrupted channel, after the "intruding" effect, should stay empty until the next played note), but they, let's say, must be originating from track 0 and only played in channel 1. Dynamic priority means that you allocate the channels as necessary, but already allocated channels can't be interrupted, unless the interrupting note has higher priority. This note priority could be based on e.g. the track order: e.g. track 0 has highest priority, track 2 (or 3 – depending on your design) has lowest priority. This means that complex instruments should be used with extreme care, or maybe only in parts where they are the only one playing, but I think this is not such a big problem that it would be impossible to live with it.

AFAIK, modern players are table based. There are tables for waveforms, fine pitch control, arpeggio, filters, you name it and instruments are iterating through them. I don't know how it goes on different platforms, but C64 and Plus/4 players mostly work on this basis. Any such player has usually three entry points: initialization, main play call, effects play call. Initialization is obvious, it resets all internal variables and initializes them to play the selected sub-song, if any. The play call iterates through the stored notes, selects instruments, sets note length, do transpositions and any such things as necessary. The effects play call is advancing through the above said tables and builds up the voice of the instrument. Now, this latter is called at least once per main play call, but not necessarily. If you ever met expressions like "it's a 4x tune" regarding a SID song, it was very probably talking about exactly this thing. I think, you know by now what I'll suggest. You should build such tables into the player. There should be at least a waveform table, some pitch control table, and envelope table. Try to find descriptions of such routines and study them. Or try to talk to the guy I mentioned earlier, he could give detailed advise based on his experiences.

However, I wouldn't design the envelope control like you are planning to do it. You should do instead a dynamic design based on global volume, track local volume, stereo position and envelope. The basic design could be something like all four has the range 0 to 15, and the left and right volume is calculated by multiplying them, then normalizing to the 0 to 63 range. Of course, the position is a bit different, because the actual values to use should be stored in two tables. And it should be driven by the effect play routine. I don't know how much resources this design needs. You should make some test cases and adjust it according the results, or reject some parts or even the whole concept. Obviously, the length, looping and speed parameters should be done as you see it fitting best.

If I were you, I'd go for a 50 Hz or 1 kHz interrupt based, obviously not digi playing, design that can utilize all channels. Of course, the 1 kHz interrupt should be scaled back to the sub 250-200 Hz range (no more than four or five music calls per frame).

Offline ssr86

  • EP user
  • *
  • Posts: 359
  • Country: pl
  • OS:
  • Windows NT 6.2 Windows NT 6.2
  • Browser:
  • Firefox 50.0 Firefox 50.0
    • View Profile
Re: Dave music capabilities
« Reply #11 on: 2016.December.02. 18:26:54 »
How do you emulate the ay envelope sound?
Channel frequency code = 0 and change volume in the 1kHz interrupts?
« Last Edit: 2016.December.02. 19:45:47 by ssr86 »

Offline ergoGnomik

  • EP lover
  • *
  • Posts: 836
  • Country: hu
  • Stray cat from Commodore alley
  • OS:
  • Windows 7/Server 2008 R2 Windows 7/Server 2008 R2
  • Browser:
  • Opera 9.80 Opera 9.80
    • View Profile
Re: Dave music capabilities
« Reply #12 on: 2016.December.02. 20:13:58 »
What is that ay envelope sound and why do you want, no matter what it costs, emulate something? This is not AY, POKEY, SID or whatever else, this is DAVE. It should have its own distinctive tone, not the copy of something.

Offline ssr86

  • EP user
  • *
  • Posts: 359
  • Country: pl
  • OS:
  • Windows NT 6.2 Windows NT 6.2
  • Browser:
  • Firefox 50.0 Firefox 50.0
    • View Profile
Re: Dave music capabilities
« Reply #13 on: 2016.December.02. 20:45:12 »
Relax ;P. I was just asking how something is done to know what techniques/tricks are used. I just want to know what is possible and how it's done. I'm just trying to learn.

For now I know that you can do a good bass tone with distortion4 after some note frequency corrections (and 2 different types even...) - similar to the pokey "bass". Although you won't be able to use vibrato on it...
There is also a good sound with distortion5 on the higher frequencies and you can use vibrato with that.
The pure tone squarewave is somewhat dull and I still have to learn what can be done with the filter and ring modulation. I know that you should be able to get a good bell sound with ringmod.

I'm curious what can be done with the 1kHz interrupts. It's still Dave, no?

I'm currently not really thinking about the cpu/memory constraints, just what is theoretically possible. Maybe that's a bad approach... but fun.

Dave won't get a distinctive tone I think. It will sound a bit like pokey and a bit like ay. Maybe with the ringmod/filter you can get something new. Maybe also with the interrupts.
The ay envelope sound is the sawtooth low ptch sounds found in dozen ay chiptunes and I think it's done with the 300Hz interrupts on the cpc.

Offline endi

  • EP addict
  • *
  • Posts: 7305
  • Country: hu
  • grafikus, játékfejlesztõ, programozás, scifi, tudományok, vallás
  • OS:
  • Windows 7/Server 2008 R2 Windows 7/Server 2008 R2
  • Browser:
  • Chrome 54.0.2840.99 Chrome 54.0.2840.99
    • View Profile
    • Honlapom
Re: Dave music capabilities
« Reply #14 on: 2016.December.02. 20:51:24 »
What is that ay envelope sound and why do you want, no matter what it costs, emulate something? This is not AY, POKEY, SID or whatever else, this is DAVE. It should have its own distinctive tone, not the copy of something.

yes we must use dave as dave.
but I think, for music, dave special capabilities is not good. I my demos I tried them... I have many musics in my demos and games where I used the filters, ring modulations etc. I have many basic (exos) tests... Ah... I hope somebody else will make something new and good. :)
Vigyázat! Szektás vagyok! :)