Illiander42 wrote: ↑Thu Apr 04, 2024 12:37 pm
@mmmPI: There was a bit of discussion about why Factorio cannot do proper sound editing
here.
I was doing some test on that note with 44.100 hz wav because it can divide by 60 , i recreated the sound in your test in audacity by picking up only 1 wavelengh and then copy pasting it with the proper number of points sampling points on a 44.100 hz workspace , to avoid the clipping. It worked , i could recreate a continuous sound from the single wavelength, but then i think such sound would have a duration of a non-integer number of ticks if you want to isolate the single wave. Or it would have to be a sound without proper enveloppe and the clipping will be heard. I'm not sure what you were trying to do, i wish i could help. This is the recreated sound from a single wavelengh taken from the 16th tick of test folder linked in the other thread that start and end in a neutral point :
The problem with sound that have a lengh of 1 tick and clipping is about physic to me. The clipping is heard when the curve representing the sound is at some moment having a discontinuity.
- 1 wave.jpg (117 KiB) Viewed 7965 times
upper part is the attached .rar
bottom part the original 1 tick sample
This single wave length that i duplicated has a certain duration, and the sound for it not to clip without enveloppe, it would need to be cut "perfectly" at a place where it is 0 like the seleted area. If the sound start or end when the wave is not in the middle the initial or even finishing clap can be heard. This is the case in the sample number 16 from your test.
As such, if such sample is played alone it will make some noise. Having the previous one queued would remove the clapping i suppose. But an isolated segment 16 would always clap unless if cut with neutral curve at start and end. ( good thing your note is not made of frequency of opposite phase on stereo track , this is a nightmare to sample without clipping ).
If using 1 tick long sound, except for rare frequency that fit into a tick perfectly, like 60 hz or 120 hz or 360 hz, each individual segment could end up looping seemlessly like a Gif, but otherwise 82 HZ for example, means that the wavelengh is not going to fit an integer number of time in a tick measured precisely at 1/60 of second or 60 HZ. In such case i don't know how programs deal with sounds. Namely how much time in microsecond between 2 sound.
This is related i think to the sampling rate again, the number of points that are used to represent the curve for 1 tick as visible in the picture, the .Ogg at 14.000 hz but for the wav you need to zoom in because there are a more points :
- clipping.jpg (91.54 KiB) Viewed 7965 times
In audacity the spacing between the 2 left and right parts is automatically choosen to adapt the sampling rate. But for the lower part, the lower sampling rate could require special treatment , as 60 hz for the game framerate and 14000 hz are not working the same as 60 and 44.100 it means somehow the 2 sound being played following each other need to have a little offset to reproduce that difference :
- clipping2.jpg (95.07 KiB) Viewed 7965 times
The bottom part represent i suppose what is being heard in the game currently when looping such segment. I don't know about the timing, the spacing between the left and right part of the "note 16" at the bottom. But i know the annoying clipping sound can come from either left and right side of the curve not aligning which i feel is bound to happen if the sample is 1 tick long but you want different frequency on it, and the clipping not being done in a place where it's neutral when starting a sound, this will cause a clap.
I only see problems when i look at things this way, but when playing somehow it matters less. Some of the "problem in theory" do not materialize, if the gap is tiny, and there are other sounds for example. I'm interested in the solution to those questions , it makes me curious