ArrayArrayArrayArrayArrayArrayArrayArrayArrayArrayArrayArrayArrayArrayArrayArrayArrayArrayArrayArrayArrayArrayArrayArrayArray BrainModular BrainModular Users Forum 2026-01-18T23:11:38+02:00 https://brainmodular.com/forums/app.php/feed/forum/7 2026-01-18T23:11:38+02:00 2026-01-18T23:11:38+02:00 https://brainmodular.com/forums/viewtopic.php?t=7358&p=46198#p46198 <![CDATA[Module development SDK • Re: Audiofile]]> I had a go with the audiofile command las few days.
I managed to load wav files, but can't save any

here is the part of the code that's not working : (it's included in a function that is called at callback)

CODE:

for (int i = 0; i < m_size; ++i) {sdkSetSampleAudioFile(audioFile, 1,i, m_buffer[i]);}sdkSetChannelsAudioFile(audioFile, 1);sdkSetSizeAudioFile(audioFile, m_size);sdkSaveToDiskAudioFile(audioFile, tempChar, 1);}
/////////////////////////////
if I run it, it will return errors :
[2] Error :
[HydroGen OP V5] CallBack, paramIndex=19

///////////////////////////////////////
tried with

sdkSetChannelsAudioFile(audioFile, 1);
sdkSetSizeAudioFile(audioFile, m_size);
before
for (int i = 0; i < m_size; ++i) {
sdkSetSampleAudioFile(audioFile, 1,i, m_buffer);

same thing
/////////////////////////////////////////

if I comment it and run only SetChannelsAudioFile and SetSizeAudioFile :

[6] Error :
bad pointer in SetChannelsAudioFile
[8] Error :
bad pointer in SetSizeAudioFile

//////////////////

with only: sdkSetSampleAudioFile(audioFile, 1,i, m_buffer);

[2] Error :
[HydroGen OP V5] CallBack, paramIndex=19


/////////////////////////////////////
with only: sdkSaveToDiskAudioFile(audioFile, tempChar, 1);

SDK_SaveToDiskAudioFile :
[0] Error :
PROC:SaveToDiskAudioFile
ERROR:Access violation at address 000000000136CDDE in module 'Usine.exe'. Read of address
0000000000001190

if anyone has a working example using sdkSaveToDiskAudioFile, could you please show it to me !

thanx

Olivar

Statistics: Posted by oli_lab — 18 Jan 2026, 22:11


]]>
2025-06-17T14:28:01+02:00 2025-06-17T14:28:01+02:00 https://brainmodular.com/forums/viewtopic.php?t=7375&p=45918#p45918 <![CDATA[Module development SDK • ppq]]> is there a way to get the ppq value with the sdk ?

thanx

Olivar

Statistics: Posted by oli_lab — 17 Jun 2025, 14:28


]]>
2025-06-11T22:12:58+02:00 2025-06-11T22:12:58+02:00 https://brainmodular.com/forums/viewtopic.php?t=7369&p=45912#p45912 <![CDATA[Module development SDK • Re: HH6 SDK Mouse Up Multi event bug]]> The latest sdk is missing some TShiftState values. The full list is below. The way to ignore the new events is to ignore anything where the shift state is ssTouch or higher.
List supplied by Senso. Note these are Delphi values not Windows values.

/// Possible value for a TShiftState variable.
/// @see onMouseMove, onMouseDown, onMouseUp, onMouseMoveMulti, onMouseDownMulti, onMouseUpMulti
static constexpr UINT32 ssShift = 0x1; ///< Shift keyboard state
static constexpr UINT32 ssAlt = 0x2; ///< Alt keyboard state
static constexpr UINT32 ssCtrl = 0x4; ///< Ctrl keyboard state
static constexpr UINT32 ssLeft = 0x8; ///< Left mouse button state
static constexpr UINT32 ssRight = 0x10; ///< Right mouse button state
static constexpr UINT32 ssMiddle = 0x20; ///< Middle mouse button state
static constexpr UINT32 ssDouble = 0x40; ///< Mouse Double click state
static constexpr UINT32 ssTouch = 0x80; ///< Mouse touch screen click state
static constexpr UINT32 ssPen = 0x100; ///< Mouse pen click state
static constexpr UINT32 ssCommand = 0x200; ///< Mouse Command state
static constexpr UINT32 ssHorizontal = 0x400; ///< Mouse Horizontal state

Statistics: Posted by sm_jamieson — 11 Jun 2025, 22:12


]]>
2025-06-07T19:21:38+02:00 2025-06-07T19:21:38+02:00 https://brainmodular.com/forums/viewtopic.php?t=7369&p=45897#p45897 <![CDATA[Module development SDK • Re: HH6 SDK Mouse Up Multi event bug]]>
The extra mousedown is from the Windows right click generated on a long touch action.
The shiftstate and mousebutton show that. I think that the long touch right click is generated by Windows when the touch is removed, which is why it always comes at the end.

Simon.

Statistics: Posted by sm_jamieson — 07 Jun 2025, 19:21


]]>
2025-06-02T22:17:22+02:00 2025-06-02T22:17:22+02:00 https://brainmodular.com/forums/viewtopic.php?t=7369&p=45889#p45889 <![CDATA[Module development SDK • HH6 SDK Mouse Up Multi event bug]]>
When a touchpoint is removed an extra mouse down is being sent.
The following is trace from touching and lifting a single finger.

[34] simonj DOWN multi 0: x=0.344595, y=0.734637, pressed=1.000000, mask=91
[36] simonj ++++ MOUSE UP on touchpoint 0
[38] simonj UP multi 0: x=1.000000, y=1.000000, pressed=0.000000, mask=90
[40] simonj DOWN multi 0: x=0.344595, y=0.740223, pressed=1.000000, mask=91

The mask is my own indication of mouse down or up for a number of touchpoints - here only 1 touchpoint exists.

It might be usual have a mouse UP multi with x and y = 1 - I'm not sure but in practice the position of an UP event does not matter.
However, an extra DOWN event is being produced.
This does not happen with the mouse - only with touch.

I have a touch keyboard in my SDK user module and this is causing another keypress !

This does not happen with the same module in HH5.
For comparison, this is what I see in HH5:

[426] simonj DOWN multi 0: x=0.680180, y=0.396648, pressed=1.000000, mask=910
[428] simonj ++++ MOUSE UP on touchpoint 0
[430] simonj UP multi 0: x=1.000000, y=0.726257, pressed=0.000000, mask=900
The interesting thing here is the x and y values are nonsense.

It seems to me that if the HH6 faulty DOWN values were used in the UP and the DOWN was removed, everything would be perfect.

Before I raise a ticket - has anyone else seen this ?

Simon.

Statistics: Posted by sm_jamieson — 02 Jun 2025, 22:17


]]>
2025-05-20T14:55:17+02:00 2025-05-20T14:55:17+02:00 https://brainmodular.com/forums/viewtopic.php?t=7358&p=45845#p45845 <![CDATA[Module development SDK • Re: Audiofile]]>
wish me luck

Olivar

Statistics: Posted by oli_lab — 20 May 2025, 14:55


]]>
2025-05-12T00:52:50+02:00 2025-05-12T00:52:50+02:00 https://brainmodular.com/forums/viewtopic.php?t=7360&p=45839#p45839 <![CDATA[Module development SDK • OFF caption]]> Is it possible to set the OFF caption of a switch with the SDK ?

there a pParamInfo->Caption to set the ON caption, but nothing for the OFF caption

Thanks

Olivar

Statistics: Posted by oli_lab — 12 May 2025, 00:52


]]>
2025-05-05T19:33:42+02:00 2025-05-05T19:33:42+02:00 https://brainmodular.com/forums/viewtopic.php?t=7358&p=45825#p45825 <![CDATA[Module development SDK • Audiofile]]> I'm trying to use the "audiofile" class in the SDK to make a multitrack file but I get some errors :
My idea is to have a multitrack wave file that I can save (or load) and populate it with samples
But I think I get something wrong.
If I want to have a recorder like the "audios ampler recorder" module, do I have to save the samples in a buffer (RAM) and then use the audiofile to save the wave file to disk ?
I'm a bit lost in here.

in .h

TAudioFilePtr audiofile1;

in .cpp

// constructor
multitrackrecorder::multitrackrecorder()

{
audiofile1 = sdkCreateAudioFile();
}

....

//-----------------------------------------------------------------------------
// initialisation
void multitrackrecorder::onInitModule (TMasterInfo* pMasterInfo, TModuleInfo* pModuleInfo)
{
sdkSetChannelsAudioFile(audiofile1, numOfAudiotInsOuts);
sdkSetSizeAudioFile(audiofile1, 60 * sdkGetSampleRate());

}

When loaded in Usine, I get those error messages :
[4] Error :
bad pointer in SetChannelsAudioFile
[6] Error :
bad pointer in SetSizeAudioFile

any idea ?
thanks

Statistics: Posted by oli_lab — 05 May 2025, 19:33


]]>
2024-11-07T09:26:14+02:00 2024-11-07T09:26:14+02:00 https://brainmodular.com/forums/viewtopic.php?t=7291&p=45559#p45559 <![CDATA[Module development SDK • Re: default value fo array input]]> Statistics: Posted by senso — 07 Nov 2024, 08:26


]]>
2024-10-27T19:58:29+02:00 2024-10-27T19:58:29+02:00 https://brainmodular.com/forums/viewtopic.php?t=7291&p=45538#p45538 <![CDATA[Module development SDK • default value fo array input]]> Is there a trick to have default values for array input in case it is not connected, and setting the values to an array display in case it is drown from the array input ?

Thanx

Statistics: Posted by oli_lab — 27 Oct 2024, 18:58


]]>
2024-02-01T10:56:13+02:00 2024-02-01T10:56:13+02:00 https://brainmodular.com/forums/viewtopic.php?t=7097&p=45234#p45234 <![CDATA[Module development SDK • Re: Usine Objects in SDK]]> Statistics: Posted by sm_jamieson — 01 Feb 2024, 09:56


]]>
2024-01-15T11:40:58+02:00 2024-01-15T11:40:58+02:00 https://brainmodular.com/forums/viewtopic.php?t=7097&p=45194#p45194 <![CDATA[Module development SDK • Re: Usine Objects in SDK]]>

CODE:

//----------------------------------------------------------------------------/// @name Usine Objects functions /// @{/// Set the float value of an Usine-Objectinline void sdkUsineObjectSetFloat(AnsiCharPtr name, TPrecision floatValue) { m_masterInfo->UsineObjectSetFloat(m_moduleInfo, name, floatValue); };/// Set the integer value of an Usine-Objectinline void sdkUsineObjectSetInteger (AnsiCharPtr name, int integerValue) { m_masterInfo->UsineObjectSetInteger(m_moduleInfo, name, integerValue); };/// Set the float value of an Usine-Object array at the index positioninline void sdkUsineObjectSetArray(AnsiCharPtr name, int index, TPrecision floatValue) { m_masterInfo->UsineObjectSetArray(m_moduleInfo, name, index, floatValue); };/// Set the Midi value of an Usine-Object array at the index positioninline void sdkUsineObjectSetMIDI (AnsiCharPtr name, int index, TUsineMidiCode midiValue) { m_masterInfo->UsineObjectSetMIDI(m_moduleInfo, name, index, midiValue); };/// Set the color value of an Usine-Object inline void sdkUsineObjectSetColor (AnsiCharPtr name, TUsineColor colorValue) {m_masterInfo->UsineObjectSetColor(m_moduleInfo, name, colorValue); };/// Set the color value of an Usine-Object array at the index positioninline void sdkUsineObjectSetArrayColor (AnsiCharPtr name, int index, TUsineColor colorValue) {m_masterInfo->UsineObjectSetArrayColor(m_moduleInfo, name, index, colorValue); };/// Set a trigger value of an Usine-Objectinline void sdkUsineObjectSetTrigger (AnsiCharPtr name) { m_masterInfo->UsineObjectSetTrigger(m_moduleInfo, name); };/// Set the text value of an Usine-Objectinline void sdkUsineObjectSetAnsiChar(AnsiCharPtr name, AnsiCharPtr v) {m_masterInfo->UsineObjectSetAnsiChar(m_moduleInfo, name, v); };/// Get the float value of an Usine-Objectinline TPrecision sdkUsineObjectGetFloat (AnsiCharPtr name) { return m_masterInfo->UsineObjectGetFloat(m_moduleInfo, name);};/// Get the integer value of an Usine-Object inline int  sdkUsineObjectGetInteger(AnsiCharPtr name) { return m_masterInfo->UsineObjectGetInteger(m_moduleInfo, name); };/// Get the float value of an Usine-Object array at the index positioninline TPrecision sdkUsineObjectGetArray(AnsiCharPtr name, int index) {return m_masterInfo->UsineObjectGetArray(m_moduleInfo, name, index); };/// Get the Midi value of an Usine-Object array at the index positioninline TUsineMidiCode sdkUsineObjectGetMIDI(AnsiCharPtr name, int index) { return m_masterInfo->UsineObjectGetMIDI(m_moduleInfo, name, index); };/// Get the color value of an Usine-Objectinline TUsineColor sdkUsineObjectGetColor(AnsiCharPtr name) {return m_masterInfo->UsineObjectGetColor(m_moduleInfo, name); };/// Get the array value of an Usine-Object array at the index positioninline TUsineColor sdkUsineObjectGetArrayColor(AnsiCharPtr name, int index) {return m_masterInfo->UsineObjectGetArrayColor(m_moduleInfo, name, index);};/// Get the text value of an Usine-Objectinline AnsiCharPtr sdkUsineObjectGetAnsiChar(AnsiCharPtr name) {return m_masterInfo->UsineObjectGetAnsiChar(m_moduleInfo, name); };/// Get the size of the Event associated to an Usine-Objectinline int sdkUsineObjectGetLength(AnsiCharPtr name) {return m_masterInfo->UsineObjectGetLength(m_moduleInfo, name); };/// Set the size of the Event associated to an Usine-Objectinline void        sdkUsineObjectSetLength(AnsiCharPtr name, int l) { m_masterInfo->UsineObjectSetLength(m_moduleInfo, name, l); };/// Returns the list (as a comma-text) of all Usine-Objects that match with the name parameterinline AnsiCharPtr sdkUsineObjectFind(AnsiCharPtr name) {return m_masterInfo->UsineObjectFind(m_moduleInfo, name); };/// Returns TRUE if the Usine-Objects existsinline LongBool sdkUsineObjectExists   (AnsiCharPtr name) { return m_masterInfo->UsineObjectExists(m_moduleInfo, name); };/// Returns the Hash of allUsine-Objects. This allows to determines if the list of all the Usine-Objects has changed.inline AnsiCharPtr sdkUsineObjectListHash() {return m_masterInfo->UsineObjectListHash(m_moduleInfo);};/// @}

Statistics: Posted by senso — 15 Jan 2024, 10:40


]]>
2024-01-15T11:36:24+02:00 2024-01-15T11:36:24+02:00 https://brainmodular.com/forums/viewtopic.php?t=7210&p=45193#p45193 <![CDATA[Module development SDK • Re: Paint Image/Frame]]> It could take an array on ARGB (or RGBA on macOS?) pixels and just blit it into the canvas?

Statistics: Posted by senso — 15 Jan 2024, 10:36


]]>
2024-01-11T15:17:16+02:00 2024-01-11T15:17:16+02:00 https://brainmodular.com/forums/viewtopic.php?t=7210&p=45184#p45184 <![CDATA[Module development SDK • Re: Paint Image/Frame]]> i spend shittons of time optimizing such things in juce i might be biased.. always cache paths/buffers ect
still think some basic still frames manipulation kit could be nice, like load an image, jpg/png to usine frame format,
ideally save some buffer to them, beeing able to simply repaint a stored frame in paint proc even on 'normal' modules would be nice.
maybe just some strecth to fit rect transorm that would be more efficient than looping thru each pixels. atm i don't think man can really paint an image unless im mistaken

Statistics: Posted by 23fx23 — 11 Jan 2024, 14:17


]]>
2024-01-10T22:24:04+02:00 2024-01-10T22:24:04+02:00 https://brainmodular.com/forums/viewtopic.php?t=7210&p=45180#p45180 <![CDATA[Module development SDK • Re: Paint Image/Frame]]> I wrote a user module that draws a full 88 note keyboard with highlighted keys. Every key with a load of draw paths, fills, etc. The idea that I would have to redraw all that whenever Usine requested seemed like a disaster.
In practice it doesn't seem to take much processing power even if it might seem inefficient. I Don't know how it compiles up but the executable might be efficient especially if acceleration is on - vector graphics tends to be.
Drawing in Usine is very similar to using html5 canvas api. I believe that requires a full redraw every time.

Statistics: Posted by sm_jamieson — 10 Jan 2024, 21:24


]]>
2024-01-01T13:37:40+02:00 2024-01-01T13:37:40+02:00 https://brainmodular.com/forums/viewtopic.php?t=7210&p=45160#p45160 <![CDATA[Module development SDK • Re: Paint Image/Frame]]> that means repaint xy pixels sections over a background pre-computed 'image'. but for that man must be able to draw that 'buffer image' in the first place, and store it, and then be able to also only repaint/flag 'dirty' areas.

thats how its done is juce: the 'component' has an image buffer.
man compute/paint all thing that won't change to that buffer (only once), that is your "resulting color'. then juce will use/display that buffer instead of complex repainting that 'build' that image. then if say a cusor rectangle needs to move on top of that, man say someting like: repaint(this_rectangle_only); //(technically also the previous one, as need to be 'erased'..)

but afaii usine paint procedure doesn't allow such thing to 'only re-paint a specific area', the paint call 'flags' complete module area as 'dirty'

technically that kinda is possible already using two modules: one paints the "buffered image" baground layer, feed that to the "Bitmap in" of a second module, that only repaint changing stuff on top of that as an 'overlay' layer. but that is not very handy to use 2x separated modules.
goal here would be do to it all in a single module.. will investigate a bit more..

Statistics: Posted by 23fx23 — 01 Jan 2024, 12:37


]]>
2023-12-31T20:30:16+02:00 2023-12-31T20:30:16+02:00 https://brainmodular.com/forums/viewtopic.php?t=7210&p=45159#p45159 <![CDATA[Module development SDK • Re: Paint Image/Frame]]> Not an expert in that field, but shouldn't be an idea to compute the resulting color instead of adding some layers and then repaint only the rectangle that has changed ?

Statistics: Posted by oli_lab — 31 Dec 2023, 19:30


]]>
2023-12-29T16:56:53+02:00 2023-12-29T16:56:53+02:00 https://brainmodular.com/forums/viewtopic.php?t=7210&p=45157#p45157 <![CDATA[Module development SDK • Paint Image/Frame]]> for ex:
L0: background/grid
L1: wavform path
L2: slices/markers colors semi transparent rectangles
L3 : finally a 'selection' overlay hilight of one of the slice on top of previous layers ect..

Image

for now every paint call needs to repaint everything from bottom to top, which i feel is not most efficient method.
ideally i would 'buffer' pre-computed static stuff to some image(s) (like bg/grid/wavform/slices colors) could be buffered to one image
so then could paint that pre-calc image, and only the stuff that really changed (here my slice selector) would then be repainted on top of that.
(that is what i usually do in such cases for ex in juce)

I didn't deeply investigated UsineFrame and video stuff yet, so not sure something can be done here, like maybe dirrectly painting to some bmp in,
or an 'internal' image.. but i don't seem to find sdkpaint methods like 'draw Frame /draw image ect.
So Just curious if some users experimented with this, and might have advices / know if something is possible along those lines?

Statistics: Posted by 23fx23 — 29 Dec 2023, 15:56


]]>
2022-12-28T16:46:08+02:00 2022-12-28T16:46:08+02:00 https://brainmodular.com/forums/viewtopic.php?t=7097&p=44619#p44619 <![CDATA[Module development SDK • Usine Objects in SDK]]> I notice no changes have been made to the SDK for a number of years.
One thing that would be very useful.
If Usine Objects (GetObject, SetObject, etc) was added to the SDK.
Currently it is only available in a script.

Thanks,
Simon.

Statistics: Posted by sm_jamieson — 28 Dec 2022, 15:46


]]>
2022-11-16T22:51:41+02:00 2022-11-16T22:51:41+02:00 https://brainmodular.com/forums/viewtopic.php?t=7066&p=44471#p44471 <![CDATA[Module development SDK • Re: the spreadsheet paradigm]]> I like that !
Is it already implemented in global arrays in HH5 ?

I did some digging : global arrays could do the trick : one global array per column
Exept that the files will be very tricky to edit

I just have to make a special module for sorting the columns all at once.

first I have another job to finish ;-)

Many Thanx

Statistics: Posted by oli_lab — 16 Nov 2022, 21:51


]]>
2022-11-16T10:58:25+02:00 2022-11-16T10:58:25+02:00 https://brainmodular.com/forums/viewtopic.php?t=7066&p=44469#p44469 <![CDATA[Module development SDK • Re: the spreadsheet paradigm]]>
2 outs for line 0 and 1 (title, and type) and you could have 2 inputs to be able to retrieve any element of the CSV:

line and column
and one output to get the result.

(23 ; 12) sends the element line 23, column 12
(4 ; -1) sends the line 4 as a commatext
(-1 ; 5) sends the column 5 as a commatext
(2,3,4,5 ; -1) sends the lines 2,3,4,5 as a commatext
(-1,-1) sends all the CSV values as commatext

Statistics: Posted by senso — 16 Nov 2022, 09:58


]]>
2022-11-15T22:25:17+02:00 2022-11-15T22:25:17+02:00 https://brainmodular.com/forums/viewtopic.php?t=7066&p=44468#p44468 <![CDATA[Module development SDK • the spreadsheet paradigm]]> I'm planning a series of modules to be able to write/read/append and sort out cvs files.
The planned use will be to select samples from a vast bank of wavefiles from various quantified critrerias.
The question is what format should have the output of the file :
a single commatext out with all the data + a nb of columns output ?
as many outputs as the nb of columns ?

the first line of the cvs will tell the format of each column (s,f,i) and be output as a commatext + input
the second line of the cvs will be the label of each column and be output as a commatext + input

also, some columns will be text (typically filenames) and other float or int
with only one commatext output, a conversion will be necessary from string to int or string to float ?
or I could have a commatext output + an array output for floats and int ?

thanx for advice

Olivar

Statistics: Posted by oli_lab — 15 Nov 2022, 21:25


]]>
2022-01-16T09:57:50+02:00 2022-01-16T09:57:50+02:00 https://brainmodular.com/forums/viewtopic.php?t=6948&p=43888#p43888 <![CDATA[Module development SDK • Re: gesture recognition]]> Statistics: Posted by oli_lab — 16 Jan 2022, 08:57


]]>
2022-01-13T09:24:21+02:00 2022-01-13T09:24:21+02:00 https://brainmodular.com/forums/viewtopic.php?t=6948&p=43884#p43884 <![CDATA[Module development SDK • Re: gesture recognition]]>
Gesture Reco 1 2.pat

Statistics: Posted by senso — 13 Jan 2022, 08:24


]]>
2022-01-13T09:15:00+02:00 2022-01-13T09:15:00+02:00 https://brainmodular.com/forums/viewtopic.php?t=6948&p=43883#p43883 <![CDATA[Module development SDK • Re: gesture recognition]]> https://www.youtube.com/watch?v=VvX7VlZVy40
An old video but you don't need a special library, it is made with a script.

Statistics: Posted by senso — 13 Jan 2022, 08:15


]]>
BrainModular BrainModular Users Forum 2026-01-18T23:11:38+02:00 https://brainmodular.com/forums/app.php/feed/forum/7 2026-01-18T23:11:38+02:00 2026-01-18T23:11:38+02:00 https://brainmodular.com/forums/viewtopic.php?t=7358&p=46198#p46198 <![CDATA[Module development SDK • Re: Audiofile]]> I had a go with the audiofile command las few days.
I managed to load wav files, but can't save any

here is the part of the code that's not working : (it's included in a function that is called at callback)

CODE:

for (int i = 0; i < m_size; ++i) {sdkSetSampleAudioFile(audioFile, 1,i, m_buffer[i]);}sdkSetChannelsAudioFile(audioFile, 1);sdkSetSizeAudioFile(audioFile, m_size);sdkSaveToDiskAudioFile(audioFile, tempChar, 1);}
/////////////////////////////
if I run it, it will return errors :
[2] Error :
[HydroGen OP V5] CallBack, paramIndex=19

///////////////////////////////////////
tried with

sdkSetChannelsAudioFile(audioFile, 1);
sdkSetSizeAudioFile(audioFile, m_size);
before
for (int i = 0; i < m_size; ++i) {
sdkSetSampleAudioFile(audioFile, 1,i, m_buffer);

same thing
/////////////////////////////////////////

if I comment it and run only SetChannelsAudioFile and SetSizeAudioFile :

[6] Error :
bad pointer in SetChannelsAudioFile
[8] Error :
bad pointer in SetSizeAudioFile

//////////////////

with only: sdkSetSampleAudioFile(audioFile, 1,i, m_buffer);

[2] Error :
[HydroGen OP V5] CallBack, paramIndex=19


/////////////////////////////////////
with only: sdkSaveToDiskAudioFile(audioFile, tempChar, 1);

SDK_SaveToDiskAudioFile :
[0] Error :
PROC:SaveToDiskAudioFile
ERROR:Access violation at address 000000000136CDDE in module 'Usine.exe'. Read of address
0000000000001190

if anyone has a working example using sdkSaveToDiskAudioFile, could you please show it to me !

thanx

Olivar

Statistics: Posted by oli_lab — 18 Jan 2026, 22:11


]]>
2025-06-17T14:28:01+02:00 2025-06-17T14:28:01+02:00 https://brainmodular.com/forums/viewtopic.php?t=7375&p=45918#p45918 <![CDATA[Module development SDK • ppq]]> is there a way to get the ppq value with the sdk ?

thanx

Olivar

Statistics: Posted by oli_lab — 17 Jun 2025, 14:28


]]>
2025-06-11T22:12:58+02:00 2025-06-11T22:12:58+02:00 https://brainmodular.com/forums/viewtopic.php?t=7369&p=45912#p45912 <![CDATA[Module development SDK • Re: HH6 SDK Mouse Up Multi event bug]]> The latest sdk is missing some TShiftState values. The full list is below. The way to ignore the new events is to ignore anything where the shift state is ssTouch or higher.
List supplied by Senso. Note these are Delphi values not Windows values.

/// Possible value for a TShiftState variable.
/// @see onMouseMove, onMouseDown, onMouseUp, onMouseMoveMulti, onMouseDownMulti, onMouseUpMulti
static constexpr UINT32 ssShift = 0x1; ///< Shift keyboard state
static constexpr UINT32 ssAlt = 0x2; ///< Alt keyboard state
static constexpr UINT32 ssCtrl = 0x4; ///< Ctrl keyboard state
static constexpr UINT32 ssLeft = 0x8; ///< Left mouse button state
static constexpr UINT32 ssRight = 0x10; ///< Right mouse button state
static constexpr UINT32 ssMiddle = 0x20; ///< Middle mouse button state
static constexpr UINT32 ssDouble = 0x40; ///< Mouse Double click state
static constexpr UINT32 ssTouch = 0x80; ///< Mouse touch screen click state
static constexpr UINT32 ssPen = 0x100; ///< Mouse pen click state
static constexpr UINT32 ssCommand = 0x200; ///< Mouse Command state
static constexpr UINT32 ssHorizontal = 0x400; ///< Mouse Horizontal state

Statistics: Posted by sm_jamieson — 11 Jun 2025, 22:12


]]>
2025-06-07T19:21:38+02:00 2025-06-07T19:21:38+02:00 https://brainmodular.com/forums/viewtopic.php?t=7369&p=45897#p45897 <![CDATA[Module development SDK • Re: HH6 SDK Mouse Up Multi event bug]]>
The extra mousedown is from the Windows right click generated on a long touch action.
The shiftstate and mousebutton show that. I think that the long touch right click is generated by Windows when the touch is removed, which is why it always comes at the end.

Simon.

Statistics: Posted by sm_jamieson — 07 Jun 2025, 19:21


]]>
2025-06-02T22:17:22+02:00 2025-06-02T22:17:22+02:00 https://brainmodular.com/forums/viewtopic.php?t=7369&p=45889#p45889 <![CDATA[Module development SDK • HH6 SDK Mouse Up Multi event bug]]>
When a touchpoint is removed an extra mouse down is being sent.
The following is trace from touching and lifting a single finger.

[34] simonj DOWN multi 0: x=0.344595, y=0.734637, pressed=1.000000, mask=91
[36] simonj ++++ MOUSE UP on touchpoint 0
[38] simonj UP multi 0: x=1.000000, y=1.000000, pressed=0.000000, mask=90
[40] simonj DOWN multi 0: x=0.344595, y=0.740223, pressed=1.000000, mask=91

The mask is my own indication of mouse down or up for a number of touchpoints - here only 1 touchpoint exists.

It might be usual have a mouse UP multi with x and y = 1 - I'm not sure but in practice the position of an UP event does not matter.
However, an extra DOWN event is being produced.
This does not happen with the mouse - only with touch.

I have a touch keyboard in my SDK user module and this is causing another keypress !

This does not happen with the same module in HH5.
For comparison, this is what I see in HH5:

[426] simonj DOWN multi 0: x=0.680180, y=0.396648, pressed=1.000000, mask=910
[428] simonj ++++ MOUSE UP on touchpoint 0
[430] simonj UP multi 0: x=1.000000, y=0.726257, pressed=0.000000, mask=900
The interesting thing here is the x and y values are nonsense.

It seems to me that if the HH6 faulty DOWN values were used in the UP and the DOWN was removed, everything would be perfect.

Before I raise a ticket - has anyone else seen this ?

Simon.

Statistics: Posted by sm_jamieson — 02 Jun 2025, 22:17


]]>
2025-05-20T14:55:17+02:00 2025-05-20T14:55:17+02:00 https://brainmodular.com/forums/viewtopic.php?t=7358&p=45845#p45845 <![CDATA[Module development SDK • Re: Audiofile]]>
wish me luck

Olivar

Statistics: Posted by oli_lab — 20 May 2025, 14:55


]]>
2025-05-12T00:52:50+02:00 2025-05-12T00:52:50+02:00 https://brainmodular.com/forums/viewtopic.php?t=7360&p=45839#p45839 <![CDATA[Module development SDK • OFF caption]]> Is it possible to set the OFF caption of a switch with the SDK ?

there a pParamInfo->Caption to set the ON caption, but nothing for the OFF caption

Thanks

Olivar

Statistics: Posted by oli_lab — 12 May 2025, 00:52


]]>
2025-05-05T19:33:42+02:00 2025-05-05T19:33:42+02:00 https://brainmodular.com/forums/viewtopic.php?t=7358&p=45825#p45825 <![CDATA[Module development SDK • Audiofile]]> I'm trying to use the "audiofile" class in the SDK to make a multitrack file but I get some errors :
My idea is to have a multitrack wave file that I can save (or load) and populate it with samples
But I think I get something wrong.
If I want to have a recorder like the "audios ampler recorder" module, do I have to save the samples in a buffer (RAM) and then use the audiofile to save the wave file to disk ?
I'm a bit lost in here.

in .h

TAudioFilePtr audiofile1;

in .cpp

// constructor
multitrackrecorder::multitrackrecorder()

{
audiofile1 = sdkCreateAudioFile();
}

....

//-----------------------------------------------------------------------------
// initialisation
void multitrackrecorder::onInitModule (TMasterInfo* pMasterInfo, TModuleInfo* pModuleInfo)
{
sdkSetChannelsAudioFile(audiofile1, numOfAudiotInsOuts);
sdkSetSizeAudioFile(audiofile1, 60 * sdkGetSampleRate());

}

When loaded in Usine, I get those error messages :
[4] Error :
bad pointer in SetChannelsAudioFile
[6] Error :
bad pointer in SetSizeAudioFile

any idea ?
thanks

Statistics: Posted by oli_lab — 05 May 2025, 19:33


]]>
2024-11-07T09:26:14+02:00 2024-11-07T09:26:14+02:00 https://brainmodular.com/forums/viewtopic.php?t=7291&p=45559#p45559 <![CDATA[Module development SDK • Re: default value fo array input]]> Statistics: Posted by senso — 07 Nov 2024, 08:26


]]>
2024-10-27T19:58:29+02:00 2024-10-27T19:58:29+02:00 https://brainmodular.com/forums/viewtopic.php?t=7291&p=45538#p45538 <![CDATA[Module development SDK • default value fo array input]]> Is there a trick to have default values for array input in case it is not connected, and setting the values to an array display in case it is drown from the array input ?

Thanx

Statistics: Posted by oli_lab — 27 Oct 2024, 18:58


]]>
2024-02-01T10:56:13+02:00 2024-02-01T10:56:13+02:00 https://brainmodular.com/forums/viewtopic.php?t=7097&p=45234#p45234 <![CDATA[Module development SDK • Re: Usine Objects in SDK]]> Statistics: Posted by sm_jamieson — 01 Feb 2024, 09:56


]]>
2024-01-15T11:40:58+02:00 2024-01-15T11:40:58+02:00 https://brainmodular.com/forums/viewtopic.php?t=7097&p=45194#p45194 <![CDATA[Module development SDK • Re: Usine Objects in SDK]]>

CODE:

//----------------------------------------------------------------------------/// @name Usine Objects functions /// @{/// Set the float value of an Usine-Objectinline void sdkUsineObjectSetFloat(AnsiCharPtr name, TPrecision floatValue) { m_masterInfo->UsineObjectSetFloat(m_moduleInfo, name, floatValue); };/// Set the integer value of an Usine-Objectinline void sdkUsineObjectSetInteger (AnsiCharPtr name, int integerValue) { m_masterInfo->UsineObjectSetInteger(m_moduleInfo, name, integerValue); };/// Set the float value of an Usine-Object array at the index positioninline void sdkUsineObjectSetArray(AnsiCharPtr name, int index, TPrecision floatValue) { m_masterInfo->UsineObjectSetArray(m_moduleInfo, name, index, floatValue); };/// Set the Midi value of an Usine-Object array at the index positioninline void sdkUsineObjectSetMIDI (AnsiCharPtr name, int index, TUsineMidiCode midiValue) { m_masterInfo->UsineObjectSetMIDI(m_moduleInfo, name, index, midiValue); };/// Set the color value of an Usine-Object inline void sdkUsineObjectSetColor (AnsiCharPtr name, TUsineColor colorValue) {m_masterInfo->UsineObjectSetColor(m_moduleInfo, name, colorValue); };/// Set the color value of an Usine-Object array at the index positioninline void sdkUsineObjectSetArrayColor (AnsiCharPtr name, int index, TUsineColor colorValue) {m_masterInfo->UsineObjectSetArrayColor(m_moduleInfo, name, index, colorValue); };/// Set a trigger value of an Usine-Objectinline void sdkUsineObjectSetTrigger (AnsiCharPtr name) { m_masterInfo->UsineObjectSetTrigger(m_moduleInfo, name); };/// Set the text value of an Usine-Objectinline void sdkUsineObjectSetAnsiChar(AnsiCharPtr name, AnsiCharPtr v) {m_masterInfo->UsineObjectSetAnsiChar(m_moduleInfo, name, v); };/// Get the float value of an Usine-Objectinline TPrecision sdkUsineObjectGetFloat (AnsiCharPtr name) { return m_masterInfo->UsineObjectGetFloat(m_moduleInfo, name);};/// Get the integer value of an Usine-Object inline int  sdkUsineObjectGetInteger(AnsiCharPtr name) { return m_masterInfo->UsineObjectGetInteger(m_moduleInfo, name); };/// Get the float value of an Usine-Object array at the index positioninline TPrecision sdkUsineObjectGetArray(AnsiCharPtr name, int index) {return m_masterInfo->UsineObjectGetArray(m_moduleInfo, name, index); };/// Get the Midi value of an Usine-Object array at the index positioninline TUsineMidiCode sdkUsineObjectGetMIDI(AnsiCharPtr name, int index) { return m_masterInfo->UsineObjectGetMIDI(m_moduleInfo, name, index); };/// Get the color value of an Usine-Objectinline TUsineColor sdkUsineObjectGetColor(AnsiCharPtr name) {return m_masterInfo->UsineObjectGetColor(m_moduleInfo, name); };/// Get the array value of an Usine-Object array at the index positioninline TUsineColor sdkUsineObjectGetArrayColor(AnsiCharPtr name, int index) {return m_masterInfo->UsineObjectGetArrayColor(m_moduleInfo, name, index);};/// Get the text value of an Usine-Objectinline AnsiCharPtr sdkUsineObjectGetAnsiChar(AnsiCharPtr name) {return m_masterInfo->UsineObjectGetAnsiChar(m_moduleInfo, name); };/// Get the size of the Event associated to an Usine-Objectinline int sdkUsineObjectGetLength(AnsiCharPtr name) {return m_masterInfo->UsineObjectGetLength(m_moduleInfo, name); };/// Set the size of the Event associated to an Usine-Objectinline void        sdkUsineObjectSetLength(AnsiCharPtr name, int l) { m_masterInfo->UsineObjectSetLength(m_moduleInfo, name, l); };/// Returns the list (as a comma-text) of all Usine-Objects that match with the name parameterinline AnsiCharPtr sdkUsineObjectFind(AnsiCharPtr name) {return m_masterInfo->UsineObjectFind(m_moduleInfo, name); };/// Returns TRUE if the Usine-Objects existsinline LongBool sdkUsineObjectExists   (AnsiCharPtr name) { return m_masterInfo->UsineObjectExists(m_moduleInfo, name); };/// Returns the Hash of allUsine-Objects. This allows to determines if the list of all the Usine-Objects has changed.inline AnsiCharPtr sdkUsineObjectListHash() {return m_masterInfo->UsineObjectListHash(m_moduleInfo);};/// @}

Statistics: Posted by senso — 15 Jan 2024, 10:40


]]>
2024-01-15T11:36:24+02:00 2024-01-15T11:36:24+02:00 https://brainmodular.com/forums/viewtopic.php?t=7210&p=45193#p45193 <![CDATA[Module development SDK • Re: Paint Image/Frame]]> It could take an array on ARGB (or RGBA on macOS?) pixels and just blit it into the canvas?

Statistics: Posted by senso — 15 Jan 2024, 10:36


]]>
2024-01-11T15:17:16+02:00 2024-01-11T15:17:16+02:00 https://brainmodular.com/forums/viewtopic.php?t=7210&p=45184#p45184 <![CDATA[Module development SDK • Re: Paint Image/Frame]]> i spend shittons of time optimizing such things in juce i might be biased.. always cache paths/buffers ect
still think some basic still frames manipulation kit could be nice, like load an image, jpg/png to usine frame format,
ideally save some buffer to them, beeing able to simply repaint a stored frame in paint proc even on 'normal' modules would be nice.
maybe just some strecth to fit rect transorm that would be more efficient than looping thru each pixels. atm i don't think man can really paint an image unless im mistaken

Statistics: Posted by 23fx23 — 11 Jan 2024, 14:17


]]>
2024-01-10T22:24:04+02:00 2024-01-10T22:24:04+02:00 https://brainmodular.com/forums/viewtopic.php?t=7210&p=45180#p45180 <![CDATA[Module development SDK • Re: Paint Image/Frame]]> I wrote a user module that draws a full 88 note keyboard with highlighted keys. Every key with a load of draw paths, fills, etc. The idea that I would have to redraw all that whenever Usine requested seemed like a disaster.
In practice it doesn't seem to take much processing power even if it might seem inefficient. I Don't know how it compiles up but the executable might be efficient especially if acceleration is on - vector graphics tends to be.
Drawing in Usine is very similar to using html5 canvas api. I believe that requires a full redraw every time.

Statistics: Posted by sm_jamieson — 10 Jan 2024, 21:24


]]>
2024-01-01T13:37:40+02:00 2024-01-01T13:37:40+02:00 https://brainmodular.com/forums/viewtopic.php?t=7210&p=45160#p45160 <![CDATA[Module development SDK • Re: Paint Image/Frame]]> that means repaint xy pixels sections over a background pre-computed 'image'. but for that man must be able to draw that 'buffer image' in the first place, and store it, and then be able to also only repaint/flag 'dirty' areas.

thats how its done is juce: the 'component' has an image buffer.
man compute/paint all thing that won't change to that buffer (only once), that is your "resulting color'. then juce will use/display that buffer instead of complex repainting that 'build' that image. then if say a cusor rectangle needs to move on top of that, man say someting like: repaint(this_rectangle_only); //(technically also the previous one, as need to be 'erased'..)

but afaii usine paint procedure doesn't allow such thing to 'only re-paint a specific area', the paint call 'flags' complete module area as 'dirty'

technically that kinda is possible already using two modules: one paints the "buffered image" baground layer, feed that to the "Bitmap in" of a second module, that only repaint changing stuff on top of that as an 'overlay' layer. but that is not very handy to use 2x separated modules.
goal here would be do to it all in a single module.. will investigate a bit more..

Statistics: Posted by 23fx23 — 01 Jan 2024, 12:37


]]>
2023-12-31T20:30:16+02:00 2023-12-31T20:30:16+02:00 https://brainmodular.com/forums/viewtopic.php?t=7210&p=45159#p45159 <![CDATA[Module development SDK • Re: Paint Image/Frame]]> Not an expert in that field, but shouldn't be an idea to compute the resulting color instead of adding some layers and then repaint only the rectangle that has changed ?

Statistics: Posted by oli_lab — 31 Dec 2023, 19:30


]]>
2023-12-29T16:56:53+02:00 2023-12-29T16:56:53+02:00 https://brainmodular.com/forums/viewtopic.php?t=7210&p=45157#p45157 <![CDATA[Module development SDK • Paint Image/Frame]]> for ex:
L0: background/grid
L1: wavform path
L2: slices/markers colors semi transparent rectangles
L3 : finally a 'selection' overlay hilight of one of the slice on top of previous layers ect..

Image

for now every paint call needs to repaint everything from bottom to top, which i feel is not most efficient method.
ideally i would 'buffer' pre-computed static stuff to some image(s) (like bg/grid/wavform/slices colors) could be buffered to one image
so then could paint that pre-calc image, and only the stuff that really changed (here my slice selector) would then be repainted on top of that.
(that is what i usually do in such cases for ex in juce)

I didn't deeply investigated UsineFrame and video stuff yet, so not sure something can be done here, like maybe dirrectly painting to some bmp in,
or an 'internal' image.. but i don't seem to find sdkpaint methods like 'draw Frame /draw image ect.
So Just curious if some users experimented with this, and might have advices / know if something is possible along those lines?

Statistics: Posted by 23fx23 — 29 Dec 2023, 15:56


]]>
2022-12-28T16:46:08+02:00 2022-12-28T16:46:08+02:00 https://brainmodular.com/forums/viewtopic.php?t=7097&p=44619#p44619 <![CDATA[Module development SDK • Usine Objects in SDK]]> I notice no changes have been made to the SDK for a number of years.
One thing that would be very useful.
If Usine Objects (GetObject, SetObject, etc) was added to the SDK.
Currently it is only available in a script.

Thanks,
Simon.

Statistics: Posted by sm_jamieson — 28 Dec 2022, 15:46


]]>
2022-11-16T22:51:41+02:00 2022-11-16T22:51:41+02:00 https://brainmodular.com/forums/viewtopic.php?t=7066&p=44471#p44471 <![CDATA[Module development SDK • Re: the spreadsheet paradigm]]> I like that !
Is it already implemented in global arrays in HH5 ?

I did some digging : global arrays could do the trick : one global array per column
Exept that the files will be very tricky to edit

I just have to make a special module for sorting the columns all at once.

first I have another job to finish ;-)

Many Thanx

Statistics: Posted by oli_lab — 16 Nov 2022, 21:51


]]>
2022-11-16T10:58:25+02:00 2022-11-16T10:58:25+02:00 https://brainmodular.com/forums/viewtopic.php?t=7066&p=44469#p44469 <![CDATA[Module development SDK • Re: the spreadsheet paradigm]]>
2 outs for line 0 and 1 (title, and type) and you could have 2 inputs to be able to retrieve any element of the CSV:

line and column
and one output to get the result.

(23 ; 12) sends the element line 23, column 12
(4 ; -1) sends the line 4 as a commatext
(-1 ; 5) sends the column 5 as a commatext
(2,3,4,5 ; -1) sends the lines 2,3,4,5 as a commatext
(-1,-1) sends all the CSV values as commatext

Statistics: Posted by senso — 16 Nov 2022, 09:58


]]>
2022-11-15T22:25:17+02:00 2022-11-15T22:25:17+02:00 https://brainmodular.com/forums/viewtopic.php?t=7066&p=44468#p44468 <![CDATA[Module development SDK • the spreadsheet paradigm]]> I'm planning a series of modules to be able to write/read/append and sort out cvs files.
The planned use will be to select samples from a vast bank of wavefiles from various quantified critrerias.
The question is what format should have the output of the file :
a single commatext out with all the data + a nb of columns output ?
as many outputs as the nb of columns ?

the first line of the cvs will tell the format of each column (s,f,i) and be output as a commatext + input
the second line of the cvs will be the label of each column and be output as a commatext + input

also, some columns will be text (typically filenames) and other float or int
with only one commatext output, a conversion will be necessary from string to int or string to float ?
or I could have a commatext output + an array output for floats and int ?

thanx for advice

Olivar

Statistics: Posted by oli_lab — 15 Nov 2022, 21:25


]]>
2022-01-16T09:57:50+02:00 2022-01-16T09:57:50+02:00 https://brainmodular.com/forums/viewtopic.php?t=6948&p=43888#p43888 <![CDATA[Module development SDK • Re: gesture recognition]]> Statistics: Posted by oli_lab — 16 Jan 2022, 08:57


]]>
2022-01-13T09:24:21+02:00 2022-01-13T09:24:21+02:00 https://brainmodular.com/forums/viewtopic.php?t=6948&p=43884#p43884 <![CDATA[Module development SDK • Re: gesture recognition]]>
Gesture Reco 1 2.pat

Statistics: Posted by senso — 13 Jan 2022, 08:24


]]>
2022-01-13T09:15:00+02:00 2022-01-13T09:15:00+02:00 https://brainmodular.com/forums/viewtopic.php?t=6948&p=43883#p43883 <![CDATA[Module development SDK • Re: gesture recognition]]> https://www.youtube.com/watch?v=VvX7VlZVy40
An old video but you don't need a special library, it is made with a script.

Statistics: Posted by senso — 13 Jan 2022, 08:15


]]>