On 08/22/2014 05:02 PM, Ian Sannar wrote:
> Ooh, a whole page for me! :D Thanks.
> Also, before I get started, a couple questions.
> "->" Operator?
For accessing members of an object pointed to by a pointer.
struct example { int a; char b; };
example e1; // local stack variable of type example
e1.a = 0;
e1.b = 1;
example * e2 = new example(); // pointer to a dynamically allocated
variable of type example
e2->a = 0;
e2->b = 1;
This is what I was talking about with differences in C#/C++... There's
no pointers in C# (well there are, sort of, but they're pretty horribly
implemented). C# does all the memory management, garbage collection and
stuff automatically. Whereas in C++, you have to manage memory by
yourself, manually, and make sure you clean up after yourself - if you
allocate something, you have to also deallocate it. C++ doesn't hold
your hand very much...
> The format for a wave is just a float[] right?
Nope... audio buffers use sampleFrame * - a pointer to an array of
sampleFrames. A sampleFrame is just a float[2], one float each for left
& right channels.
If you want to write a mono oscillator that doesn't directly output
audio, you can of course use a simple array of floats instead. The final
output however has to be written to the sampleFrame* buffer provided by
the rendering method.
> In what method do I set the wavetable?
Preferably in the constructor of the instrument.
------------------------------------------------------------------------------
Slashdot TV.
Video for Nerds. Stuff that matters.
http://tv.slashdot.org/
_______________________________________________
LMMS-devel mailing list
[email protected]
https://lists.sourceforge.net/lists/listinfo/lmms-devel