## Any way to save presets in modular 2

Scope and XITE Development

Original topic on PlanetZ: https://forums.scopeusers.com/viewtopic.php?t=34538

#### Any way to save presets in modular 2

Posted: Sat Aug 27, 2016 11:32 pm
by DragonSF
I'm building an additive synth with modular 2 (or at least try). I'm wondering, the settings of some modules (ADSR and VCA) can be saved as preset in an external file?

#### Re: Any way to save presets in modular 2

Posted: Sun Aug 28, 2016 1:23 am
by JoPo
If you create a preset file of your modular, ADSR, VCA and all modules of the patch will be saved each time you create a new preset. But don't forget to create a bank with all your presets in it and save the bank in your HD. And each time you create a new preset, save your bank again ! In order to find it back next time you load your patch.
Some of modular modules have there own preset feature, like sequencers, some of Roy's modules such as free envelope, etc... http://www.cwmodular.org/Modules/CwmModules.zip
This works for any preset devices in Scope.

#### Re: Any way to save presets in modular 2

Posted: Sun Aug 28, 2016 1:47 am
by DragonSF
What if I only want to create a preset of some parts only? Not the whole module? How can I achieve that (if it's possible at all).

#### Re: Any way to save presets in modular 2

Posted: Sun Aug 28, 2016 3:01 am
by faxinadu
with the stock modular modules, no, that is not possible.
you can make your own modular modules for envelopes using sdk envelope modules and add a preset list to the module itself. cool idea actually

#### Re: Any way to save presets in modular 2

Posted: Sun Aug 28, 2016 3:36 am
by DragonSF
I've written a program to get the envelopes of a wave over time. I just want to create/superimpose these data to the free env in modular to control the amplitude over time for each harmonic. FreeEnv seems to be a good start and your advice is also valid. Let me check, which is more appropriate/convenient. But I'm getting closer...
Is there any way to read/modify such preset file outside Scope? Or at least does a description of the file structure exist?

#### Re: Any way to save presets in modular 2

Posted: Sun Aug 28, 2016 4:20 am
by JoPo
No.. You can't edit a preset file outside Scope.
Yes : in SDK you can create your own envelope module with its own preset feature... And then share it here !
And in BC modular shell, you can load another modular patch with its own preset and I/O : if you use always the same filter system in a lot of your modular patches, for instance, you can create it and then recall it when needed. They are called CLM modules :
http://bcmodular.wikispaces.com/CLM
Maybe, it can be a workarround for what you are trying to achieve...

#### Re: Any way to save presets in modular 2

Posted: Sun Aug 28, 2016 3:10 pm
by djmicron
for modular modules where the individual preset is not available, you can use a sub modular module, such as the ones available with the bc modular to load the envelope and save the presets for that sub modular.
edit:
sorry i missed the prev post

#### Re: Any way to save presets in modular 2

Posted: Sun Aug 28, 2016 7:48 pm
by jksuperstar
A CSV "player" would be a pretty ideal module for this purpose. Load a CSV file (from excel, etc), and play it as a sequence using a sample clock input. Maybe have multiple outputs (for multiple columns) too.

#### Re: Any way to save presets in modular 2

Posted: Mon Aug 29, 2016 7:42 pm
by DragonSF
Can someone please direct me to a sample or some doc, to show how to create a module, which can write and read data from a file?

#### Re: Any way to save presets in modular 2

Posted: Tue Aug 30, 2016 5:44 am
by sharc

> DragonSF wrote:Can someone please direct me to a sample or some doc, to show how to create a module, which can write and read data from a file?

IniIntInterface / IniStringInterface can do what you ask

#### Re: Any way to save presets in modular 2

Posted: Tue Aug 30, 2016 3:08 pm
by DragonSF

> sharc wrote:

> > DragonSF wrote:Can someone please direct me to a sample or some doc, to show how to create a module, which can write and read data from a file?

> IniIntInterface / IniStringInterface can do what you ask

And where can I find those? (Sorry, but I'm really a beginner here)
Update:
After searching the forum, I found the .pep files (which were hidden). Next question: how to use those?

#### Re: Any way to save presets in modular 2

Posted: Wed Aug 31, 2016 11:38 am
by sharc
You can load them in the SDK via ModuleLoader.mdl
...From there you can make them circuit or surface components by adding GOs and attributes in the GOs window.
Unfortunately there isn't any .nfo files for these scripts so the functionality is limited to reading strings and integers upon module load and then prompting reading and writing via right-click.

#### Re: Any way to save presets in modular 2

Posted: Wed Aug 31, 2016 3:38 pm
by DragonSF
I could load them and assigned GOs and attributes, but when I try to load it, I'm getting 'nil references'. Right click doesn't offer anything useful...

#### Re: Any way to save presets in modular 2

Posted: Thu Sep 01, 2016 10:21 am
by sharc
You need to take them out of the ModuleLoader - After loading one of the scripts fold the ModuleLoader. In the Project Explorer if you now look into the folded ModuleLoader you'll see the script. If you right-click on it you'll get read & write options.
If you assign GOs and attributes to it and drag it out of the ModuleLoader into your circuit parent or a surface panel, you'll then be able to right-click the GO for read / write.

#### Re: Any way to save presets in modular 2

Posted: Fri Sep 02, 2016 12:03 am
by DragonSF

> sharc wrote:You need to take them out of the ModuleLoader - After loading one of the scripts fold the ModuleLoader. In the Project Explorer if you now look into the folded ModuleLoader you'll see the script. If you right-click on it you'll get read & write options.
> If you assign GOs and attributes to it and drag it out of the ModuleLoader into your circuit parent or a surface panel, you'll then be able to right-click the GO for read / write.

That doesn't seem to work. When I drag and drop the pep file to the moduleloader, I see the wait-cursor and then nothing. I.e. the moduleloader is empty as before. I'm using version 3.0 (prelease) according to 'about'.

#### Re: Any way to save presets in modular 2

Posted: Fri Sep 02, 2016 5:07 am
by sharc
Enter the filename (including extension) of the pep script into the modules array of the ModuleLoader ...It's best in this instance to have the array size set to 1. Set 'load' to 0 in the ModuleLoader Pad List. This will load the module and if you re-select the ModuleLoader the Pad List will update to show the additional pads of the loaded module.

#### Re: Any way to save presets in modular 2

Posted: Fri Sep 02, 2016 4:00 pm
by DragonSF

> sharc wrote:Enter the filename (including extension) of the pep script into the modules array of the ModuleLoader ...It's best in this instance to have the array size set to 1. Set 'load' to 0 in the ModuleLoader Pad List. This will load the module and if you re-select the ModuleLoader the Pad List will update to show the additional pads of the loaded module.

OK, I was able to enter the filename into the array and got the pep loaded. After that, I could drag out the interface (in Project Explorer) and add some GO (like frame, text) to it. But I can see the module in the circuit design only after clicking 'create circuit representation'. I also can see 'read' and 'write' menu options, but they don't do anything.As it turns out, the pep file is still within the loader, even the project explorer says otherwise. Question now: how can I separate module loader and pep with mouse?
I see this:

  Image1.png (50 KiB) Viewed 9333 times

#### Re: Any way to save presets in modular 2

Posted: Sat Sep 03, 2016 4:10 am
by sharc
After dragging IniStringInterface.pep out of the ModuleLoader rename it to IniStringInterface and save it as a .mdl.
You can now load this module and set the path field for the location of your text file.
Check out the cset.ini in notepad to see the format of Section and Key entries or simply enter them in the PadList, set the path and then choose write to update the text file with the correct formatting.
...Value is the string which will show for the key.

#### Re: Any way to save presets in modular 2

Posted: Sat Sep 03, 2016 6:47 pm
by DragonSF
OK, thanks a lot. That works so far. I.e. I can create an interface module for each partial, use the same path, but different keys and get my values for each envelope curve. Nice.
Netx question: how can I connect the value with the EG? Does is EG (1 for each partial) need a new new pad to connect to the value? Does such EG exist or do I need to create my own EG? I would like to use the Multi Segment EG, which has T L S entries, but I can't connect them to the Interface.

#### Re: Any way to save presets in modular 2

Posted: Tue Sep 06, 2016 12:04 am
by DragonSF

  Image2.png (16.36 KiB) Viewed 9274 times

I'm a little step farther now: I can read/write array elements from/to file, but I haven't find a way to iterate the index in the ArrayIterator. I can do this manually and get the actual data, but I want to use something, which does this for each index (incl. read/write). Any ideas, how to accomplish that?
Or is there a function, which converts arrays to string (CSV) and vice versa?

#### Re: Any way to save presets in modular 2

Posted: Tue Sep 06, 2016 4:55 am
by faxinadu
hey i don't have an answer but would just like to say, props on the persistence and what you are learning here! good stuff! i don't think most devs on scope (including us so far) get to that area of what you are exploring now, awesome and keep going!!!

#### Re: Any way to save presets in modular 2

Posted: Tue Sep 06, 2016 12:37 pm
by sharc

> DragonSF wrote:
> Image2.png
> I'm a little step farther now: I can read/write array elements from/to file, but I haven't find a way to iterate the index in the ArrayIterator. I can do this manually and get the actual data, but I want to use something, which does this for each index (incl. read/write). Any ideas, how to accomplish that?
> Or is there a function, which converts arrays to string (CSV) and vice versa?

In this case you're probably better using the IniIntInterface.pep unless there's a need for strings.
For string arrays you can use the tabletextfader to edit the strings in a string array via selected index, but off the top of my head I can't think of a way to split a string array to individual string pads like the ArrayIntSplitter does with integer pads.

#### Re: Any way to save presets in modular 2

Posted: Tue Sep 06, 2016 2:59 pm
by DragonSF

> faxinadu wrote:hey i don't have an answer but would just like to say, props on the persistence and what you are learning here! good stuff! i don't think most devs on scope (including us so far) get to that area of what you are exploring now, awesome and keep going!!!

Thanks! Regarding 'persistence': does anybody know, how to make a module persistent? I'm getting always complains for modules being non-persistent.

#### Re: Any way to save presets in modular 2

Posted: Tue Sep 06, 2016 3:22 pm
by sharc
Set Persistent to true (1) in the ModuleLoader PadList to avoid the non-persistent errors

#### Re: Any way to save presets in modular 2

Posted: Tue Sep 06, 2016 6:09 pm
by DragonSF
Got it. Now the main question: how does the ArrayIterator work, i.e. when does the iteration start?

#### Re: Any way to save presets in modular 2

Posted: Sat Sep 10, 2016 12:17 am
by DragonSF
I found a way to save all array elements to the text-file, but they are not reloaded at load time (even if I click the read-menu).Is it possible, that the MS EG has read-only arrays? Any way to change that?

#### Re: Any way to save presets in modular 2

Posted: Sun Sep 11, 2016 4:47 am
by DragonSF
Thanks for all the support, but I'm leaving the pep approach path. There is no documentation for it, more guessing than having a clear picture and strange behavior.
My new approach is ScopeFX (with Juse) and I'm quite happy: there are some docs, I can debug with VC and write my own code (and it's seem to be working). Thanks to Will, who showed methis way.

#### Re: Any way to save presets in modular 2

Posted: Thu Dec 14, 2017 8:50 am
by soren_jepsen
Sorry to revive an old thread. ScopeFX with Juce? Could you show me this "way"? THANKS!
Cheers
Søren