This one's easy to sum up in a sentence:
Allow the instrument and volume of the programmable speaker to be set via the circuit network as well as the pitch.
Both would be great for making music with it.
Right now, if you want to be able to change instrument and volume, you need a rather large mess of speakers and combinators. For ten instruments and just four volume levels, that's 40 speakers, plus a heap of combinators to ensure only the desired speaker actually plays anything. It works, but it's very tedious to set up, even with blueprints, as there are a lot of unique values that need to be set.
On the other hand, a more-programmable speaker would just need you to set which signals to take for controlling what parameter.
Just as you can now toggle a checkbox to pick whether the speaker has its pitch controlled by a signal or uses a particular one set by the user from a drop-down menu, provide similar ones for instrument and volume.
With the instrument one clear, you'd get the drop-down menu you get now. With it checked a number from 1 to N would pick which entry from the menu gets used.
With the volume box clear, you'd get the current slider. With it checked, the speaker would take a value (probably 0-255, given that's pretty common) to use for the volume.
More-Programmable Speaker
Moderator: ickputzdirwech
Re: More-Programmable Speaker
I find that pretty, but it's not very pratical. Someone who knows midi, would think that the volume information is part of the notes and not somthing which is sent over a different channel. So it in my eyes quite is logical, that volume is just a new type of circuit signal.
Same with anything else...
Same with anything else...
Cool suggestion: Eatable MOUSE-pointers.
Have you used the Advanced Search today?
Need help, question? FAQ - Wiki - Forum help
I still like small signatures...
Have you used the Advanced Search today?
Need help, question? FAQ - Wiki - Forum help
I still like small signatures...
Re: More-Programmable Speaker
Locking the volume to the note? That's kind of already the case if you use the "mass of speakers and combinators" approach to selectable volume. I'm pretty sure MIDI isn't that restrictive, though. Not that I know much about the details of it, but I do listen to a fair few MIDI files, and I'm pretty sure I've heard a few with volume slides.ssilk wrote:Someone who knows midi, would think that the volume information is part of the notes and not somthing which is sent over a different channel.
That's exactly what I'm asking for. Being able to control the speaker by up to three signals, depending on what you want under software control.ssilk wrote:So it in my eyes quite is logical, that volume is just a new type of circuit signal.
In the maximal case, one signal for note, one for instrument, and one for volume.
In the minimal case, a single signal for play/don't play, with note, instrument and volume set manually by the player, so it always plays the same note on the same instrument at the same volume every time it's triggered (which you'd probably use for something like an alarm).
Ideally, changing the volume would be possible while a note is playing, which would allow you to implement volume-slides by sending a sequence of increasing or decreasing values on the volume signal. This isn't possible with the "mass of speakers and combinators" approach to selectable volume. That only allows you to set the volume when you start playing a note, not while it's playing.
Re: More-Programmable Speaker
To make it 100% clear: We meant, that there is a standardized new signal type, that is interpreted by the speaker as "velocity" signal (which is part of midi standard for each note, so there could be in some future a converter from midi to Factorio signals).Roxor128 wrote:That's exactly what I'm asking for. Being able to control the speaker by up to three signals, depending on what you want under software control.
Also a new signal type "Instrument", which (when set) switches the instrument type.
And there could be a lot more signals. Midi standard for example knows "press" and "release" of a note.
And the general target should in my opinion be this:
As source there is some midi-file, which can be seen as a description of "ordered events". And as output in Factorio there is a device, that can translate such a midi-file into circuit network and route the events based on rules to different circuit signals.
And for what to use something like that? For example Factory streets. When order of doing matters. When we need to repeat (loop). And thousand other things.
Cool suggestion: Eatable MOUSE-pointers.
Have you used the Advanced Search today?
Need help, question? FAQ - Wiki - Forum help
I still like small signatures...
Have you used the Advanced Search today?
Need help, question? FAQ - Wiki - Forum help
I still like small signatures...
Re: More-Programmable Speaker
Sorry, ssilk, you've completely lost me. I have no idea what you're trying to describe now.ssilk wrote:To make it 100% clear: We meant, that there is a standardized new signal type, that is interpreted by the speaker as "velocity" signal (which is part of midi standard for each note, so there could be in some future a converter from midi to Factorio signals).Roxor128 wrote:That's exactly what I'm asking for. Being able to control the speaker by up to three signals, depending on what you want under software control.
Also a new signal type "Instrument", which (when set) switches the instrument type.
And there could be a lot more signals. Midi standard for example knows "press" and "release" of a note.
And the general target should in my opinion be this:
As source there is some midi-file, which can be seen as a description of "ordered events". And as output in Factorio there is a device, that can translate such a midi-file into circuit network and route the events based on rules to different circuit signals.
And for what to use something like that? For example Factory streets. When order of doing matters. When we need to repeat (loop). And thousand other things.
Re: More-Programmable Speaker
I mean this:
The combinator makes a translation from the midi file to signals in the "rhythm" of Factorio ticks.
When in the midi file a key is pressed, the combinator translates that to two signals: One is the tone height, the other the velocity of that tone.
When the key is relesed, the signals are also released.
Code: Select all
MIDI File => Combinator => Signals on wire
When in the midi file a key is pressed, the combinator translates that to two signals: One is the tone height, the other the velocity of that tone.
When the key is relesed, the signals are also released.
Cool suggestion: Eatable MOUSE-pointers.
Have you used the Advanced Search today?
Need help, question? FAQ - Wiki - Forum help
I still like small signatures...
Have you used the Advanced Search today?
Need help, question? FAQ - Wiki - Forum help
I still like small signatures...
Re: More-Programmable Speaker
I don't know what you mean by either of these terms. I could try and ask how they correspond to MOD pattern data, but I'm afraid that might just result in more cases of us not knowing what the other is talking about.ssilk wrote:One is the tone height, the other the velocity of that tone.
As a common reference point, let's break things down to as simple a synthesiser as I can come up with that could still be useful. I'm writing this on the spot right now, so it's untested and probably buggy (C++, though if I got it right it'll probably compile as C if you change the comment syntax).
Code: Select all
// freq: frequency in Hz
// vol: volume 0-1
// waveform: 0=square, 1=sawtooth, 2=triangle
// t: current time in seconds from start of playback session
float generate_sample(float freq, float vol, int waveform, float t)
{
float retval=0;
float tf = frac(t/freq); // get position through a wave
switch (waveform)
{
case 0:
(tf > 0.5) ? retval=1 : retval=-1;
break;
case 1:
retval = (tf-0.5)*2;
break;
case 2:
retval = ( (tf<0.25) ? tf*4 : ( (tf>0.75) ? ((tf-0.75)*4)-1 : (1-(tf-0.25)*2)*2 ) );
break;
default:
retval=0;
}
return retval*vol;
}
If you want a second worth of a 440Hz sawtooth wave at 50% volume at a 96kHz sample-rate, you'd use it like this:
Code: Select all
int len=96000;
float buffer[len];
int rate=96000;
float time=0;
float dt=1.0/rate;
for(int cnt=0; cnt<len; cnt++)
{
buffer[cnt]=generate_sample(440,0.5,1,time);
time+=dt;
}
-
- Burner Inserter
- Posts: 7
- Joined: Wed Jul 20, 2016 7:41 am
- Contact:
Speaker volume controlled by signals.
Please add to the speaker the ability to change its volume using signals, as is done for the “tone”.
Simple request, simple topic.) Thank
Simple request, simple topic.) Thank
Re: More-Programmable Speaker
[Koub] Merged into older thread with encompassing suggestion
Koub - Please consider English is not my native language.