Skip to content

Commit

Permalink
- HISE Toolbox project: added envelope graph
Browse files Browse the repository at this point in the history
  • Loading branch information
Christoph Hart committed May 28, 2023
1 parent aaf594f commit 4742496
Show file tree
Hide file tree
Showing 5 changed files with 36 additions and 6 deletions.
6 changes: 6 additions & 0 deletions Loris Toolbox/Scripts/LorisProcessor.js
Original file line number Diff line number Diff line change
Expand Up @@ -74,6 +74,7 @@ namespace LorisProcessor
reg CURRENT_FILE;
reg CURRENT_FUNCTION;
reg CURRENT_SETUP;
reg CURRENT_POST;
reg PENDING = false;

const var RetainNoiseButton = Content.getComponent("RetainNoiseButton");
Expand Down Expand Up @@ -175,6 +176,11 @@ namespace LorisProcessor
lorisManager.processCustom(CURRENT_FILE, CURRENT_FUNCTION);
}

if(isDefined(CURRENT_POST))
{
CURRENT_POST();
}

worker.setStatusMessage("Resynthesizing...");
worker.setProgress(0.66);

Expand Down
13 changes: 12 additions & 1 deletion Loris Toolbox/Scripts/PitchLock.js
Original file line number Diff line number Diff line change
Expand Up @@ -37,11 +37,19 @@ namespace PitchLock
s.setControlCallback(onPitchLockSlider);
}

inline function postProcess()
{
Console.print("CREATE PATH");
local pitchPath = LorisProcessor.lorisManager.createEnvelopePaths(LorisProcessor.CURRENT_FILE, "rootFrequency", 0)[0];

BufferPreview.setEnvelope(Content.getComponent("PreviewPanel"), pitchPath);
}



inline function pitchLock(obj)
{
obj.frequency *= pitchFactor;


obj.bandwidth *= noiseGain;

Expand All @@ -51,13 +59,16 @@ namespace PitchLock

obj.frequency = pitchLockAmount * lockedFrequency + (1.0 - pitchLockAmount) * obj.frequency;

obj.frequency *= pitchFactor;

}

Manifest.pageBroadcaster.addListener(pitchLock, "set function", function(index)
{
if(index == 1)
{
LorisProcessor.CURRENT_POST = postProcess;

LorisProcessor.CURRENT_FUNCTION = this;
}
});
Expand Down
13 changes: 13 additions & 0 deletions Loris Toolbox/Scripts/UI/BufferPreview.js
Original file line number Diff line number Diff line change
Expand Up @@ -29,6 +29,12 @@ inline function setBuffer(unused, unused, file)
}


inline function setEnvelope(panel, env)
{
panel.data.envelope = env;
panel.repaint();
}

inline function setResynthesisedBuffer(panel, bufferData, samplerate)
{
local isMultiChannel = isDefined(bufferData[0].length);
Expand Down Expand Up @@ -178,6 +184,13 @@ inline function make(name)



}

if(this.data.envelope)
{
g.setColour(this.get("itemColour"));
g.drawPath(this.data.envelope, this.getLocalBounds(0), 2.0);

}
});

Expand Down
4 changes: 2 additions & 2 deletions Loris Toolbox/XmlPresetBackups/Loris Toolbox.xml
Original file line number Diff line number Diff line change
Expand Up @@ -28,8 +28,8 @@
<Processor Type="AudioLooper" ID="Original" Bypassed="0" Gain="1.0" Balance="0.0"
VoiceLimit="256.0" KillFadeTime="20.0" IconColour="0" SyncMode="1.0"
PitchTracking="0.0" LoopEnabled="0.0" RootNote="64.0" SampleStartMod="0.0"
Reversed="0.0" FileName="{PROJECT_FOLDER}sound_examples/flute.wav"
min="0" max="243743" loopStart="0" loopEnd="243743">
Reversed="0.0" FileName="{PROJECT_FOLDER}sound_examples/rhodes.wav"
min="0" max="392913" loopStart="0" loopEnd="392913">
<ChildProcessors>
<Processor Type="MidiProcessorChain" ID="Midi Processor" Bypassed="0">
<ChildProcessors/>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -62,7 +62,7 @@
height="340.0" parentComponent="BG" bgColour="0" itemColour="0"
itemColour2="0" textColour="0" borderSize="0.0" borderRadius="0.0"
visible="0">
<Component type="ScriptLabel" id="SuffixLabel1" x="20.0" y="210" height="20.0"
<Component type="ScriptLabel" id="SuffixLabel1" x="20.0" y="210.0" height="20.0"
width="319.0" bgColour="1193879849" textColour="1090519039" fontName="Lato"
fontStyle="Bold" text="HARMONIC SCALER" tooltip="The suffix that will be appended to the filename on save."
fontSize="12.0" editable="0" parentComponent="LoopBuilderPage"/>
Expand Down Expand Up @@ -118,9 +118,9 @@
tooltip="Add the noise component from the original sound to the resynthesised sound"
saveInPreset="0"/>
<Component type="ScriptComboBox" id="ExampleLoad" x="10.0" y="532.0" parentComponent="BG"
saveInPreset="0" height="20.0" items="Custom&#10;cello.wav&#10;cymbal.wav&#10;deep_piano.wav&#10;flute staccato.wav&#10;flute.wav&#10;musicbox.aiff&#10;piano 2.wav&#10;rhodes.wav&#10;trumpet 2.wav&#10;trumpet.wav&#10;vibraphone.wav&#10;violin.aiff"
saveInPreset="0" height="20.0" items="Custom&#10;cello.wav&#10;cello_short.wav&#10;cymbal.wav&#10;deep_piano.wav&#10;flute staccato.wav&#10;flute.wav&#10;musicbox.aiff&#10;piano 2.wav&#10;rhodes.wav&#10;trumpet 2.wav&#10;trumpet.wav&#10;vibraphone.wav&#10;violin.aiff"
tooltip="Select one of the embedded example files." text="Select Example"
max="13"/>
max="14"/>
<Component type="ScriptComboBox" id="RootNote" x="150.0" y="532.0" parentComponent="BG"
height="20.0" width="58.0" saveInPreset="0" tooltip="Set the root note for the sample."
items="&#10;C-2&#10;C#-2&#10;D-2&#10;D#-2&#10;E-2&#10;F-2&#10;F#-2&#10;G-2&#10;G#-2&#10;A-2&#10;A#-2&#10;B-2&#10;C-1&#10;C#-1&#10;D-1&#10;D#-1&#10;E-1&#10;F-1&#10;F#-1&#10;G-1&#10;G#-1&#10;A-1&#10;A#-1&#10;B-1&#10;C0&#10;C#0&#10;D0&#10;D#0&#10;E0&#10;F0&#10;F#0&#10;G0&#10;G#0&#10;A0&#10;A#0&#10;B0&#10;C1&#10;C#1&#10;D1&#10;D#1&#10;E1&#10;F1&#10;F#1&#10;G1&#10;G#1&#10;A1&#10;A#1&#10;B1&#10;C2&#10;C#2&#10;D2&#10;D#2&#10;E2&#10;F2&#10;F#2&#10;G2&#10;G#2&#10;A2&#10;A#2&#10;B2&#10;C3&#10;C#3&#10;D3&#10;D#3&#10;E3&#10;F3&#10;F#3&#10;G3&#10;G#3&#10;A3&#10;A#3&#10;B3&#10;C4&#10;C#4&#10;D4&#10;D#4&#10;E4&#10;F4&#10;F#4&#10;G4&#10;G#4&#10;A4&#10;A#4&#10;B4&#10;C5&#10;C#5&#10;D5&#10;D#5&#10;E5&#10;F5&#10;F#5&#10;G5&#10;G#5&#10;A5&#10;A#5&#10;B5&#10;C6&#10;C#6&#10;D6&#10;D#6&#10;E6&#10;F6&#10;F#6&#10;G6&#10;G#6&#10;A6&#10;A#6&#10;B6&#10;C7&#10;C#7&#10;D7&#10;D#7&#10;E7&#10;F7&#10;F#7&#10;G7&#10;G#7&#10;A7&#10;A#7&#10;B7&#10;C8&#10;C#8&#10;D8&#10;D#8&#10;E8&#10;F8&#10;F#8"
Expand Down

0 comments on commit 4742496

Please sign in to comment.