On Sat, 31 May 2025 10:47:21 +0200
Kristian Amlie <krist...@amlie.name> wrote:

>On 30.05.2025 20:38, Will Godfrey wrote:
>> I'm thinking of protecting against losing changed but unsaved instruments 
>> with
>> the following:
>> 
>> Start with a zeroed 64bit integer with one bit per part (we can potentially
>> have all possible 64 filled. Call it (say) partStatus.
>> Every time there is a part-level write set the bit for that part.
>> On a part reset or save of an individual part either externally, or to a 
>> bank,
>> clear the part's bit.
>> On a master reset, patch set or state load clear all bits.
>> 
>> If partStatus is non zero when wanting to shut down, warn there are changed
>> instruments and which ones they are, giving the option of abandoning the
>> shutdown.
>> 
>> Any thoughts?  
>
>I think this is a good idea.

Thanks. I hasten to add I won't be attempting to get this in place for LAC!

>As for the implementation, I would recommend using a 64-length 
>`vector<bool>` instead. This gives the best of both worlds, because the 
>bool case is optimized to only use one bit per element, so it does 
>actually compile into an `int64_t` sized buffer, but from the outside it 
>looks like a normal container, so you don't have to tinker with 
>individual bits.
>

I wasn't aware of that, however we already have extensive bit testing, so it
would just be a matter of overloading the functions in Misc/NumericFuncs.h with
64bit versions.

-- 
Will J Godfrey {apparently now an 'elderly'}




_______________________________________________
Yoshimi-devel mailing list
Yoshimi-devel@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/yoshimi-devel

Reply via email to