How To

Optimize the usage of the four voices


SP4CEBAR 2022-01-23 21:47 (Edited)

My midi tools program can now schedule and play all midi tracks (instruments) at once. All these sounds are then channelled to just the 4 voices from NX. The program currently rotates the sounds around the voices, rotating basically means that each new sound is assigned to a new voice, and after the last voice it switches back to the first one. Despite that (essential) tracks still get interrupted by other tracks. I could mark some tracks as being more important than others, but then that would have to be done manually for each midi file.

So is there a way to simulate two voices with each voice? Or are there other ways to optimize the usage of these four voices?
BTW we have access to the frequency value (16-bit) of each of the four voices, also there are artifacts in sounds with high frequency values, the pulse width of a pulse wave sound may also come in handy.

SP4CEBAR 2022-01-23 22:46

Here are some useful subprograms

Voice Simulator.nx | Open in app
2022-01-23 22:46

Timo 2022-01-24 18:03

In theory any MIDI instrument has the same problem with limited voices, although the numbers are much higher of course.
The first step should always be to prioritize voices with already stopped notes.
Another thing is to use the voice with the oldest note, so you need to keep track of the time of the last note per voice.
But anyway, limit MIDI to 4 voices is really hard, not sure if these ideas work for it. It probably depends a lot on the type of music.

was8bit 2022-01-24 18:53

My only thought would be assign one voice for the melody voice, letting it play uninterupted...

Then all other voices rotate as you have mentioned, but make the duration of these notes stucatto like blips ..

Trumpet, violin, or flute, would be a good choice for melody line, as its voice would carry each note longer, all other rotated notes would reduce themselve to percussionary roles...

... i dont think there is a good quick fix... you will have to decide what limitations you want to accept...

SP4CEBAR 2022-01-24 23:12

Thanks for all the replies!
I think I'm going to use an array to make one virtual voice per track, and then I could have a function which looks at those virtual voices and picks out the most important ones, the less important tracks could be arpeggiated (stucatto) together.

... i dont think there is a good quick fix... you will have to decide what limitations you want to accept...
End quote
This is very true

was8bit 2022-01-24 23:29


SP4CEBAR 2022-01-26 18:34 (Edited)

What do you think about this system:
The track ID, pitch, velocity, and timer (NX time) of each sound are stored inside an array (virtual voices) and cleared when the sound stops
And then I can have a music player that will prioritize sounds with the lowest soundTime minus timer value (only the most recent ones)
That way you should be able to hear each note when it starts, and when the voices are not that full, you'll be able to hear more
And also long strings won't be as long (freeing op many precious voices)

nathanielbabiak 2022-01-27 03:38

Have you experimented with swapping memory just-in-time using the raster interrupt? You could update up to 7.68 kHz if it works. At one point, Timo commented on the audio systems update frequency, and I recall thinking it might be possible. I always wanted to try that as a way to provide additional fidelity...

SP4CEBAR 2022-01-27 10:04 (Edited)

That's really interesting, but I don't think I can produce 1-voice chords this way:
In VCV rack I tried high frequency pitch modulation, but that wouldn't produce a chord, so I don't think it's not a good idea for me to spend a lot of time trying to search for 1-voice chords when I'm likely unable to make that work

Timo 2022-01-27 10:29

The audio is updated only once per frame, so raster interrupts won't help.

nathanielbabiak 2022-01-28 00:26

SP4CEBAR, yeah, the timbre of cords is too complex for LowRes in a single voice.

Timo, you're right too. (And IIRC, you did mention that once before.)

Log in to reply.