Skip to content
GitLab
Menu
Projects
Groups
Snippets
Loading...
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in
Toggle navigation
Menu
Open sidebar
rapid-mix
RAPID-MIX_API
Commits
1d6e4534
Commit
1d6e4534
authored
Nov 27, 2017
by
mzed
Browse files
small cleanup
parent
f3cd4a65
Changes
4
Hide whitespace changes
Inline
Side-by-side
examples/JUCE/regression_synth/Source/MainComponent.cpp
View file @
1d6e4534
...
...
@@ -231,7 +231,7 @@ public:
const
double
centreFrequencyDelta
=
(
localTargetCentreFrequency
!=
centreFrequency
)
?
(
targetCentreFrequency
-
centreFrequency
)
/
bufferToFill
.
numSamples
:
0
;
const
double
resonanceDelta
=
(
localTargetResonance
!=
resonance
)
?
(
targetResonance
-
resonance
)
/
bufferToFill
.
numSamples
:
0
;
// Create our
F
M Maximilian noises and send the mixed output to the channels
// Create our
PW
M Maximilian noises and send the mixed output to the channels
for
(
int
sample
=
0
;
sample
<
bufferToFill
.
numSamples
;
++
sample
)
{
modulationFrequency
+=
modulationFrequencyDelta
;
...
...
examples/JUCE/regression_synth/regression_synth.jucer
View file @
1d6e4534
...
...
@@ -2,8 +2,9 @@
<JUCERPROJECT
id=
"Zh7kpS"
name=
"regression_synth"
projectType=
"guiapp"
version=
"1.0.0"
bundleIdentifier=
"com.goldsmiths.rapidmix"
includeBinaryInAppConfig=
"1"
jucerVersion=
"5.1.2"
displaySplashScreen=
"1"
reportAppUsage=
"1"
splashScreenColour=
"Dark"
cppLanguageStandard=
"11"
companyWebsite=
"rapidmixapi.com"
>
jucerVersion=
"5.2.0"
displaySplashScreen=
"1"
reportAppUsage=
"1"
splashScreenColour=
"Dark"
cppLanguageStandard=
"11"
companyWebsite=
"rapidmixapi.com"
companyCopyright=
""
>
<MAINGROUP
id=
"g6MNSM"
name=
"regression_synth"
>
<GROUP
id=
"{EEA5B7C1-BCCC-64B0-259E-056090611E46}"
name=
"Maximilian"
>
<GROUP
id=
"{E20267E7-DDC5-EF6E-1EAE-C4B745764568}"
name=
"libs"
>
...
...
@@ -104,9 +105,12 @@
<VS2015
targetFolder=
"Builds/VisualStudio2015"
>
<CONFIGURATIONS>
<CONFIGURATION
name=
"Debug"
winWarningLevel=
"4"
generateManifest=
"1"
winArchitecture=
"32-bit"
isDebug=
"1"
optimisation=
"1"
targetName=
"regression_synth"
headerPath=
"../../../../dependencies/Maximilian/"
/>
isDebug=
"1"
optimisation=
"1"
targetName=
"regression_synth"
headerPath=
"../../../../dependencies/Maximilian/"
debugInformationFormat=
"ProgramDatabase"
enablePluginBinaryCopyStep=
"0"
/>
<CONFIGURATION
name=
"Release"
winWarningLevel=
"4"
generateManifest=
"1"
winArchitecture=
"32-bit"
isDebug=
"0"
optimisation=
"3"
targetName=
"regression_synth"
headerPath=
"../../../../dependencies/Maximilian"
/>
isDebug=
"0"
optimisation=
"3"
targetName=
"regression_synth"
headerPath=
"../../../../dependencies/Maximilian"
debugInformationFormat=
"ProgramDatabase"
enablePluginBinaryCopyStep=
"0"
linkTimeOptimisation=
"1"
/>
</CONFIGURATIONS>
<MODULEPATHS>
<MODULEPATH
id=
"juce_core"
path=
"../JUCE/modules"
/>
...
...
@@ -128,9 +132,9 @@
<XCODE_MAC
targetFolder=
"Builds/MacOSX"
>
<CONFIGURATIONS>
<CONFIGURATION
name=
"Debug"
isDebug=
"1"
optimisation=
"1"
targetName=
"regression_synth"
headerPath=
"../../../../dependencies/Maximilian"
/>
headerPath=
"../../../../dependencies/Maximilian"
enablePluginBinaryCopyStep=
"1"
/>
<CONFIGURATION
name=
"Release"
isDebug=
"0"
optimisation=
"3"
targetName=
"regression_synth"
headerPath=
"../../../../dependencies/Maximilian"
/>
headerPath=
"../../../../dependencies/Maximilian"
enablePluginBinaryCopyStep=
"1"
/>
</CONFIGURATIONS>
<MODULEPATHS>
<MODULEPATH
id=
"juce_video"
path=
"../JUCE/modules"
/>
...
...
src/machineLearning/machineLearning.cpp
View file @
1d6e4534
...
...
@@ -15,7 +15,6 @@ namespace rapidmix {
bool
machineLearning
<
MachineLearningModule
>::
train
(
const
trainingData
&
newTrainingData
)
{
return
MachineLearningModule
::
train
(
newTrainingData
);
}
/////////////////////////////////////////////////////////////////////// RapidLib specializations
...
...
@@ -47,6 +46,12 @@ namespace rapidmix {
return
classification
::
train
(
trainingSet
);
}
template
<
>
std
::
string
machineLearning
<
classification
>::
run
(
const
std
::
vector
<
double
>
&
inputVector
,
const
std
::
string
&
label
)
{
int
classIndex
=
classification
::
run
(
inputVector
)[
0
];
return
labels
[
classIndex
];
};
/////////////////////////////////////////////////////////////////////// RapidLib regression
template
<
>
bool
machineLearning
<
regression
>::
train
(
const
trainingData
&
newTrainingData
)
{
...
...
@@ -70,12 +75,6 @@ namespace rapidmix {
return
seriesClassification
::
train
(
seriesSet
);
}
template
<
>
std
::
string
machineLearning
<
classification
>::
run
(
const
std
::
vector
<
double
>
&
inputVector
,
const
std
::
string
&
label
)
{
int
classIndex
=
classification
::
run
(
inputVector
)[
0
];
return
labels
[
classIndex
];
};
template
<
>
std
::
string
machineLearning
<
seriesClassification
>::
run
(
const
std
::
vector
<
std
::
vector
<
double
>
>
&
inputSeries
)
{
return
seriesClassification
::
run
(
inputSeries
);
...
...
@@ -87,5 +86,4 @@ namespace rapidmix {
bool
machineLearning
<
rapidGVF
>::
train
(
const
trainingData
&
newTrainingData
)
{
return
rapidGVF
::
train
(
newTrainingData
);
}
}
\ No newline at end of file
}
src/machineLearning/machineLearning.h
View file @
1d6e4534
...
...
@@ -10,6 +10,7 @@
#ifndef machineLearning_h
#define machineLearning_h
#include <vector>
#include "../rapidmix.h"
////////// Include all of the machine learning algorithms here
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
.
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment