|
|
|
07-29-2022, 10:23 AM
|
#241
|
Human being with feelings
Join Date: Nov 2013
Location: France
Posts: 181
|
Yes, that would be useful ! I was thinking I should write such a program for myself !
J.Jack.
|
|
|
07-29-2022, 01:05 PM
|
#242
|
Human being with feelings
Join Date: Jun 2013
Location: Krefeld, Germany
Posts: 14,686
|
Here you are.
I suppose you will easily find simpleini
If you need a utf8 version, let me know. (I have been thinking about this.)
It's a command line tool and to be called with one or two parameters
- file name (relative to currant folder)
- preset (denoted as in the file i.e. e. g. Preset1, default being Preset0) (It turned out that simply a number would be a better idea ...)
There is some testing code left which could be removed .
Are you intending to do a program that can write those files ?
-Michael
Code:
#include <iostream>
#include <sstream>
#include <vector>
#define WINDOWS
#ifdef WINDOWS
#define _UNICODE
#endif
#include "../simpleini/simpleini.h"
CSimpleIni ini;
std::list<CSimpleIni::Entry> sections;
uint8_t hexToUint8(const std::wstring h)
{
wchar_t wu;
uint8_t u1;
uint8_t u2;
wu = h.c_str()[0];
u1 = (uint8_t)wu;
if (u1 > '9') {
u1 -= 7;
}
u1 &= 0xF;
wu = h.c_str()[1];
u2 = (uint8_t)wu;
if (u2 > '9') {
u2 -= 7;
}
u2 &= 0xF;
return (u1 << 4) | u2;
}
std::wstring stringToWstring(const std::string d)
{
std::wstring r;
for (auto i = 0; i < d.length(); ++i) {
const auto c = d.c_str()[i];
const wchar_t wc = c;
r += c;
}
return r;
}
int main(int argc, char *argv[])
{
wchar_t cCurrentPath[FILENAME_MAX];
if (!GetCurrentDirectoryW(FILENAME_MAX, cCurrentPath)) {
return errno;
}
std::wstring currantPath(cCurrentPath);
std::wstring filen;
auto foundOrder = -1;
std::wstring compareKey = L"Data";
std::wstring compareSection = L"Preset0";
std::string o(argv[0]);
std::wstring oo;
oo = stringToWstring(o);
if (argc > 1) {
o = argv[1];
oo = stringToWstring(o);
filen = oo;
if (argc > 2) {
o = argv[2];
oo = stringToWstring(o);
compareSection = oo;
}
} else {
filen = L"../js-testwrite.ini";
filen = L"../js-ReaTeam JSFX_Utility_mschnell_Slider to Midi CC_jsfx.ini";
}
auto filename = currantPath + L"\\" + filen;
std::wcout << L"\nfile: " << filename << L"\n";
ini.SetUnicode();
ini.LoadFile(filename.data());
ini.GetAllSections(sections);
auto sectionIterator = sections.begin();
while (sectionIterator != sections.end()) {
auto item = sectionIterator->pItem;
item = sectionIterator->pItem;
std::wstring section;
if (item) {
section = item;
} else {
section = L"?";
}
sectionIterator++;
std::list<CSimpleIni::Entry> items;
ini.GetAllKeys(item, items);
auto itemIterator = items.begin();
while (itemIterator != items.end()) {
auto order = itemIterator->nOrder;
auto item = itemIterator->pItem;
std::wstring key;
if (item) {
key = item;
} else {
key = L"?";
}
if ((section == compareSection) && (key == compareKey)) {
foundOrder = order;
}
itemIterator++;
}
}
if (foundOrder >= 0) {
std::wcout << "Preset: " << compareSection << L"\n";
auto val = ini.GetValue(compareSection.c_str(), compareKey.c_str(), L"");
std::wstring value = val;
auto ll = ini.GetValue(compareSection.c_str(), L"Len", L"");
auto len = _wtoi(ll);
std::wstring lenString = ll;
auto nn = ini.GetValue(compareSection.c_str(), L"Name", L"");
std::wstring name = nn;
std::wcout << L"Name: " << name << L"\nLength: " << len << L"\nData:\n";
std::wcout << value << L"\n\n";
bool fun = true;
std::string ss = "";
auto sum = 0;
for (auto i = 0; i < len; ++i) {
uint8_t u;
u = hexToUint8(value.substr(i * 2, 2));
sum += u;
if ((u < ' ') || (u > 'z')) {
u = '?';
fun = false;
}
ss += u;
}
std::wcout << L"decoded:\n";
std::wcout << stringToWstring(ss) << L"\n\n";
auto n = 0;
for (auto i = 0; i < len; ++i) {
wchar_t wc = ss.c_str()[i];
if (wc == L' ') {
++n;
}
}
uint8_t u;
u = hexToUint8(value.substr(len * 2, 2));
sum &= 0xFF;
if (u != sum) {
std::wcout << L"Cecksum Error: \n";
return -1;
}
if (fun) {
std::vector<std::string> tokens;
std::stringstream check1(ss);
std::string intermediate;
while (std::getline(check1, intermediate, ' ')) {
tokens.push_back(intermediate);
}
if (tokens.size() < 64) {
std::wcout << L"Not enough Slider Values: \n";
return -1;
}
auto valCount = 0;
std::wcout << L"Slider Values:\n";
for (int i = 0; i < 64; i++) {
std::string s;
s = tokens[i];
if ((s != "-") && (i < 64)) {
++valCount;
try {
float f = std::stof(s.c_str());
std::wcout << f << L'\n';
} catch (int e) {
e;
}
}
}
std::wcout << L"defined Sliders: " << valCount;
}
}
return 0;
}
Last edited by mschnell; 07-29-2022 at 10:42 PM.
|
|
|
10-23-2022, 04:10 AM
|
#243
|
Human being with feelings
Join Date: May 2017
Location: Leipzig
Posts: 6,621
|
It's been a while, but here it comes: updated to Reaper 6.68
|
|
|
10-23-2022, 09:44 AM
|
#244
|
Human being with feelings
Join Date: Oct 2007
Location: home is where the heart is
Posts: 12,096
|
Thanks.
Justin recently documented the PT meanings in the TEMPOENVEX chunk if you want to add it to your docs (if not already there):
https://www.askjf.com/index.php?q=6429s
|
|
|
10-23-2022, 09:59 AM
|
#245
|
Human being with feelings
Join Date: May 2017
Location: Leipzig
Posts: 6,621
|
Quote:
Originally Posted by nofish
|
Nice, good to know! Thnx
|
|
|
10-26-2022, 04:24 PM
|
#246
|
Human being with feelings
Join Date: Dec 2018
Posts: 394
|
Noticed ReaLlm related API functions are listed under ReaFab title in improved API docs.
|
|
|
10-26-2022, 10:26 PM
|
#247
|
Human being with feelings
Join Date: May 2017
Location: Leipzig
Posts: 6,621
|
Thnx, will fix this...
|
|
|
10-27-2022, 12:48 AM
|
#248
|
Human being with feelings
Join Date: Dec 2018
Posts: 394
|
Quote:
Originally Posted by Meo-Ada Mespotine
Thnx, will fix this...
|
Nice. Although I'd guess it is not extremely important.
|
|
|
10-27-2022, 03:08 AM
|
#249
|
Human being with feelings
Join Date: May 2017
Location: Leipzig
Posts: 6,621
|
Quote:
Originally Posted by en5ca
Nice. Although I'd guess it is not extremely important.
|
It actually is, as every part of the index of the docs has a reference link, so you can send people this link to the functions you are referring to.
This might break if not fixed by me...
|
|
|
12-02-2022, 05:57 PM
|
#250
|
Human being with feelings
Join Date: May 2017
Location: Leipzig
Posts: 6,621
|
Updated to Reaper 6.71
I also improved the index of the config-vars docs, which means, you can now see all config vars of a certain preferences/project settings page right in the index.
So if you want all config-vars for Preferences -> General, just look for it in the index.
|
|
|
12-19-2022, 02:01 PM
|
#251
|
Human being with feelings
Join Date: May 2017
Location: Leipzig
Posts: 6,621
|
Updated Reaper Internals to Reaper 6.72
|
|
|
12-19-2022, 05:22 PM
|
#252
|
Human being with feelings
Join Date: Jan 2020
Location: In the studio at my desk
Posts: 360
|
Quote:
Originally Posted by Meo-Ada Mespotine
Updated Reaper Internals to Reaper 6.72
|
Might just be me but I keep getting this error upon re-sync.
https://raw.githubusercontent.com/Ul...tem_mouse.lua:
HTTP response code said error (22): The requested URL returned error: 404
Warren
By the way I did update to 6.72, error still persists.
|
|
|
12-20-2022, 02:48 AM
|
#253
|
Human being with feelings
Join Date: May 2017
Location: Leipzig
Posts: 6,621
|
Can you test, whether it works now?
|
|
|
12-20-2022, 08:16 AM
|
#254
|
Human being with feelings
Join Date: Jan 2020
Location: In the studio at my desk
Posts: 360
|
Quote:
Originally Posted by Meo-Ada Mespotine
Can you test, whether it works now?
|
That fixed it.
Thanks you, sorry for the hassle.
Warren
|
|
|
12-20-2022, 09:40 AM
|
#255
|
Human being with feelings
Join Date: May 2017
Location: Leipzig
Posts: 6,621
|
No problem. I had bugs in my ReaPack-index creator that needed some fixes anyways.
Great to hear it works now.
|
|
|
12-24-2022, 03:40 PM
|
#256
|
Human being with feelings
Join Date: May 2017
Location: Leipzig
Posts: 6,621
|
Updated docs to Reaper 6.73 and ReaImGui 0.8.1
|
|
|
01-10-2023, 05:16 PM
|
#257
|
Human being with feelings
Join Date: Apr 2013
Location: France
Posts: 9,875
|
Extra doc for the RenderFileSection function
Percentage is a number betwee 0 and 1.
You can send audio files, to it, in this case it render to wav, (not sure what settings are based on)
If you send it a .rpp, it will create a subprojetc file (.RPP-PROX), then from this output a wav file according to percentage.
If output files already exist it just do nothing
I am not sure from what settings are based the wav files output, seems to be the interface samplerate?
|
|
|
02-12-2023, 01:02 PM
|
#258
|
Human being with feelings
Join Date: Mar 2018
Posts: 20
|
Cool! Thank you SO MUCH for this! It must have taken forever!
You wouldn't happen to have any info on their presets file formats would you? I've got ReaFir about halfway torn apart thanks to some other forum denizens but the rest rather escape me.
|
|
|
02-13-2023, 02:16 AM
|
#259
|
Human being with feelings
Join Date: May 2017
Location: Leipzig
Posts: 6,621
|
Quote:
Originally Posted by HalfNote5
Cool! Thank you SO MUCH for this! It must have taken forever!
You wouldn't happen to have any info on their presets file formats would you? I've got ReaFir about halfway torn apart thanks to some other forum denizens but the rest rather escape me.
|
Which presets exactly? FX? If yes, fxp or the ini-file?
|
|
|
02-15-2023, 06:57 AM
|
#261
|
Human being with feelings
Join Date: Mar 2018
Posts: 20
|
Quote:
Originally Posted by Meo-Ada Mespotine
Which presets exactly? FX? If yes, fxp or the ini-file?
|
I meant the ini specifically. ^_^
I'm using them to write programs that add presets based on code that plays with EQ/FFT/other data points.
I've already got a program that takes Plot data from the spectrum analyzer on Audacity and can generate an EQ match curve for Audacity/Reafir/MossEQ, and a couple other multichannel graphic EQs, but it'd be nice to be able to get the data FROM ReaFir/ReEq,ReaSpect, etc.
I'd LOVE to be able to save the "Max" values from ReaSpect for example into a text file of Hz/db pairs.
|
|
|
02-15-2023, 07:06 AM
|
#262
|
Human being with feelings
Join Date: Mar 2018
Posts: 20
|
Quote:
Originally Posted by mschnell
Here you are.
I suppose you will easily find simpleini
If you need a utf8 version, let me know. (I have been thinking about this.)
It's a command line tool and to be called with one or two parameters
- file name (relative to currant folder)
- preset (denoted as in the file i.e. e. g. Preset1, default being Preset0) (It turned out that simply a number would be a better idea ...)
There is some testing code left which could be removed .
Are you intending to do a program that can write those files ?
-Michael
Code:
#include <iostream>
#include <sstream>
#include <vector>
#define WINDOWS
#ifdef WINDOWS
#define _UNICODE
#endif
#include "../simpleini/simpleini.h"
CSimpleIni ini;
std::list<CSimpleIni::Entry> sections;
uint8_t hexToUint8(const std::wstring h)
{
wchar_t wu;
uint8_t u1;
uint8_t u2;
wu = h.c_str()[0];
u1 = (uint8_t)wu;
if (u1 > '9') {
u1 -= 7;
}
u1 &= 0xF;
wu = h.c_str()[1];
u2 = (uint8_t)wu;
if (u2 > '9') {
u2 -= 7;
}
u2 &= 0xF;
return (u1 << 4) | u2;
}
std::wstring stringToWstring(const std::string d)
{
std::wstring r;
for (auto i = 0; i < d.length(); ++i) {
const auto c = d.c_str()[i];
const wchar_t wc = c;
r += c;
}
return r;
}
int main(int argc, char *argv[])
{
wchar_t cCurrentPath[FILENAME_MAX];
if (!GetCurrentDirectoryW(FILENAME_MAX, cCurrentPath)) {
return errno;
}
std::wstring currantPath(cCurrentPath);
std::wstring filen;
auto foundOrder = -1;
std::wstring compareKey = L"Data";
std::wstring compareSection = L"Preset0";
std::string o(argv[0]);
std::wstring oo;
oo = stringToWstring(o);
if (argc > 1) {
o = argv[1];
oo = stringToWstring(o);
filen = oo;
if (argc > 2) {
o = argv[2];
oo = stringToWstring(o);
compareSection = oo;
}
} else {
filen = L"../js-testwrite.ini";
filen = L"../js-ReaTeam JSFX_Utility_mschnell_Slider to Midi CC_jsfx.ini";
}
auto filename = currantPath + L"\\" + filen;
std::wcout << L"\nfile: " << filename << L"\n";
ini.SetUnicode();
ini.LoadFile(filename.data());
ini.GetAllSections(sections);
auto sectionIterator = sections.begin();
while (sectionIterator != sections.end()) {
auto item = sectionIterator->pItem;
item = sectionIterator->pItem;
std::wstring section;
if (item) {
section = item;
} else {
section = L"?";
}
sectionIterator++;
std::list<CSimpleIni::Entry> items;
ini.GetAllKeys(item, items);
auto itemIterator = items.begin();
while (itemIterator != items.end()) {
auto order = itemIterator->nOrder;
auto item = itemIterator->pItem;
std::wstring key;
if (item) {
key = item;
} else {
key = L"?";
}
if ((section == compareSection) && (key == compareKey)) {
foundOrder = order;
}
itemIterator++;
}
}
if (foundOrder >= 0) {
std::wcout << "Preset: " << compareSection << L"\n";
auto val = ini.GetValue(compareSection.c_str(), compareKey.c_str(), L"");
std::wstring value = val;
auto ll = ini.GetValue(compareSection.c_str(), L"Len", L"");
auto len = _wtoi(ll);
std::wstring lenString = ll;
auto nn = ini.GetValue(compareSection.c_str(), L"Name", L"");
std::wstring name = nn;
std::wcout << L"Name: " << name << L"\nLength: " << len << L"\nData:\n";
std::wcout << value << L"\n\n";
bool fun = true;
std::string ss = "";
auto sum = 0;
for (auto i = 0; i < len; ++i) {
uint8_t u;
u = hexToUint8(value.substr(i * 2, 2));
sum += u;
if ((u < ' ') || (u > 'z')) {
u = '?';
fun = false;
}
ss += u;
}
std::wcout << L"decoded:\n";
std::wcout << stringToWstring(ss) << L"\n\n";
auto n = 0;
for (auto i = 0; i < len; ++i) {
wchar_t wc = ss.c_str()[i];
if (wc == L' ') {
++n;
}
}
uint8_t u;
u = hexToUint8(value.substr(len * 2, 2));
sum &= 0xFF;
if (u != sum) {
std::wcout << L"Cecksum Error: \n";
return -1;
}
if (fun) {
std::vector<std::string> tokens;
std::stringstream check1(ss);
std::string intermediate;
while (std::getline(check1, intermediate, ' ')) {
tokens.push_back(intermediate);
}
if (tokens.size() < 64) {
std::wcout << L"Not enough Slider Values: \n";
return -1;
}
auto valCount = 0;
std::wcout << L"Slider Values:\n";
for (int i = 0; i < 64; i++) {
std::string s;
s = tokens[i];
if ((s != "-") && (i < 64)) {
++valCount;
try {
float f = std::stof(s.c_str());
std::wcout << f << L'\n';
} catch (int e) {
e;
}
}
}
std::wcout << L"defined Sliders: " << valCount;
}
}
return 0;
}
|
NICE!! Do you have a compiled .exe of this anywhere? If not, I can build it, but if you already had such, it would be convenient.
Also, I notice in the includes there is a simpleini.h
Is that available? (Been a while since I programmed c/cpp. I'm mostly VFP these days.)
|
|
|
04-08-2023, 06:57 AM
|
#263
|
Human being with feelings
Join Date: May 2017
Location: Leipzig
Posts: 6,621
|
Updated Reaper Internals to Reaper 6.78, SWS 2.13.2.0, ReaImGui 0.8.5, ReaFab 0.3.10, ReaLlm 0.4.1 and added PeloReaper 2023.02.19
|
|
|
04-09-2023, 11:04 PM
|
#264
|
Human being with feelings
Join Date: Jun 2013
Location: Krefeld, Germany
Posts: 14,686
|
Thanks !
-Michael
|
|
|
05-05-2023, 09:36 AM
|
#265
|
Human being with feelings
Join Date: May 2017
Location: Leipzig
Posts: 6,621
|
updated docs to Reaper 6.79 and added ReaMCULive 0.1.5
|
|
|
06-30-2023, 01:25 AM
|
#266
|
Human being with feelings
Join Date: May 2017
Location: Leipzig
Posts: 6,621
|
updated docs to Reaper 6.80 and Ultraschall-Api 4.9
|
|
|
06-30-2023, 10:34 PM
|
#267
|
Human being with feelings
Join Date: Jun 2013
Location: Krefeld, Germany
Posts: 14,686
|
Thanks a lot for your continuous work !
|
|
|
07-02-2023, 07:33 AM
|
#268
|
Human being with feelings
Join Date: May 2017
Location: Leipzig
Posts: 6,621
|
You're welcome
|
|
|
10-06-2023, 08:23 AM
|
#269
|
Human being with feelings
Join Date: May 2017
Location: Leipzig
Posts: 6,621
|
Updated docs to Reaper 6.82
|
|
|
10-07-2023, 11:41 PM
|
#270
|
Human being with feelings
Join Date: Jun 2013
Location: Krefeld, Germany
Posts: 14,686
|
Even if I currently don't dive deep into Reaper programming, I always am happy to see your updates.
I suppose the switch to v7 will get very interesting ....
-Michael
|
|
|
10-08-2023, 05:31 AM
|
#271
|
Human being with feelings
Join Date: May 2017
Location: Leipzig
Posts: 6,621
|
Yeah. Updating the docs for v7 will take a while.
|
|
|
Thread Tools |
|
Display Modes |
Linear Mode
|
Posting Rules
|
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts
HTML code is Off
|
|
|
All times are GMT -7. The time now is 06:26 AM.
|