Msx Music playback artifacts

Por snake

Expert (71)

Imagen del snake

16-01-2022, 16:28

How did you manage to avoid these annoying audio artifacts you can hear when you play consecutive notes at short distance in the same channel?

Before to play the new note i always have to disable the channel by setting to zero the corresponing register 32-40 (20$-28$), otherwise the new note won't play. The shutdown is always abrupt if the sustain of the old note is still high.

You can reproduce these artifacts through Moonblaster: set a piano track, insert consecutive notes on this track, and play them fast.

Login sesión o register para postear comentarios

Por Grauw

Ascended (10823)

Imagen del Grauw

16-01-2022, 16:35

Hey snake, when you say “setting to zero the corresponing register 32-40 (20$-28$)”, do you mean you set the entire register to zero?

You should only set the key-on bit (bit 4) to zero. The rest if the bits should stay the same as before, otherwise you will hear an abrupt change in pitch as well.

Of course a single channel can only play one sound, so if you play a new note it will abort the currently playing tone. It will apply a short “dump” envelope phase to silence the previous tone, in order to make this more smooth and prevent audible clicks etc.

Por snake

Expert (71)

Imagen del snake

22-01-2022, 01:16

Thanks fot help.
I attempted to change only the bit 4, but there isn't any difference.
I did some experiment with Moonblaster, there are instruments as harpsichord and acoustic bass that aren't affected, but with flute you can hear a bump at every note change (try to write a note every 2 positions and play with 19 tempo). I think it's somehow related to envelope sudden variations.
The only workaround i found is to use more than 1 channel for the same instrument; when you play a new note, you silence the last used channel ("OFF" code of Moonblaster) and, at the same time, you play the new note on another channel (now flute is ok).

Por snake

Expert (71)

Imagen del snake

15-08-2022, 11:51

Finally i managed to get a good playback quality by combining the two tricks: graceful fm channel silencing by resetting only bit 4 (i was wrong on my previous statement, it does make a big difference), and play a new note on a previously silent fm channel instead of the last used one (which is silenced right after). This way i avoid sudden envelope and pitch varations that may cause audible flaws.
Only drawback is high channels consumption, for instance, when you play a 3 notes chord you need 3 silent channels available.

Por Parn

Paladin (854)

Imagen del Parn

15-08-2022, 14:13

Seems to me that your problem is that when you play a new note you reset the envelope, which can sound especially jarring in non-percussive instruments with slow attack rate. Maybe you can solve your problem by shortening the duration of the notes a bit. You'll probably lose the legato, though. When using non-percussive instruments like flute or clarinet, if I want legato it's a bit hard to avoid using an extra sound channel.

Now obviously you shouldn't touch pitch before key off or after key on (unless you want to do a portamento, and in that case you won't use key off or key on at all, of course).

Por snake

Expert (71)

Imagen del snake

15-08-2022, 17:16

I think i overestimated channel consumption issue: whenever i play a new note, the release of previously used channel is immediate, so it may be used straight for the next note (however, the more time a channel is silent before to play a new note, the better the sound quality should be).

And yes, i also did something like graceful note attack: i set the key on bit 4 only after i set all other required values (including other bits from the same register).