reaching some limits question
think oli faced maybe similar case but i couldn't find back the thread.
ive made kinda wavtable oscillator class .h .cpp
if i declare a float array to contain the wavtable in the .h like:
float wavtable[4096]; // no problem, that works
but if i ty to make it bigger
float wavtable[524288]; //256 tables of 2048 samples.
then i got errors on init and it get weird in paint and stuff
for debuging i don't call/use the array anywere, just creating few oscillators.
any ideas?
ive made kinda wavtable oscillator class .h .cpp
if i declare a float array to contain the wavtable in the .h like:
float wavtable[4096]; // no problem, that works
but if i ty to make it bigger
float wavtable[524288]; //256 tables of 2048 samples.
then i got errors on init and it get weird in paint and stuff
for debuging i don't call/use the array anywere, just creating few oscillators.
any ideas?
Hi !
As for the wavetable module, I used the sdk audiofile thingo :
in .h :
AudioFilePtr wavetable;
in .cpp :
void WTsynth::onInitModule(MasterInfo* pMasterInfo, ModuleInfo* pModuleInfo)
{
wavetable = sdkCreateAudioFile();
}
and in callback :
sdkLoadInMemoryAudioFile(wavetable, sdkGetEvtPChar(fileName));
As for the wavetable module, I used the sdk audiofile thingo :
in .h :
AudioFilePtr wavetable;
in .cpp :
void WTsynth::onInitModule(MasterInfo* pMasterInfo, ModuleInfo* pModuleInfo)
{
wavetable = sdkCreateAudioFile();
}
and in callback :
sdkLoadInMemoryAudioFile(wavetable, sdkGetEvtPChar(fileName));
http://oli-lab.org
Win11 Ryzen9/32GB RAM - RME MADIFACE - SSL alpha link 4-16 - OSC capable interfaces
follow OLI_LAB adventures on Mastodon
@olivar_premier@mastodon.social
Win11 Ryzen9/32GB RAM - RME MADIFACE - SSL alpha link 4-16 - OSC capable interfaces
follow OLI_LAB adventures on Mastodon
@olivar_premier@mastodon.social
for live sampler and affiliate :
in .h :
TPrecision* m_buffer; // Samples buffer
in .cpp :
// constructor
hydrogen::hydrogen()
{
//Initialize values
m_size = (lineSize+2) * 48000; //longueur fixe pour l'instant
//m_read[AUDIO_INS_OUTS_MAX] = 0;
//Ensure that initial sample values at buffer are 0.0f
m_buffer = new float[m_size];
for (int i = 0; i<m_size; i++)
{
m_buffer = 0.0f;
}
m_size = m_size - 2 * 48000;
m_write = m_size - 1;
}
// destructor
hydrogen::~hydrogen()
{
delete[] m_buffer;
}
then you fill this buffer as you wish !
in .h :
TPrecision* m_buffer; // Samples buffer
in .cpp :
// constructor
hydrogen::hydrogen()
{
//Initialize values
m_size = (lineSize+2) * 48000; //longueur fixe pour l'instant
//m_read[AUDIO_INS_OUTS_MAX] = 0;
//Ensure that initial sample values at buffer are 0.0f
m_buffer = new float[m_size];
for (int i = 0; i<m_size; i++)
{
m_buffer = 0.0f;
}
m_size = m_size - 2 * 48000;
m_write = m_size - 1;
}
// destructor
hydrogen::~hydrogen()
{
delete[] m_buffer;
}
then you fill this buffer as you wish !
http://oli-lab.org
Win11 Ryzen9/32GB RAM - RME MADIFACE - SSL alpha link 4-16 - OSC capable interfaces
follow OLI_LAB adventures on Mastodon
@olivar_premier@mastodon.social
Win11 Ryzen9/32GB RAM - RME MADIFACE - SSL alpha link 4-16 - OSC capable interfaces
follow OLI_LAB adventures on Mastodon
@olivar_premier@mastodon.social
is it waveterrain oscillator you're making ?
I did wavetable oscillator, I can send you the code if you want.
I did wavetable oscillator, I can send you the code if you want.
http://oli-lab.org
Win11 Ryzen9/32GB RAM - RME MADIFACE - SSL alpha link 4-16 - OSC capable interfaces
follow OLI_LAB adventures on Mastodon
@olivar_premier@mastodon.social
Win11 Ryzen9/32GB RAM - RME MADIFACE - SSL alpha link 4-16 - OSC capable interfaces
follow OLI_LAB adventures on Mastodon
@olivar_premier@mastodon.social
mm don't know wavterrain, not sure,
basically it's a 'simple' wavtable reader that read like 256 tables of 2048 samples, made a basic linear interpolation for now between current read table and next one samples, the oscillator itself is working ok , its just a bit strange that i can't create big arrays in 'external' files wich bugs me, like if there was a meory leak or something bit like your 'cannot be computed in a block issue' or something i don't understand yet..
but i made a different system tonight as workaround where i declare the big arrays in my main module file and pass the pointer, and that work ok that way.. so i don't really know why lol.
basically it's a 'simple' wavtable reader that read like 256 tables of 2048 samples, made a basic linear interpolation for now between current read table and next one samples, the oscillator itself is working ok , its just a bit strange that i can't create big arrays in 'external' files wich bugs me, like if there was a meory leak or something bit like your 'cannot be computed in a block issue' or something i don't understand yet..
but i made a different system tonight as workaround where i declare the big arrays in my main module file and pass the pointer, and that work ok that way.. so i don't really know why lol.
Interesting even tho I didn't get everything.
Curious about the workaround.
I did have trouble with the audiofile ask thing but my post disappeared after the hack attack on sensomusic server..
This sdkloadfile in memory works fine for small files but make the rack hanging if the loading takes longer than a block to load.
Should develop some sort of a trickling algorithm to load the file on more than one block so it leave time to other tasks to execute smoothly.
Curious about the workaround.
I did have trouble with the audiofile ask thing but my post disappeared after the hack attack on sensomusic server..
This sdkloadfile in memory works fine for small files but make the rack hanging if the loading takes longer than a block to load.
Should develop some sort of a trickling algorithm to load the file on more than one block so it leave time to other tasks to execute smoothly.
http://oli-lab.org
Win11 Ryzen9/32GB RAM - RME MADIFACE - SSL alpha link 4-16 - OSC capable interfaces
follow OLI_LAB adventures on Mastodon
@olivar_premier@mastodon.social
Win11 Ryzen9/32GB RAM - RME MADIFACE - SSL alpha link 4-16 - OSC capable interfaces
follow OLI_LAB adventures on Mastodon
@olivar_premier@mastodon.social
-
sm_jamieson
- Member
- Posts: 551
- Contact:
They way to do this would be to create a new thread (c++ std:thread class) that can do whatever it wants, then when loading it finishes, set a flag to say the file has loaded. You can find thread examples with Google.oli_lab wrote:Interesting even tho I didn't get everything.
Curious about the workaround.
I did have trouble with the audiofile ask thing but my post disappeared after the hack attack on sensomusic server..
This sdkloadfile in memory works fine for small files but make the rack hanging if the loading takes longer than a block to load.
Should develop some sort of a trickling algorithm to load the file on more than one block so it leave time to other tasks to execute smoothly.
Also, the Wiimote user module does stuff with threads (see code in SDK), but I think it uses Juce.
Note that you will need thread locking (windows critical section, mutex, etc) to protect access to data accessed by several threads. If not, you will get occasional strange errors.
have to try to wrap my head on threads too..
for now its working not bad
, lttle test vid:
https://drive.google.com/open?id=1LY8Df ... nDBihKylqJ
with warp:
https://drive.google.com/open?id=1jHjBC ... fr-EM8UfD3
for now its working not bad
https://drive.google.com/open?id=1LY8Df ... nDBihKylqJ
with warp:
https://drive.google.com/open?id=1jHjBC ... fr-EM8UfD3
Who is online
Users browsing this forum: No registered users and 4 guests
