ArrayArrayArrayArrayArrayArrayArrayArrayArrayArrayArrayArrayArrayArrayArrayArrayArrayArrayArrayArrayArrayArrayArrayArrayArray BrainModular BrainModular Users Forum 2026-04-30T18:03:04+02:00 https://brainmodular.com/forums/app.php/feed/forum/6 2026-04-30T18:03:04+02:00 2026-04-30T18:03:04+02:00 https://brainmodular.com/forums/viewtopic.php?t=7441&p=46294#p46294 <![CDATA[Patching questions • Re: Midi learn only from rack]]>
We need a new forum section "Usine Hacking" :-)

Statistics: Posted by sm_jamieson — 30 Apr 2026, 18:03


]]>
2026-04-30T13:06:44+02:00 2026-04-30T13:06:44+02:00 https://brainmodular.com/forums/viewtopic.php?t=7441&p=46293#p46293 <![CDATA[Patching questions • Re: Midi learn only from rack]]> I use all midi learns to feed a big Gloabal Array
and then, in each rack, I get the Global Array value(s) wich I need to control my faders and knob
eg something like choosing in a combo box the first instrument : Tuba > all my faders are feeded from values 1 = volume, 9 (1+8) reverb, 17 (1+16) delay
choosing the second instrument : Serpent > all my faders are feeded from values 2 = volume, 10 (2+8) reverb, 18 (2+16) delay

(this way I can also feed one value in the GA from 2 separated controllers.


Here I just tried some stuffs to help find a solution to your problem :-)

Statistics: Posted by grego mondo — 30 Apr 2026, 13:06


]]>
2026-04-30T10:51:21+02:00 2026-04-30T10:51:21+02:00 https://brainmodular.com/forums/viewtopic.php?t=7441&p=46292#p46292 <![CDATA[Patching questions • Re: Midi learn only from rack]]> Statistics: Posted by sm_jamieson — 30 Apr 2026, 10:51


]]>
2026-04-29T10:18:45+02:00 2026-04-29T10:18:45+02:00 https://brainmodular.com/forums/viewtopic.php?t=7441&p=46291#p46291 <![CDATA[Patching questions • Re: Midi learn only from rack]]>
If you create a midi in device getting a midi bus (called "virtual" for eg) the midi learn goes the same way with no name

but if you add the midi bus "virtual" to IN MIDI LAN & BRIDGE then it's learned with the name "MIDI LAN & BRIDGE"

Then if you plug a real midi device (let's say "MPK MINI") and put the "virtual" bus in it
As long as the MPK MINI is plugged to the computer all the learn using "virtual" values go through it and are learned with its name (MPK MINI)
Then if you unplugged the MPK MINI all the learns still works and you can make new learns ...
I added a pass flow between "virtual" bus and "MIDI TO USINE" in the MPK MINI input device so I can turn the "virtual" going through "MPK MINI" on and off
it means you need to have unused controllers that you'll plug once and then put back in your drawer ...

Statistics: Posted by grego mondo — 29 Apr 2026, 10:18


]]>
2026-04-29T03:19:23+02:00 2026-04-29T03:19:23+02:00 https://brainmodular.com/forums/viewtopic.php?t=7441&p=46290#p46290 <![CDATA[Patching questions • Re: Midi learn only from rack]]>
I did some experiments with fake devices (a patch receiving from a midi bus dropped into the devices area of a rack).
If the real midi input devices are removed, you can actually midi learn from the fake devices but they have no real device behind them
and the the wkp file they are stored as
Tdevice name =
instead if something like Tdevice name=FOCUSRITE USB MIDI

If you learn from another fake device in the same way, it is also stored without a name so they are really clones of each other,
both with device name of "nothing", and both sliders move together.

But in principle if there was a way to give the fake device a fake external device name, this could be supported by Usine.
Note - the input device patch as seen in the devices section may be called "IN FOCUSRITE USB MIDI" but the real
device behind it is called "FOCUSRITE USB MIDI" - they are not the same thing.

If the midi was sent out and looped back in via a virtual midi cable, of course this would work, since then there is a real midi device.

Interesting anyway.

Statistics: Posted by sm_jamieson — 29 Apr 2026, 03:19


]]>
2026-04-28T00:26:22+02:00 2026-04-28T00:26:22+02:00 https://brainmodular.com/forums/viewtopic.php?t=7441&p=46288#p46288 <![CDATA[Patching questions • Re: Midi learn only from rack]]> you can use clusters, global arrays or busses !
do the midi learns once and for all (here they are patched from CC1 to CC8
++
Olivar
see examples :
learns to GA.wkp

learns to busses.wkp

learns to clusters.wkp

Statistics: Posted by oli_lab — 28 Apr 2026, 00:26


]]>
2026-04-27T22:42:58+02:00 2026-04-27T22:42:58+02:00 https://brainmodular.com/forums/viewtopic.php?t=7441&p=46287#p46287 <![CDATA[Patching questions • Re: Midi learn only from rack]]> Statistics: Posted by sm_jamieson — 27 Apr 2026, 22:42


]]>
2026-04-27T12:18:52+02:00 2026-04-27T12:18:52+02:00 https://brainmodular.com/forums/viewtopic.php?t=7441&p=46285#p46285 <![CDATA[Patching questions • Re: Midi learn only from rack]]>
There is no MIDI Learn function specific to racks.
However, for each MIDI Learn, you can specify the device.

As for using MIDI In/Out modules, this allows you to retrieve data within patches. This enables more precise and potentially complex control than simply mapping a MIDI Learn, but it requires patching.

MIDI Learn allows for quick and flexible setup.
In some cases, it can be difficult to manage—for example, if a device keeps sending data. However, you can simply turn off the corresponding device (in Usine).


Happy patching !
Baptiste

Statistics: Posted by BM2F — 27 Apr 2026, 12:18


]]>
2026-04-27T02:51:18+02:00 2026-04-27T02:51:18+02:00 https://brainmodular.com/forums/viewtopic.php?t=7441&p=46284#p46284 <![CDATA[Patching questions • Midi learn only from rack]]> I have a midi bus going to each of my racks, (the top patch in each rack has a midi from bus connected to a midi out)
so that all lower patches in the rack get the midi data for that rack.
I want to do midi learn only on the midi data in that rack, but Usine midi learn is global.
Is there any way to have rack specific midi learn ?

If not, this may be something for HH7.

Thanks,
SImon.

Statistics: Posted by sm_jamieson — 27 Apr 2026, 02:51


]]>
2026-04-21T19:41:58+02:00 2026-04-21T19:41:58+02:00 https://brainmodular.com/forums/viewtopic.php?t=7439&p=46279#p46279 <![CDATA[Patching questions • Re: Sample editor in Usine]]>
here is the "NOT working" code :

CODE:

void diywt::writeWavFile(const std::string& filename) {realSize = m_maxWrite;sdkTraceInt(realSize);sdkTraceInt(m_lastMarkerNumber);// Structures pour les en-têtesstruct RiffHeader {char chunkId[4] = { 'R', 'I', 'F', 'F' };uint32_t chunkSize;char format[4] = { 'W', 'A', 'V', 'E' };};struct FmtChunk {char chunkId[4] = { 'f', 'm', 't', ' ' };uint32_t chunkSize = 16;uint16_t audioFormat = 3; // 32-bit floatuint16_t numChannels;uint32_t sampleRate;uint32_t byteRate;uint16_t blockAlign;uint16_t bitsPerSample;};struct DataChunk {char chunkId[4] = { 'd', 'a', 't', 'a' };uint32_t chunkSize;};std::ofstream outFile(filename, std::ios::binary);if (!outFile) {sdkTraceErrorChar("can't open file");return;}// Paramètres audioint numChannels = 1;int bitsPerSample = 32;int numSamples = m_markersStart[m_lastMarkerNumber];//realSize;// Calculer la taille des données audiouint32_t dataSize = numSamples * numChannels * bitsPerSample / 8;// Remplir les en-têtesRiffHeader riffHeader;FmtChunk fmtChunk;fmtChunk.numChannels = numChannels;fmtChunk.sampleRate = sdkGetSampleRate();fmtChunk.byteRate = fmtChunk.sampleRate * numChannels * bitsPerSample / 8;fmtChunk.blockAlign = numChannels * bitsPerSample / 8;fmtChunk.bitsPerSample = bitsPerSample;DataChunk dataChunk;dataChunk.chunkSize = dataSize;// Calculer la taille totale du fichieruint32_t totalFileSize = sizeof(RiffHeader) + sizeof(FmtChunk) + sizeof(DataChunk) + dataSize;// +sizeof(CueChunk) + cueChunkSize + sizeof(AdtlChunk) + adtlChunkSize;riffHeader.chunkSize = totalFileSize - 8; // Soustraire les 8 octets du chunkId et du chunkSize// Écrire les en-têtes dans le fichieroutFile.write(reinterpret_cast<char*>(&riffHeader), sizeof(RiffHeader));outFile.write(reinterpret_cast<char*>(&fmtChunk), sizeof(FmtChunk));outFile.write(reinterpret_cast<char*>(&dataChunk), sizeof(DataChunk));// Écrire les données audiofor (f = 0; f < numSamples; ++f) {outFile.write(reinterpret_cast<const char*>(&m_audioBuffer[f]), sizeof(float));}// Ajouter un padding si nécessaire pour aligner le chunk suivant sur un nombre pair d'octetsif (dataSize % 2 != 0) {outFile.put(0);}outFile.close();/*//mettre à jour la sortie markerOutint tempSize = m_lastMarkerNumber;markersOut.setSize(tempSize);for (int m = 0; m < tempSize; m++) {markersOut.setArrayData(m, float(m_markersStart[m])/float(numSamples));}*/if (!outFile) {sdkTraceErrorChar("Error closing file");return;}std::string s = fdrFileName.getPChar();s = s + " successfully created";sdkTraceChar(s.c_str());m_signalisation = 2;}

Statistics: Posted by oli_lab — 21 Apr 2026, 19:41


]]>
2026-04-21T19:06:07+02:00 2026-04-21T19:06:07+02:00 https://brainmodular.com/forums/viewtopic.php?t=7439&p=46278#p46278 <![CDATA[Patching questions • Re: Sample editor in Usine]]>
But I think Usine should have read and write sample modules that support wav and aif at least and the metadata for looping
It could be written with the SDK ...

Statistics: Posted by sm_jamieson — 21 Apr 2026, 19:06


]]>
2026-04-21T17:29:55+02:00 2026-04-21T17:29:55+02:00 https://brainmodular.com/forums/viewtopic.php?t=7439&p=46277#p46277 <![CDATA[Patching questions • Re: Sample editor in Usine]]> The sampler modules can't save metadata so it is not possible out of th box.
But I did an addon called "player with saved markers" that can save and retrieved markers.
It is not possible to do loops at sample level but.

for this king of thing, I rather use REAPER and make regionss to be render or a specialized sample editor.

Otherwise, I pretty much like the idea of using Usine as a modular studio to produce processed samples (just like with an old school hardware studio)

Image
Capture d'écran 2026-04-21 173317.png

Statistics: Posted by oli_lab — 21 Apr 2026, 17:29


]]>
2026-04-21T10:46:05+02:00 2026-04-21T10:46:05+02:00 https://brainmodular.com/forums/viewtopic.php?t=7439&p=46276#p46276 <![CDATA[Patching questions • Sample editor in Usine]]> It seems Usine would be a good platform to set sample loop points etc.

Can it or a patch do the following:
1. Set and play a loop
2. Add loop start and end cue points to metadata
3. Snap cue to zero crossing point
4. Modify sample to cross fade across loop points.
5. Save the sample in the same or different format with loop cue points in the metadata that can be used by another sampler ?

Thanks.

Statistics: Posted by sm_jamieson — 21 Apr 2026, 10:46


]]>
2026-04-10T11:00:52+02:00 2026-04-10T11:00:52+02:00 https://brainmodular.com/forums/viewtopic.php?t=7363&p=46266#p46266 <![CDATA[Patching questions • Re: how to get value for global array string]]>
set and get GA string.wkp
what should be remember is :
- declare the GA with a unique name
- populate the GA with "set" modules
- get values with "get" modules
- be aware of the "pass if changed" switch inside the "get" modules
- avoid connecting anything to the GA declaration module, just leave it alone.

Usually, I put all the GA declaration modules in one same patch for code cleanliness

If you need multi-dimension arrays, you can explore putting an array inside a polyphonic subpatch
or use Json

Olivar

Statistics: Posted by oli_lab — 10 Apr 2026, 11:00


]]>
2026-04-01T21:22:05+02:00 2026-04-01T21:22:05+02:00 https://brainmodular.com/forums/viewtopic.php?t=7363&p=46258#p46258 <![CDATA[Patching questions • Re: how to get value for global array string]]> Can you explain what exactly you want to achieve so I can provide you with a patch ?
++
Olivar

Statistics: Posted by oli_lab — 01 Apr 2026, 21:22


]]>
2026-04-01T20:15:11+02:00 2026-04-01T20:15:11+02:00 https://brainmodular.com/forums/viewtopic.php?t=7363&p=46257#p46257 <![CDATA[Patching questions • Re: how to get value for global array string]]>
Workaround in progress. maybe I'll check back next year....

If this exists, it should be added to the manual.

Statistics: Posted by woodslanding — 01 Apr 2026, 20:15


]]>
2026-03-28T17:42:47+02:00 2026-03-28T17:42:47+02:00 https://brainmodular.com/forums/viewtopic.php?t=7434&p=46250#p46250 <![CDATA[Patching questions • Re: Array shuffle]]> Thank you Olivar!

Statistics: Posted by Gilsornette — 28 Mar 2026, 16:42


]]>
2026-03-28T15:59:30+02:00 2026-03-28T15:59:30+02:00 https://brainmodular.com/forums/viewtopic.php?t=7434&p=46249#p46249 <![CDATA[Patching questions • Re: Array shuffle]]>

Statistics: Posted by oli_lab — 28 Mar 2026, 14:59


]]>
2026-03-28T13:42:59+02:00 2026-03-28T13:42:59+02:00 https://brainmodular.com/forums/viewtopic.php?t=7434&p=46248#p46248 <![CDATA[Patching questions • Array shuffle]]>
I'm using a 6x6 audio mix matrix in mode faders. Some of my cells/faders are at the minimum (value=0) , and a few have a non 0 value. I'd like to shuffle those values between
their respective positions (cells/faders at 0don't move). What could be the simplest way to achieve that?
It's easy to identify the cells with value =0 (module find index) but not so simple (seems to me...) to identify cells that are non 0 values.
Wouldn't it be fine to have on module find index an option to search non 0 values indexes?
I hope it's clear...
Thanks in advance

Statistics: Posted by Gilsornette — 28 Mar 2026, 12:42


]]>
2026-03-13T10:26:35+02:00 2026-03-13T10:26:35+02:00 https://brainmodular.com/forums/viewtopic.php?t=7430&p=46233#p46233 <![CDATA[Patching questions • Re: 14 bit MIDI data]]> Bonne journée

Statistics: Posted by gwennaelle — 13 Mar 2026, 09:26


]]>
2026-03-13T03:18:24+02:00 2026-03-13T03:18:24+02:00 https://brainmodular.com/forums/viewtopic.php?t=7430&p=46232#p46232 <![CDATA[Patching questions • Re: 14 bit MIDI data]]> multiplying by 128 and add to data1 is a good start, but needs a little bit more tweaking, see the patch !
++
Olivar

Statistics: Posted by oli_lab — 13 Mar 2026, 02:18


]]>
2026-03-12T19:39:31+02:00 2026-03-12T19:39:31+02:00 https://brainmodular.com/forums/viewtopic.php?t=7430&p=46230#p46230 <![CDATA[Patching questions • 14 bit MIDI data]]> We have a MIDI device that sends double-precision pitch bend (14-bit data).
We therefore need to take the MIDI code 224 and combine Data1 and Data2 to reconstruct the 14-bit value.
We would like to do this by performing a 7-bit bit-shift (or multiply by 128) on Data2 and add it to Data1.
How can we do this?
thank you
GR

Statistics: Posted by gwennaelle — 12 Mar 2026, 18:39


]]>
2026-02-14T21:52:14+02:00 2026-02-14T21:52:14+02:00 https://brainmodular.com/forums/viewtopic.php?t=7429&p=46227#p46227 <![CDATA[Patching questions • Re: quicklink behavior]]> Having a wire solution slower than a wireless one is a kind of counterintuitive!

And I'll keep this practice in mind, using a wait in any case.

Statistics: Posted by XpiR — 14 Feb 2026, 20:52


]]>
2026-02-10T16:17:01+02:00 2026-02-10T16:17:01+02:00 https://brainmodular.com/forums/viewtopic.php?t=7429&p=46225#p46225 <![CDATA[Patching questions • Re: quicklink behavior]]> that is because quicklinks are faster and be computed on the same cycle vs wires may take a bit more time.
the ms counter is sending a trig at the end of duration, and once this is done it waits for a trig on the start input, that can only be done on next cycle
best practice is to use a wait, even with wires.

anyway, you could achieve the same sampler behaviour with putting the sampler in loop mode.
I recommend also that you explore what can be done with the "restarting" output

Statistics: Posted by oli_lab — 10 Feb 2026, 15:17


]]>
2026-02-06T12:33:34+02:00 2026-02-06T12:33:34+02:00 https://brainmodular.com/forums/viewtopic.php?t=7429&p=46223#p46223 <![CDATA[Patching questions • quicklink behavior]]>
There is something I can't explain. If you check those 2 super basic racks :
Rack 1, the counter has a quicklink "finished trigger" that restarts the count. It only works with a wait module (no wait = no restart counter)
Rack 2 is the same patch without quicklink, directly wired : there is no wait module needed.

Can you tell me why ?
(I'm of course not discussing what is doing this basic patch, it's just a behavior example)
Wait_behavior.wkp

Statistics: Posted by XpiR — 06 Feb 2026, 11:33


]]>
BrainModular BrainModular Users Forum 2026-04-30T18:03:04+02:00 https://brainmodular.com/forums/app.php/feed/forum/6 2026-04-30T18:03:04+02:00 2026-04-30T18:03:04+02:00 https://brainmodular.com/forums/viewtopic.php?t=7441&p=46294#p46294 <![CDATA[Patching questions • Re: Midi learn only from rack]]>
We need a new forum section "Usine Hacking" :-)

Statistics: Posted by sm_jamieson — 30 Apr 2026, 18:03


]]>
2026-04-30T13:06:44+02:00 2026-04-30T13:06:44+02:00 https://brainmodular.com/forums/viewtopic.php?t=7441&p=46293#p46293 <![CDATA[Patching questions • Re: Midi learn only from rack]]> I use all midi learns to feed a big Gloabal Array
and then, in each rack, I get the Global Array value(s) wich I need to control my faders and knob
eg something like choosing in a combo box the first instrument : Tuba > all my faders are feeded from values 1 = volume, 9 (1+8) reverb, 17 (1+16) delay
choosing the second instrument : Serpent > all my faders are feeded from values 2 = volume, 10 (2+8) reverb, 18 (2+16) delay

(this way I can also feed one value in the GA from 2 separated controllers.


Here I just tried some stuffs to help find a solution to your problem :-)

Statistics: Posted by grego mondo — 30 Apr 2026, 13:06


]]>
2026-04-30T10:51:21+02:00 2026-04-30T10:51:21+02:00 https://brainmodular.com/forums/viewtopic.php?t=7441&p=46292#p46292 <![CDATA[Patching questions • Re: Midi learn only from rack]]> Statistics: Posted by sm_jamieson — 30 Apr 2026, 10:51


]]>
2026-04-29T10:18:45+02:00 2026-04-29T10:18:45+02:00 https://brainmodular.com/forums/viewtopic.php?t=7441&p=46291#p46291 <![CDATA[Patching questions • Re: Midi learn only from rack]]>
If you create a midi in device getting a midi bus (called "virtual" for eg) the midi learn goes the same way with no name

but if you add the midi bus "virtual" to IN MIDI LAN & BRIDGE then it's learned with the name "MIDI LAN & BRIDGE"

Then if you plug a real midi device (let's say "MPK MINI") and put the "virtual" bus in it
As long as the MPK MINI is plugged to the computer all the learn using "virtual" values go through it and are learned with its name (MPK MINI)
Then if you unplugged the MPK MINI all the learns still works and you can make new learns ...
I added a pass flow between "virtual" bus and "MIDI TO USINE" in the MPK MINI input device so I can turn the "virtual" going through "MPK MINI" on and off
it means you need to have unused controllers that you'll plug once and then put back in your drawer ...

Statistics: Posted by grego mondo — 29 Apr 2026, 10:18


]]>
2026-04-29T03:19:23+02:00 2026-04-29T03:19:23+02:00 https://brainmodular.com/forums/viewtopic.php?t=7441&p=46290#p46290 <![CDATA[Patching questions • Re: Midi learn only from rack]]>
I did some experiments with fake devices (a patch receiving from a midi bus dropped into the devices area of a rack).
If the real midi input devices are removed, you can actually midi learn from the fake devices but they have no real device behind them
and the the wkp file they are stored as
Tdevice name =
instead if something like Tdevice name=FOCUSRITE USB MIDI

If you learn from another fake device in the same way, it is also stored without a name so they are really clones of each other,
both with device name of "nothing", and both sliders move together.

But in principle if there was a way to give the fake device a fake external device name, this could be supported by Usine.
Note - the input device patch as seen in the devices section may be called "IN FOCUSRITE USB MIDI" but the real
device behind it is called "FOCUSRITE USB MIDI" - they are not the same thing.

If the midi was sent out and looped back in via a virtual midi cable, of course this would work, since then there is a real midi device.

Interesting anyway.

Statistics: Posted by sm_jamieson — 29 Apr 2026, 03:19


]]>
2026-04-28T00:26:22+02:00 2026-04-28T00:26:22+02:00 https://brainmodular.com/forums/viewtopic.php?t=7441&p=46288#p46288 <![CDATA[Patching questions • Re: Midi learn only from rack]]> you can use clusters, global arrays or busses !
do the midi learns once and for all (here they are patched from CC1 to CC8
++
Olivar
see examples :
learns to GA.wkp

learns to busses.wkp

learns to clusters.wkp

Statistics: Posted by oli_lab — 28 Apr 2026, 00:26


]]>
2026-04-27T22:42:58+02:00 2026-04-27T22:42:58+02:00 https://brainmodular.com/forums/viewtopic.php?t=7441&p=46287#p46287 <![CDATA[Patching questions • Re: Midi learn only from rack]]> Statistics: Posted by sm_jamieson — 27 Apr 2026, 22:42


]]>
2026-04-27T12:18:52+02:00 2026-04-27T12:18:52+02:00 https://brainmodular.com/forums/viewtopic.php?t=7441&p=46285#p46285 <![CDATA[Patching questions • Re: Midi learn only from rack]]>
There is no MIDI Learn function specific to racks.
However, for each MIDI Learn, you can specify the device.

As for using MIDI In/Out modules, this allows you to retrieve data within patches. This enables more precise and potentially complex control than simply mapping a MIDI Learn, but it requires patching.

MIDI Learn allows for quick and flexible setup.
In some cases, it can be difficult to manage—for example, if a device keeps sending data. However, you can simply turn off the corresponding device (in Usine).


Happy patching !
Baptiste

Statistics: Posted by BM2F — 27 Apr 2026, 12:18


]]>
2026-04-27T02:51:18+02:00 2026-04-27T02:51:18+02:00 https://brainmodular.com/forums/viewtopic.php?t=7441&p=46284#p46284 <![CDATA[Patching questions • Midi learn only from rack]]> I have a midi bus going to each of my racks, (the top patch in each rack has a midi from bus connected to a midi out)
so that all lower patches in the rack get the midi data for that rack.
I want to do midi learn only on the midi data in that rack, but Usine midi learn is global.
Is there any way to have rack specific midi learn ?

If not, this may be something for HH7.

Thanks,
SImon.

Statistics: Posted by sm_jamieson — 27 Apr 2026, 02:51


]]>
2026-04-21T19:41:58+02:00 2026-04-21T19:41:58+02:00 https://brainmodular.com/forums/viewtopic.php?t=7439&p=46279#p46279 <![CDATA[Patching questions • Re: Sample editor in Usine]]>
here is the "NOT working" code :

CODE:

void diywt::writeWavFile(const std::string& filename) {realSize = m_maxWrite;sdkTraceInt(realSize);sdkTraceInt(m_lastMarkerNumber);// Structures pour les en-têtesstruct RiffHeader {char chunkId[4] = { 'R', 'I', 'F', 'F' };uint32_t chunkSize;char format[4] = { 'W', 'A', 'V', 'E' };};struct FmtChunk {char chunkId[4] = { 'f', 'm', 't', ' ' };uint32_t chunkSize = 16;uint16_t audioFormat = 3; // 32-bit floatuint16_t numChannels;uint32_t sampleRate;uint32_t byteRate;uint16_t blockAlign;uint16_t bitsPerSample;};struct DataChunk {char chunkId[4] = { 'd', 'a', 't', 'a' };uint32_t chunkSize;};std::ofstream outFile(filename, std::ios::binary);if (!outFile) {sdkTraceErrorChar("can't open file");return;}// Paramètres audioint numChannels = 1;int bitsPerSample = 32;int numSamples = m_markersStart[m_lastMarkerNumber];//realSize;// Calculer la taille des données audiouint32_t dataSize = numSamples * numChannels * bitsPerSample / 8;// Remplir les en-têtesRiffHeader riffHeader;FmtChunk fmtChunk;fmtChunk.numChannels = numChannels;fmtChunk.sampleRate = sdkGetSampleRate();fmtChunk.byteRate = fmtChunk.sampleRate * numChannels * bitsPerSample / 8;fmtChunk.blockAlign = numChannels * bitsPerSample / 8;fmtChunk.bitsPerSample = bitsPerSample;DataChunk dataChunk;dataChunk.chunkSize = dataSize;// Calculer la taille totale du fichieruint32_t totalFileSize = sizeof(RiffHeader) + sizeof(FmtChunk) + sizeof(DataChunk) + dataSize;// +sizeof(CueChunk) + cueChunkSize + sizeof(AdtlChunk) + adtlChunkSize;riffHeader.chunkSize = totalFileSize - 8; // Soustraire les 8 octets du chunkId et du chunkSize// Écrire les en-têtes dans le fichieroutFile.write(reinterpret_cast<char*>(&riffHeader), sizeof(RiffHeader));outFile.write(reinterpret_cast<char*>(&fmtChunk), sizeof(FmtChunk));outFile.write(reinterpret_cast<char*>(&dataChunk), sizeof(DataChunk));// Écrire les données audiofor (f = 0; f < numSamples; ++f) {outFile.write(reinterpret_cast<const char*>(&m_audioBuffer[f]), sizeof(float));}// Ajouter un padding si nécessaire pour aligner le chunk suivant sur un nombre pair d'octetsif (dataSize % 2 != 0) {outFile.put(0);}outFile.close();/*//mettre à jour la sortie markerOutint tempSize = m_lastMarkerNumber;markersOut.setSize(tempSize);for (int m = 0; m < tempSize; m++) {markersOut.setArrayData(m, float(m_markersStart[m])/float(numSamples));}*/if (!outFile) {sdkTraceErrorChar("Error closing file");return;}std::string s = fdrFileName.getPChar();s = s + " successfully created";sdkTraceChar(s.c_str());m_signalisation = 2;}

Statistics: Posted by oli_lab — 21 Apr 2026, 19:41


]]>
2026-04-21T19:06:07+02:00 2026-04-21T19:06:07+02:00 https://brainmodular.com/forums/viewtopic.php?t=7439&p=46278#p46278 <![CDATA[Patching questions • Re: Sample editor in Usine]]>
But I think Usine should have read and write sample modules that support wav and aif at least and the metadata for looping
It could be written with the SDK ...

Statistics: Posted by sm_jamieson — 21 Apr 2026, 19:06


]]>
2026-04-21T17:29:55+02:00 2026-04-21T17:29:55+02:00 https://brainmodular.com/forums/viewtopic.php?t=7439&p=46277#p46277 <![CDATA[Patching questions • Re: Sample editor in Usine]]> The sampler modules can't save metadata so it is not possible out of th box.
But I did an addon called "player with saved markers" that can save and retrieved markers.
It is not possible to do loops at sample level but.

for this king of thing, I rather use REAPER and make regionss to be render or a specialized sample editor.

Otherwise, I pretty much like the idea of using Usine as a modular studio to produce processed samples (just like with an old school hardware studio)

Image
Capture d'écran 2026-04-21 173317.png

Statistics: Posted by oli_lab — 21 Apr 2026, 17:29


]]>
2026-04-21T10:46:05+02:00 2026-04-21T10:46:05+02:00 https://brainmodular.com/forums/viewtopic.php?t=7439&p=46276#p46276 <![CDATA[Patching questions • Sample editor in Usine]]> It seems Usine would be a good platform to set sample loop points etc.

Can it or a patch do the following:
1. Set and play a loop
2. Add loop start and end cue points to metadata
3. Snap cue to zero crossing point
4. Modify sample to cross fade across loop points.
5. Save the sample in the same or different format with loop cue points in the metadata that can be used by another sampler ?

Thanks.

Statistics: Posted by sm_jamieson — 21 Apr 2026, 10:46


]]>
2026-04-10T11:00:52+02:00 2026-04-10T11:00:52+02:00 https://brainmodular.com/forums/viewtopic.php?t=7363&p=46266#p46266 <![CDATA[Patching questions • Re: how to get value for global array string]]>
set and get GA string.wkp
what should be remember is :
- declare the GA with a unique name
- populate the GA with "set" modules
- get values with "get" modules
- be aware of the "pass if changed" switch inside the "get" modules
- avoid connecting anything to the GA declaration module, just leave it alone.

Usually, I put all the GA declaration modules in one same patch for code cleanliness

If you need multi-dimension arrays, you can explore putting an array inside a polyphonic subpatch
or use Json

Olivar

Statistics: Posted by oli_lab — 10 Apr 2026, 11:00


]]>
2026-04-01T21:22:05+02:00 2026-04-01T21:22:05+02:00 https://brainmodular.com/forums/viewtopic.php?t=7363&p=46258#p46258 <![CDATA[Patching questions • Re: how to get value for global array string]]> Can you explain what exactly you want to achieve so I can provide you with a patch ?
++
Olivar

Statistics: Posted by oli_lab — 01 Apr 2026, 21:22


]]>
2026-04-01T20:15:11+02:00 2026-04-01T20:15:11+02:00 https://brainmodular.com/forums/viewtopic.php?t=7363&p=46257#p46257 <![CDATA[Patching questions • Re: how to get value for global array string]]>
Workaround in progress. maybe I'll check back next year....

If this exists, it should be added to the manual.

Statistics: Posted by woodslanding — 01 Apr 2026, 20:15


]]>
2026-03-28T17:42:47+02:00 2026-03-28T17:42:47+02:00 https://brainmodular.com/forums/viewtopic.php?t=7434&p=46250#p46250 <![CDATA[Patching questions • Re: Array shuffle]]> Thank you Olivar!

Statistics: Posted by Gilsornette — 28 Mar 2026, 16:42


]]>
2026-03-28T15:59:30+02:00 2026-03-28T15:59:30+02:00 https://brainmodular.com/forums/viewtopic.php?t=7434&p=46249#p46249 <![CDATA[Patching questions • Re: Array shuffle]]>

Statistics: Posted by oli_lab — 28 Mar 2026, 14:59


]]>
2026-03-28T13:42:59+02:00 2026-03-28T13:42:59+02:00 https://brainmodular.com/forums/viewtopic.php?t=7434&p=46248#p46248 <![CDATA[Patching questions • Array shuffle]]>
I'm using a 6x6 audio mix matrix in mode faders. Some of my cells/faders are at the minimum (value=0) , and a few have a non 0 value. I'd like to shuffle those values between
their respective positions (cells/faders at 0don't move). What could be the simplest way to achieve that?
It's easy to identify the cells with value =0 (module find index) but not so simple (seems to me...) to identify cells that are non 0 values.
Wouldn't it be fine to have on module find index an option to search non 0 values indexes?
I hope it's clear...
Thanks in advance

Statistics: Posted by Gilsornette — 28 Mar 2026, 12:42


]]>
2026-03-13T10:26:35+02:00 2026-03-13T10:26:35+02:00 https://brainmodular.com/forums/viewtopic.php?t=7430&p=46233#p46233 <![CDATA[Patching questions • Re: 14 bit MIDI data]]> Bonne journée

Statistics: Posted by gwennaelle — 13 Mar 2026, 09:26


]]>
2026-03-13T03:18:24+02:00 2026-03-13T03:18:24+02:00 https://brainmodular.com/forums/viewtopic.php?t=7430&p=46232#p46232 <![CDATA[Patching questions • Re: 14 bit MIDI data]]> multiplying by 128 and add to data1 is a good start, but needs a little bit more tweaking, see the patch !
++
Olivar

Statistics: Posted by oli_lab — 13 Mar 2026, 02:18


]]>
2026-03-12T19:39:31+02:00 2026-03-12T19:39:31+02:00 https://brainmodular.com/forums/viewtopic.php?t=7430&p=46230#p46230 <![CDATA[Patching questions • 14 bit MIDI data]]> We have a MIDI device that sends double-precision pitch bend (14-bit data).
We therefore need to take the MIDI code 224 and combine Data1 and Data2 to reconstruct the 14-bit value.
We would like to do this by performing a 7-bit bit-shift (or multiply by 128) on Data2 and add it to Data1.
How can we do this?
thank you
GR

Statistics: Posted by gwennaelle — 12 Mar 2026, 18:39


]]>
2026-02-14T21:52:14+02:00 2026-02-14T21:52:14+02:00 https://brainmodular.com/forums/viewtopic.php?t=7429&p=46227#p46227 <![CDATA[Patching questions • Re: quicklink behavior]]> Having a wire solution slower than a wireless one is a kind of counterintuitive!

And I'll keep this practice in mind, using a wait in any case.

Statistics: Posted by XpiR — 14 Feb 2026, 20:52


]]>
2026-02-10T16:17:01+02:00 2026-02-10T16:17:01+02:00 https://brainmodular.com/forums/viewtopic.php?t=7429&p=46225#p46225 <![CDATA[Patching questions • Re: quicklink behavior]]> that is because quicklinks are faster and be computed on the same cycle vs wires may take a bit more time.
the ms counter is sending a trig at the end of duration, and once this is done it waits for a trig on the start input, that can only be done on next cycle
best practice is to use a wait, even with wires.

anyway, you could achieve the same sampler behaviour with putting the sampler in loop mode.
I recommend also that you explore what can be done with the "restarting" output

Statistics: Posted by oli_lab — 10 Feb 2026, 15:17


]]>
2026-02-06T12:33:34+02:00 2026-02-06T12:33:34+02:00 https://brainmodular.com/forums/viewtopic.php?t=7429&p=46223#p46223 <![CDATA[Patching questions • quicklink behavior]]>
There is something I can't explain. If you check those 2 super basic racks :
Rack 1, the counter has a quicklink "finished trigger" that restarts the count. It only works with a wait module (no wait = no restart counter)
Rack 2 is the same patch without quicklink, directly wired : there is no wait module needed.

Can you tell me why ?
(I'm of course not discussing what is doing this basic patch, it's just a behavior example)
Wait_behavior.wkp

Statistics: Posted by XpiR — 06 Feb 2026, 11:33


]]>