Wusik SP22 - Free & Open-Source Sample Recording Plugin/App
https://www.wusik.com/download/WIN_Wusik_SP22_BETA_00.zip
Source Code
Cheers, WilliamK
Wusik SP22 - Free & Open-Source Sample Recording Plugin/App
https://www.wusik.com/download/WIN_Wusik_SP22_BETA_00.zip
Source Code
Cheers, WilliamK
question on this:
static void stripSquare(juce::Image original, juce::Image destination[9], int height = 0, int offsetY = 0)
are you relying on the fact that juce::Image's internal object is reference-counted to get away with not passing that destination array by reference?
Also, itās just purely a style choice, but why not pass std::array<juce::Image, 9> instead? std::array<> is a cost-free wrapper around raw arraysā¦
Oh, thanks, did not know about that. Learning something new. 
Cheers, WilliamK
Always interesting to read other peoples code 
But I can never get over questions about how people format their code and look just at what it does. Iām reading this and thinking, āI wonder why William uses comment characters on every blank lineā, and not really taking in what itās actually doing at all!!
Maybe Iāve had too much coffee and not enough food though!

In C/C++ juce::Image destination[9] does not mean much else than ājuce::Image* destinationā. So he really is passing a pointer to the first image with a little hint, that there are nine images in total at this address.
Note, that the following compiles without warnings or errors:
void f(int a[6]){}
int main()
{
int a;
f(&a);
int b[2];
f(b);
int c[20];
f(c);
return 0;
}
crazy, eh ?
Edited: six => nine
Not crazy at all because there is no bounds checking in C/C++ and never was.
Thatās why I recommended that he use std::array<Image, 9>. if he does that, the type system will ensure he passes the correct object type.
I was answering your question:
Plain old c-arrays are not passed by value (like you presumably thought) - but are decaying into a pointer - There is no point in passing the array by reference.
@MBO: My point was, that IMHO itās a reasonable assumption, that the size of the array is part of the type - and thus the C++ type system would be kicking in when thereās an obvious mistake like this - but itās not. This is more about the C++ type system (compile time) than it is about bounds checking (runtime).
PS.: @WilliamkWusik: thanks for sharing!
PPS: I would probably have used a std::array as well - and passed it by reference.
ahh youāre right. my fault.
āvoid WusikPinkImage::stripSquare(juce::Image &,std::arrayjuce::Image,9,int,int)ā: cannot convert argument 2 from ājuce::Image [9]ā to āstd::arrayjuce::Image,9ā
While using juce juce::Image* works great.
Well, I guess I could just change the declaration of background.
Hummm, it no longer works now. As itās no longer a pointer to the output image. Bummerā¦
I always think that the simplest solutions are the best. I never used std::array as I try to keep all the code JUCE based. Is silly, but is just how my brain worksā¦
Some people also mentioned that I add // to every blank line, is severe OCD to be honest. Iām bipolar with some other problems, so coding is always a challenge. 
you want this:
static void stripSquare(juce::Image original,
std::array<juce::Image, 9>& destination,
int height = 0,
int offsetY = 0);
the Standard Library containers are used throughout JUCE. you should learn to use std::vector, std::array, std::map, etc⦠JUCE is even replacing a lot of their internal containers with the STL containers.
Ok, but they look ultra ugly to me. :-p Iām old⦠learning new stuff is hard sometimesā¦
Now itās working correctly. I did try with & before but was getting an error and was tired to look what it was. Turns out I forgot to put include in the editor definition.
static void stripSquare(Image& original, std::array<Image, 9>& destination, int height = 0, int offsetY = 0)
Now it works correctly. I will update the GitHub area right after this message.
Thanks again for showing me the way. I have my problems but I always try to learn things when possible. 
Cheers
Hereās the official page for Wusik SP22, the sampler plugin/app. Includes the new OSX version, the Windows version, Manual and Source-Code.
https://www.wusik.com/w/index.php/products/synth-samplers/wusik-sp22