
I wonder if we could convince the devs to put a 108-key piano with cyclicsounds in vanilla as a standard/example for everyone else to work from? The "officialness" might help keep everyone else compatible.
Moderator: ickputzdirwech
There is this mod (https://mods.factorio.com/mod/musical-speaker-fixed ), which wasn't ported for 2.0 or space age and doesn't contain the sound sample in the portal version, because it's around 1 GB, it's in archive there : https://github.com/IAmTomaton/musical-s ... tag/v1.0.3Illiander42 wrote: Wed Feb 26, 2025 6:58 pmmgabor wrote: Wed Feb 26, 2025 7:13 pmSo I have to agree with this position. If there was a de-facto standard instrument pack mod, I would definitely make miditorio support it. At that point implementing note length and sustained notes properly would have a huge effect on the end result. Until then, I don't think the "stop immediately" mode is worth the large rework that would be needed. Even if I define per-instument offsets for how long the note should continue after the midi note off event, I don't think it would sound good.someone throws a full sound set modpack at the portal so I don't have to
Yeah, a good piano would definitely go a long way. There are so many (royalty) free sample packs that I'm sure could be used too.Illiander42 wrote: Wed Feb 26, 2025 10:21 pmI wonder if we could convince the devs to put a 108-key piano
Doesn't it just increace the number of speakers needed a bit? Or am I thinking in sheet music too much?mgabor wrote: Wed Feb 26, 2025 11:31 pm If I had to choose only one of these features and couldn't use the other, I'd have to pick polyphony. It is unfortunately not feasible to build any sort of generic music player without it. So with my current understanding it seems that the fixed speaker volumes and the note velocity bucketing logic will stay in miditorio for now.
You could account for each instrument’s note length and allocate notes across a number of speakers so that they never overlap on the same speaker. Assuming that most notes will have different velocities, you could need anywhere from 5-10 speakers per instrument track depending on the speed of the song. If there are chords being played, each note in the chord needs its own speaker as well.Illiander42 wrote: Thu Feb 27, 2025 9:03 am Doesn't it just increace the number of speakers needed a bit? Or am I thinking in sheet music too much?
That's a good point, that's the number of polyphony that those instruments are physically capable of. If you pluck a string that's already "playing" a note that will be replaced by the new note.Illiander42 wrote: Thu Feb 27, 2025 10:44 am My brain is just getting stuck on "you can't possibly need more than 4 speakers for a violin, 1 for a trombone, 6 for a guitar, 4 for a bass"
Donion, can you please take another look at the "Stop playing" behavior? When a sample needs to be stopped, the audio engine must wait for the next zero crossing event of the sample in order to avoid an audible pop.
Here's a simple proof of concept that lengthens a saw wave note by 5 ticks. Original on the right for comparison.mgabor wrote: Thu Feb 27, 2025 10:02 am I just realized that you can technically make the existing sounds play cyclically! You just have to play multiple sounds of the same type started with an exact delay and manipulate their volumes so that they seamlessly transition into one another.
That's pretty similar to what i tried to explain on the other thread 112836 but i think the article you linked simplifies to get to core concept because there is only 1 wave in their example as a mono sound, whereas in game they are stereo sound, which unfortunately, makes me think it is not always possible to guarantee that the first part of your sentence is achievable. In the other thread it was possible to extend the lengh of a note because there was a moment in the sound when the zero crossing occurs at the same time for both left and right, similar to your picture of square wave. But there was this disclaimer :mgabor wrote: Thu Feb 27, 2025 11:38 am Most audio engine libraries should have options to respect the zero crossing when stopping sample playback.
You can find more information about zero crossing and how they are handled during audio editing in this article.
This is how it look in audacity :( good thing your note is not made of frequency of opposite phase on stereo track , this is a nightmare to sample without clipping ).
Madness! Next you'll be saying this isn't a fully-featured computer!Donion wrote: Mon Mar 03, 2025 12:29 pm Let's not forget this is still a game and not an audio workstation![]()
Thanks for the improvements already !
I have been reading the linked article by mgabor again, and documented a bit more, i think the addition of a tiny (5-10ms) fade-out has no downside.
That may explain why my other attempts at adding instrument that i thought would be easier didn't work out so far x).
When i look at the previous blueprint it makes wonder, is the goal of the game to make an audio workstation ? x).Donion wrote: Mon Mar 03, 2025 12:29 pm Let's not forget this is still a game and not an audio workstation![]()