i am working on improving the ImagePlayer; JavaFX provides this opportunity and would like to know what the Always-On instrument tab inside the Orchestra can do (for me).
What i am thinking of:
- divide ImagePlayer into 2 instruments: ImagePlayer and ImageSelector
Idea is that:
- ImageSelector can load several images
- a number or name is given to that image
- later in the composition the different imagenumbers or imagenames can be referenced to by ImagePlayer
Problem is that the ImagesSelector must be global but that i won't start the composition every time from the start. Could the Always-On instrument be a solution? What is the purpose of this Always-On Instrument?
In my case, i would prefer that the ImageSelector would load the image in memory AND process the red, green and blue pixels already. So that the pixel values are already available and the only thing ImagePlayer would have to do is produce sound using these values. This means, the ImageSelector should be a Global instrument for the pixel values to be available later in the composition. This does not work because Instrument 0 is not k-rate and thus cannot process the pixels.
But Instrument 0 won't allow k-rate.
Sorry for late reply! I think that always-on may not be only for
effects, but could also be used to create monophonic synths where the
main instrument code just influences key on/off and pitch or things
But I'm not sure this is what you need here. You might be able to use
the file selector with string channels enabled and create multiple
selectors in your instrument. At the beginning of your instrument
code, you could have it read the various string values and put them
into an array, then index into the array using p-field.
I'm not sure of any good option for pre-loading of image data though.
I suppose one thing that could happen is you have two instruments, one
that sets values and one that uses them. In the setter instrument, you
could have the image file selectors using string channels. In the
instrument code (in this case, could be an always on), have it read
the file name and check whether it is the same as the previous value
(stored in its own variables). If the value has changed, you could do
the image file loading then. That instrument would be running all the
time and most of the time wouldn't do too much as the values won't
change from the string channels. However, when the file does change,
it would process everything.
Still thinking on this issue of preloading soundfiles:
when i use for example the Xlooper and load it with soundfiles, i can see that every time a note in the Object is played, the same sound files are loaded in again and again on each note.
I have experimented the file loading from global to local, both with the same result:
Screenshot_from_2017-03-10_12-14-52.png Here you can just see at the very beginning on the left the first soundfiles being loaded in memory and halfway the second note forces the same soundfiles to be reloaded in memory as well.
Then, when the 2 notes are finished, the soundfiles are removed from memory.
I have tried using JMask with Xlooper, that produces dozens of notes; the memory is full in a matter of seconds and the system will start using the swap file - until it chokes and Blue stops working and disappears.
Why are not the soundfiles loaded into memory one time ( for example with a separate global instrument?) so that all the instruments that are pointing to those soundfiles (already in memory!) can contain hundreds of notes and just pointing to those soundfiles?