Programmable Speaker Improvements

Post your ideas and suggestions how to improve the game.

Moderator: ickputzdirwech

Post Reply
Illiander42
Filter Inserter
Filter Inserter
Posts: 514
Joined: Mon Feb 05, 2018 10:01 am
Contact:

Programmable Speaker Improvements

Post by Illiander42 »

TL;DR
Add the following to the programmable speaker:
  • Toggle option to stop sound as soon after the control signal stops as possible. (Ideally within a tick or two)
  • Control signal option for volume.
  • Volume control signal changing effects the currently playing sound, not just future sounds from the speaker.
Also, add a new parameter to Sound: Loop_points: When a sound is being played for longer than it's duration, instead of starting playback of the sound from the beginning again when it reaches the end, it plays from the first loop point when it reaches the second if the signal is saying to keep playing.
What ?
I think the extra options for the Programmable Speaker are reasonably straightforward to understand, but the loop point probably needs a bit of explination.

The wikipedia page on envelopes probably explains the fundamentals of Attack, Decay, Sustain, Release best. (Decay can be treated as part of the Attack in almost every situation, I think?) A lot of sounds have a noticable difference in more than volume in the different stages, especially noticable between Attack/Decay and Sustain. It would make long, continuous sounds (sirens and musical notes are the obvious ones) sound much better if they played taking those parts into account instead of just starting over at the windup again.

So a programmable speaker that recieves an activation signal would play the Attack/Decay once, then continue repeating the Sustain while the control signal is being sent, then when the control signal stops it finishes its current Sustain then plays the Release (this will always sound better than switching to the Release mid-Sustain due to how sound files are set up). (Unless the "stop sound instantly" toggle is active, in which case it would stop instantly regardless of what part it's in) Imagine how that would improve the sound of a classic Air Raid siren.

Unless the "stop sound instantly" toggle is active, a speaker set to "use signal value as tone" that switches directly from one tone to another without any ticks of "off" shouldn't play the Attack/Descent of the new tone and should go straight to the Sustain. (This will let things like guitar fret slides sound right)
Why ?
Because I want to make a better music box than MIDItorio and I want it to be as vanilla as possible.

I can add new sounds (A complete MIDI soundpack is too big for a single mod, but it's not unreasonably large for a modpack, especially with factorio's inbuilt dependency handling) but there are limitations to sound playback that cannot currently be worked around cleanly due to the lack of sound queues. The Musical Speaker mod makes a good attempt, but still has issues.

Edit: I just noticed that Sound is also used for ambient and other sounds. Which means that this addition could also make long-duration locational sounds sound better.
Last edited by Illiander42 on Thu Apr 04, 2024 1:19 am, edited 2 times in total.

Tertius
Filter Inserter
Filter Inserter
Posts: 825
Joined: Fri Mar 19, 2021 5:58 pm
Contact:

Re: Programmable Speaker Improvements

Post by Tertius »

Add to the list:
  • Show the circuit network connection icon in the top right corner, if the speaker is connected to the circuit network. It's missing. Currently it's not possible to see in the speaker's GUI if a speaker is connected or not, and to what network id's it is connected. While you're at it, you can also add the functionality to connect the speaker to the logistics network as it is possible with any other connectable entity.

Donion
Factorio Staff
Factorio Staff
Posts: 184
Joined: Sun Aug 22, 2021 9:18 am
Contact:

Re: Programmable Speaker Improvements

Post by Donion »

Thanks for the write-up. I think this is a good candidate for a 2.1 minor feature.
Illiander42 wrote:
Wed Apr 03, 2024 4:59 pm
  • Toggle option to stop sound as soon after the control signal stops as possible. (Ideally within a tick or two)
  • Volume control signal changing effects the currently playing sound, not just future sounds from the speaker.
These sound reasonable and fairly simple, maybe I'll manage to squeeze them in 2.0 (no promises!)
Illiander42 wrote:
Wed Apr 03, 2024 4:59 pm
  • Control signal option for volume.
Also reasonable.
Illiander42 wrote:
Wed Apr 03, 2024 4:59 pm
Loop_points
Sounds like CyclicSound. Maybe I can just make programmable speaker be able to use them.

Illiander42
Filter Inserter
Filter Inserter
Posts: 514
Joined: Mon Feb 05, 2018 10:01 am
Contact:

Re: Programmable Speaker Improvements

Post by Illiander42 »

Donion wrote:
Thu Apr 04, 2024 8:20 am
Sounds like CyclicSound. Maybe I can just make programmable speaker be able to use them.
Yes! Exactly that!

(With a tiny note about jumping directly from middle sound to middle sound in tone-control mode)

mmmPI
Smart Inserter
Smart Inserter
Posts: 3147
Joined: Mon Jun 20, 2016 6:10 pm
Contact:

Re: Programmable Speaker Improvements

Post by mmmPI »

Illiander42 wrote:
Wed Apr 03, 2024 4:59 pm
(Decay can be treated as part of the Attack in almost every situation, I think?) A lot of sounds have a noticable difference in more than volume in the different stages, especially noticable between Attack/Decay and Sustain.
I think it would only matter to have the decay as 4rth moment in a sound if the duration of "only the decay" could be extended relative to "only the attack", as the volume is bounded by the end of the attack and the sustain that's the only parameter in factorio allowed for change. But it couldn't be achieved by just playing 1.1 or 1.2 times the decay sound in a loop as the clipping would be noticeable. It would instead require to play a sound that has a duration of say 3 ticks, in 4 ticks or even worse 3.12324 ticks duration in 4 ticks.

I don't know if it is possible or even desirable to be able to play a sound in "slow-mo"/"accelerated", by giving the speaker the duration in number of ticks and specify if it should not cut the sound, but play it faster/slower to make it match the given duration.

That would be a very niche case for decay editing as the interval of 1/60th is too long to do fine editing at this scale, but it opens up the possibility for sampling. You can have a vocal of 3.2 seconds, or 367 ticks (lots of existing mods with memes have those) and potentially wish to play it in a duration of exactly 180 ticks (3 second) or 360, but without removing the last word of the sentence from the vocal, just play it faster so it fit the music rythm and create music out of memes. It would make it sound higher pitch if sped up or lower pitch slowed dow if no adjustment is done automatically. Not sure if make sense in factorio to have such kind of effect. It's not a well established desire, just a thought from reading the discussion.

Cyclic Sound sound great :)

Illiander42
Filter Inserter
Filter Inserter
Posts: 514
Joined: Mon Feb 05, 2018 10:01 am
Contact:

Re: Programmable Speaker Improvements

Post by Illiander42 »

@mmmPI: There was a bit of discussion about why Factorio cannot do proper sound editing here.

mmmPI
Smart Inserter
Smart Inserter
Posts: 3147
Joined: Mon Jun 20, 2016 6:10 pm
Contact:

Re: Programmable Speaker Improvements

Post by mmmPI »

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 going to answer here but it turned into a lengthy post that would be mostly off topic for suggestion :), i'll reply on the other

Post Reply

Return to “Ideas and Suggestions”