https://www.youtube.com/watch?v=4D28quLwQG0
I played each song twice. Some have a unique beginning, the rest just repeat.
Code: Select all
https://codeberg.org/DW0RKiN/M4_FORTH/src/branch/master/Testing/music.tap
Code: Select all
https://codeberg.org/DW0RKiN/M4_FORTH/src/branch/master/Testing/music.tap
Code: Select all
#!/bin/sh
[ $# -lt 1 ] && printf "Error: $0: Need fmf filename!\n" >&2 && exit 1
name=$1
if [ -s "$1" ] ; then
name=${1%.*}
input=$1
elif [ -s "$1.fmf" ] ; then
name=$1
input=$1.fmf
else
printf "Error: $0: \"${1}\" not found!\n" >&2
exit 2
fi
echo " name: " $name
echo " input: " $input
echo "output: " $name.mkv
fmfconv ${input} | ffmpeg -i - -vf palettegen palette.png
fmfconv --raw-sound ${input} | ffmpeg -i - -i palette.png -filter_complex "crop=288:216,scale=1440:1080:flags=neighbor [x]; [x][1:v] paletteuse" -c:a flac -c:v zmbv -compression_level:a 12 ${name}.mkv
No, all the tracks are identical.
No, the frequencies of all tracks are generated for each sample for a whopping total sample rate of 4557 KHz.
Does the sound change if I have the same pattern, but I switch channels? Or is it impossible to hear with the human ear?utz wrote: ↑Thu Mar 28, 2024 2:45 pm Glad you're having fun with octode2k16! Those conversions are great. You're one of the very few people using that engine, actually.
To answer some questions: Yes, the sound on actual hardware is more raspy. The "unfiltered" option in Fuse provides a fairly accurate rendition of how it will sound on the real machine. Some other emulators tend to overemphasize the raspyness, though. In addition to the imperfections caused by hardware limitations, there some also bugs in the engine that lead to even more unwanted noise. But hey, I was young and naive when I wrote that
No, all the tracks are identical.
No, the frequencies of all tracks are generated for each sample for a whopping total sample rate of 4557 KHz.
Switching channels should not change the sound. However, see the caveat below.
Generally it doesn't matter which combination of tracks you double on. However, the engine never resets the oscillator phases. That means that there might be some difference, depending on the combination of phases that will play. A slight phase difference will make the sound more bell-like. In theory, two tracks can even cancel each other out, if their phases happen to be inverted. However, there is no way to control phases directly, so any musical use of this will basically happen by accident. One could easily add phase control, but it would of course double the size of the music data, and make pattern row transitions slower and consequently noisier.
Only indirectly, depending on the oscillator phases. I assume any differences would be marginal, but I might be wrong.
Correct, BPM is ignored completely and the converter assumes a fixed BPM setting of 90 or thereabouts (it's never 100% accurate). If the mods change BPM via effects, then you're out of luck._dw wrote: ↑Sat Mar 30, 2024 10:24 pm The last time I came across that the playback speed is sometimes lower than in the original. It seems that only "Speed" is taken into account and "BMP" is ignored. I deal with it by simply speeding it up until I don't like it. But some mods have the speed change written as an effect right in the track, and then I wonder what I'm doing when it slows me down in the middle of the song. Because speed change support is one of the few things that octode2k16 supports.
Ah, then it's actually not so bad. I was just glancing over it and had the impression that not all the timings were calculated correctly. This leaves only
which should actually do the same thing as core0, but switch the beeper ON at the beginning and then leave it on. In fact, with a bit of code shuffling one could probably just write the OUT command and then jump into core0. Everything must add up to 4x192t, though.
Not quite. For each sample (what you call row, I think - I prefer to use the latter term for pattern rows), the combined volume of all tracks is calculated, and that determines which core will play next.
That's just some hocus pocus to generate some short bursts of noise between rows. Don't worry about it too much. It's essentially the good old
Code: Select all
add hl,de
rlc h
I admit I don't understand it. Oscillator phase?utz wrote: ↑Mon Apr 01, 2024 4:21 pm Generally it doesn't matter which combination of tracks you double on. However, the engine never resets the oscillator phases. That means that there might be some difference, depending on the combination of phases that will play. A slight phase difference will make the sound more bell-like. In theory, two tracks can even cancel each other out, if their phases happen to be inverted. However, there is no way to control phases directly, so any musical use of this will basically happen by accident. One could easily add phase control, but it would of course double the size of the music data, and make pattern row transitions slower and consequently noisier.
You're right, this helped a lot. Played according to testing around 89+. Thanks to this, I am more or less able to synchronize FUSE and Fast Tracker 2 in which I edit it and find in which part there are problems.utz wrote: ↑Mon Apr 01, 2024 4:21 pm
Only indirectly, depending on the oscillator phases. I assume any differences would be marginal, but I might be wrong.
Correct, BPM is ignored completely and the converter assumes a fixed BPM setting of 90 or thereabouts (it's never 100% accurate). If the mods change BPM via effects, then you're out of luck.
Again, I don't quite understand, I should probably go through the asm code.utz wrote: ↑Mon Apr 01, 2024 4:21 pm
Ah, then it's actually not so bad. I was just glancing over it and had the impression that not all the timings were calculated correctly. This leaves only
which should actually do the same thing as core0, but switch the beeper ON at the beginning and then leave it on. In fact, with a bit of code shuffling one could probably just write the OUT command and then jump into core0. Everything must add up to 4x192t, though.
Not quite. For each sample (what you call row, I think - I prefer to use the latter term for pattern rows), the combined volume of all tracks is calculated, and that determines which core will play next.
That drum sound is probably the weakest part of the engine. Sometimes I would need one more unique "sample" for "kick". How often is it difficult to assign which instrument to play which original sample. I have to go through it. Find out which sounds the most like a drum and then look to see if some of the samples don't merge into one, and if so, if they are consecutive in the patterns, so the file should be replaced. Or just leave them out. It is never systematic work to try to map an element of one set onto elements of another smaller set. It's like converting an image to a ZX image. Sometimes the "prettier" solution is the one that has more deviations from the original, because it preserves something that has more weight/importance for a person.utz wrote: ↑Mon Apr 01, 2024 4:21 pm
That's just some hocus pocus to generate some short bursts of noise between rows. Don't worry about it too much. It's essentially the good old
aka "el cheapo" PRNG used in many beeper engines, being called with different seeds according to the drum type.Code: Select all
add hl,de rlc h
Below I am drawing a picture of 3 square waves. Their frequency is the same, but the phase is different.
Code: Select all
___---___---
_---___---__
---___---___
I thought so. However, I just checked the code again and it seems that phase is actually reset. So, the answer is no. Best forget everything I ever said about phase
No. Octode2k16 is not pulse-interleaving. It is a PCM renderer (with the different volume levels realized through PWM). Let's pretend the engine has only two channels. For a given point in time ("sample"), one of these will happen:_dw wrote: ↑Wed Apr 10, 2024 4:29 am I still don't understand how it is with that phase. I assumed that if I double the tone, then the engine plays the same CORE 2 times in close succession. I thought there was a constant switch between all 8 channels for each line. And each channel will play one line in the same CORE.
So CORE 0 is equal to CORE 8. Both mean "silence". Zeros switch OFF to OFF and eights ON to ON. So it shouldn't cause the diaphragm to move.
Code: Select all
chan state core used
ch1 ch2
0 0 core0
1 0 core1
0 1 core1
1 1 core2
Yes, the drums are crap. No volume control - in 2016, we didn't understand yet how to do it. Volume control for click drums was discovered around 2020, I think._dw wrote: ↑Wed Apr 10, 2024 4:29 am That drum sound is probably the weakest part of the engine. Sometimes I would need one more unique "sample" for "kick". How often is it difficult to assign which instrument to play which original sample. I have to go through it. Find out which sounds the most like a drum and then look to see if some of the samples don't merge into one, and if so, if they are consecutive in the patterns, so the file should be replaced. Or just leave them out. It is never systematic work to try to map an element of one set onto elements of another smaller set. It's like converting an image to a ZX image. Sometimes the "prettier" solution is the one that has more deviations from the original, because it preserves something that has more weight/importance for a person.
Do you write somewhere that the volume should be partially controlled? Or am I mistaken?
Yes, I understand now. And this Table changes everything.utz wrote: ↑Mon Apr 15, 2024 10:08 pm Below I am drawing a picture of 3 square waves. Their frequency is the same, but the phase is different.
Does this make sense?Code: Select all
___---___--- _---___---__ ---___---___
I thought so. However, I just checked the code again and it seems that phase is actually reset. So, the answer is no. Best forget everything I ever said about phase
No. Octode2k16 is not pulse-interleaving. It is a PCM renderer (with the different volume levels realized through PWM). Let's pretend the engine has only two channels. For a given point in time ("sample"), one of these will happen:
That is, for every sample, we calculate the total volume of all 8 channels, and select the core accordingly.Code: Select all
chan state core used ch1 ch2 0 0 core0 1 0 core1 0 1 core1 1 1 core2
So it can be said that if the sound has problems, it is not actually set in the engine (asm) but in the C++ converter. Which should, under certain circumstances, choose other solutions. Maybe it would be enough to have some effect registered directly in XM, which would tell him, here is a problem, try to solve it differently.