Strings instrument for programmable speakers


Add two instruments to the programmable speaker, one that sound like a violin ensemble playing short notes, and another one sounding more like orchestral string section playing longer notes, both with a range of up to 96 notes for expressive music or alerts

Content
4 months ago
2.0
77
Circuit network Cheats

i Full Range Piano

3 months ago

Hey Preceti2, I just happened to be playing around with the speakers the past couple days, and have really ran into a headache with not having enough notes. Seems you've found the solution to that with your past few mods!

For a future mod, could you add a full 88 key piano?

3 months ago

Sure thing ! Will try this week to make a piano(s) mod !
Albeit it may be a 96 key piano, to make it easy to swap with the other instruments and start with the same notes as the ones in game, so the value in the circuit are the same for the notes too ( and MIDItorio ).
For the pianos the difficult part is choosing which one and not 'finding them' x) , there are so many ! if you have a suggestion or some informations i could learn from? because there are jazzy, classic, with the pedal, without the pedal and "grand piano" or other type of pianos that i don't know nothing about just the name in the synthetizers or plugins.
I would just add those i prefer otherwise but i'm curious what music genre are you trying to make ? or what kind of noise ? what type pianos would that be ? i'd learn something :)

3 months ago

I don't think I'd complain about extra notes, haha.

As for type, I'd be first interested in kind of a classic / grand piano. I don't know what the limitations of the game are with respect to duration of a note, but adding a separate instrument as "96 or however many key piano with pedals" on top of the standard piano would allow you to mimic whole notes which is otherwise impossible. I had been trying to put in Fur Elise as my stepping stone from Twinkle Twinkle with the base game tools, and yea. I just didn't have enough notes.

Past that, it's up to you and what you can find samples of. I'm very new to this stuff - do you mind sharing what are you using to generate your instrument samples?

3 months ago

The limits are not really about the duration of a single note, it is also possible to add instead of single notes some voice sample, or a conversation, or even a full song as those can last several minutes.

The limitation are the number of sound that a single speaker can play, if you use "polyphony", then a single pulse sent to a speaker can trigger a sample to be played, the next pulse, a second one, from the same speaker, the 3rd one and so on, but if the notes are too long, the first one is still playing and maybe the 8th or 9th will not trigger a new note because the speaker is busy playing different notes already, i'm not sure exactly how many.

The other limitation is the number of sound the game can play, if you use 4324234835 speaker, it will not work, some of them won't be allowed to play. The number is much lower, but i don't know it precisely, it's "audible" when you have maybe 200 or 300 speakers that would each be playing 10 notes ? then some of them just don't play.

Hopefully that gives indication on the difference in usage between "with" and "without" pedal for the piano, the longer sample cause 1 speaker to be allowed to play a "new note" less often, or a player need more speakers to play the same melody.

For the sample of sounds there is something like this : https://github.com/IAmTomaton/musical-speaker-fixed/releases/tag/v1.0.3 which contain a lot of instruments, the whole MIDI family that was part of this mod that has not been updated : https://mods.factorio.com/mod/musical-speaker-fixed there are several pianos !

But for the instrument already published and the future piano i plan to use "FL studio" and then inside synthetizer like Serum or Sytrus or VST plugins. There exist open source or "free" alternative to "FL studio", it just needs to be able to play the notes from a MIDI file ideally. I have made one such MIDI pianoroll setup already where it plays all the notes of the keyboard 1 by 1, and i just have to change the instrument , or the EQ, add filters ( with or without pedal) , adapt mastering and BPM, it creates a .mp3 file that is a few minutes long of a very boring song.

This i import in audacity, where i'm using something like a subtitle template with already all the labels of the notes , adjust the BPM to the same as in FL studio so they fit perfectly with the mp3 if the samples are longer or shorter. There's a few steps here and there to make sure the notes are tuned properly and the label actually match the notes, like looking with the spectrogram in audacity to spot mistakes and plugins in FL studio to detect the pitch of the samples shows when there are 96 notes some are not properly tuned like at the very end of the keyboard .They are not really sound that can be used for music, they just help the structure of the instrument identical. This help to export in .ogg every file in a row with proper naming scheme to put them in a mod easily.

I guess i'll make a few pictures to describe the process, i'm learning how to do those, I'm not too sure i'm doing it right , i'm very new to attempting to make music x)

3 months ago

I have noticed the limitations on notes for the speakers. Without polyphony, you have to wait like, 14 ticks to play a new note on a given speaker. with polyphony, it seems like it plays a new note each tick, but yea, a given speaker can only have 10 notes active at a time I guess. As a very robust workaround, I built a system where it will only use a given speaker every so many ticks with the modulus function. So I had 4 speakers for a given channel playing every 4 ticks in sequential order. You'd need some really whacky music to get that to be necessary though, something like 32nd notes at greater than 500 bpm to have to play something every tick. Worst comes to worse, you could just add more speakers and increase the size of the round robin if we end up hitting the cap on active sounds from a given speakers.

As for where you're getting the samples, gotcha. I like that the base game piano sounds kinda like a normal piano. I'm personally not as much of a fan of the 8 bit / midi style as much. I can certainly appreciate the option, but ideally I'd have a higher fidelity instrument kit to work with. It'd be pretty sick to eventually have a full orchestra, i.e. tuba, trumpet, the different saxophones, flutes, you name it.

3 months ago

I have noticed the limitations on notes for the speakers. Without polyphony, you have to wait like, 14 ticks to play a new note on a given speaker. with polyphony, it seems like it plays a new note each tick, but yea, a given speaker can only have 10 notes active at a time I guess.

That's it ! the 14 ticks must be the game's original piano sample's duration. They are not the same for all the instruments in vanilla, and not necessarily a multiple of 1/60 second of time whereas those i made i try to make them precisely 60 or 240 ticks, which is longer and makes this phenomenon more severe but also "easier to predict" hopefully. I don't know for "10" active at a time, that seem the order of magnitude i felt intuitively.

As a very robust workaround, I built a system where it will only use a given speaker every so many ticks with the modulus function. So I had 4 speakers for a given channel playing every 4 ticks in sequential order. You'd need some really whacky music to get that to be necessary though, something like 32nd notes at greater than 500 bpm to have to play something every tick. Worst comes to worse, you could just add more speakers and increase the size of the round robin if we end up hitting the cap on active sounds from a given speakers.

Nice ! If you want i can show one in a demo video for a mod :)

As for where you're getting the samples, gotcha. I like that the base game piano sounds kinda like a normal piano. I'm personally not as much of a fan of the 8 bit / midi style as much. I can certainly appreciate the option, but ideally I'd have a higher fidelity instrument kit to work with. It'd be pretty sick to eventually have a full orchestra, i.e. tuba, trumpet, the different saxophones, flutes, you name it.

Here it is : https://mods.factorio.com/mod/PMI-Pianos
It's an early version, based on recorded sample, not on synthetizer, so it should sound like a "okayish fidelity" piano, but there are more notes than original sample, some of them are extrapolated, and when playing all the notes in a row it can be heard sometimes when the sample from which the notes are extrapolated changes, i thought it gave a "humanized" sound, but that may be problematic, not sure yet.

Trumpet is available in the "brass" mod https://mods.factorio.com/mod/PMI-Brass, the samples sound quite different in game than in the video without polyphony nor played that fast, more "realistic" for Tuba, the "brass" mode has a "brass ensemble" that may work as orchestra

Saxophone is on my list ! And Flute is interestingly quite difficult to find ! I had tried both already, Saxophone i have a more satisfying result, but those instruments are not "96 notes" instruments from what i can tell, there's a sax tenor or sax alto, that's a different instrument so im not sure it make sense to try and record 96 notes of sax tenor, and 96 of sax alto, or rather, 96 notes of "saxophone" and some are played by sax "tenor" and others "alto". If you have any idea there ? This doesn't apply when sound are created by synthethizer, it just create weird noises at the extreme.

New response