Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
6 changes: 4 additions & 2 deletions CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -50,10 +50,12 @@ if(ARSON_BUILD_PLUGIN)
PRODUCT_NAME "ArSonComp" IS_SYNTH FALSE NEEDS_MIDI_INPUT FALSE NEEDS_MIDI_OUTPUT FALSE
IS_MIDI_EFFECT FALSE EDITOR_WANTS_KEYBOARD_FOCUS FALSE COPY_PLUGIN_AFTER_BUILD FALSE
VST3_CATEGORIES Fx Dynamics)
# Keep only knob, toggle and logo assets: faders are pure JUCE vectors.
# No track/thumb PNG or runtime resampling.
# Knob/toggle artwork and the approved flat brushed-metal fader pair
# are compiled into the VST3/Standalone. No file-system reads at runtime.
juce_add_binary_data(ArSonCompKnobAssets
SOURCES assets/black_brushed_knob.jpg
assets/sliders/arsoncomp_flat_track_480.png
assets/sliders/arsoncomp_silver_thumb_96.png
assets/toggle/arson_toggle_on.png
assets/toggle/arson_toggle_off.png
assets/arsoncomp_header_logo.png)
Expand Down
Binary file added assets/sliders/arsoncomp_flat_track_480.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added assets/sliders/arsoncomp_silver_thumb_96.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
18 changes: 18 additions & 0 deletions docs/M63-BRUSHED-METAL-SLIDERS.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,18 @@
# M6.3 approved flat brushed-metal photographic fader

Two distinct user-approved transparent PNGs are bundled in the VST3 and
Standalone binary:

- assets/sliders/arsoncomp_flat_track_480.png — 480×66 cropped transparent
stationary horizontally brushed metal ruler, with dark recessed slot.
- assets/sliders/arsoncomp_silver_thumb_96.png — 96×96 circular satin brushed
silver thumb, moves independently.

These are cropped/downsized from the approved rendered assets, not new vector
approximations. Thumb and ruler retain original aspect ratio at all slider
widths, including the smaller Sidechain pair. Both assets decode once on the
JUCE editor creation thread; the audio thread is unaffected. The 612×580
taller LCD and MINI mode remain unchanged.

Release gates: Windows compile/CTest/screenshot artifacts, Linux sanitizer
engine tests. Final visual acceptance and physical audio tests are separate.
84 changes: 21 additions & 63 deletions plugin/Editor.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -52,6 +52,15 @@ CompLook::CompLook() {
static_cast<std::size_t>(BinaryData::arson_toggle_off_pngSize));
jassert(toggleOn.isValid() && toggleOff.isValid());
jassert(toggleOn.getBounds()==toggleOff.getBounds());
// Independent stationary track + moving circular silver thumb.
// Decode only on editor construction, never in draw or the audio thread.
sliderTrack=juce::ImageFileFormat::loadFrom(
BinaryData::arsoncomp_flat_track_480_png,
static_cast<std::size_t>(BinaryData::arsoncomp_flat_track_480_pngSize));
sliderThumb=juce::ImageFileFormat::loadFrom(
BinaryData::arsoncomp_silver_thumb_96_png,
static_cast<std::size_t>(BinaryData::arsoncomp_silver_thumb_96_pngSize));
jassert(sliderTrack.isValid() && sliderThumb.isValid());
setColour(juce::Slider::textBoxTextColourId,text);
setColour(juce::Slider::textBoxBackgroundColourId,juce::Colour{0xff111417});
setColour(juce::Slider::textBoxOutlineColourId,juce::Colour{0xff31383e});
Expand Down Expand Up @@ -194,71 +203,20 @@ void CompLook::drawRotarySlider(juce::Graphics& g,int x,int y,int w,int h,
void CompLook::drawLinearSlider(juce::Graphics& g,int x,int y,int w,int h,
float pos,float,float,
const juce::Slider::SliderStyle,juce::Slider&) {
// Modern vector-only JUCE fader; no texture, sprite or image resampling.
// Host automation, keyboard input and gestures remain native JUCE Slider.
const auto geometry=arson::ui::FaderGeometry::calculate(
// Two approved photographic assets: the flat grey brushed-metal ruler
// stays stationary; only the circular satin-metal thumb moves.
// Preserve aspect ratio of both PNGs for a true hardware appearance.
const auto geom=arson::ui::FaderGeometry::calculate(
static_cast<float>(w),static_cast<float>(h),pos);
const auto track=geometry.track.translated(static_cast<float>(x),
static_cast<float>(y));
const auto thumb=geometry.thumb.translated(static_cast<float>(x),
static_cast<float>(y));
const float cy=static_cast<float>(y)+static_cast<float>(h)*0.5f;
const float progress=juce::jlimit(0.0f,1.0f,
(geometry.position-geometry.left)/(geometry.right-geometry.left));

// Inset charcoal rail: restrained outline, clear separation from chassis.
const auto housing=track.expanded(1.4f,2.6f);
g.setColour(juce::Colour{0xff11171b});
g.fillRoundedRectangle(housing,4.2f);
g.setColour(juce::Colour{0xff6e777c}.withAlpha(0.43f));
g.drawRoundedRectangle(housing.reduced(0.35f),4.0f,0.85f);
g.setColour(juce::Colour{0xff070c10});
g.fillRoundedRectangle(track,track.getHeight()*0.5f);
g.setColour(juce::Colour{0xff9ba4a8}.withAlpha(0.15f));
g.drawHorizontalLine(juce::roundToInt(track.getY()+1.0f),
track.getX()+3.0f,track.getRight()-3.0f);

// Coral level fill, clipped into rounded channel. Minimum is fully dark.
if(progress>0.001f) {
juce::Graphics::ScopedSaveState clip(g);
juce::Path channel;
channel.addRoundedRectangle(track,track.getHeight()*0.5f);
g.reduceClipRegion(channel);
const float litRight=track.getX()+track.getWidth()*progress;
g.setGradientFill(juce::ColourGradient(
juce::Colour{0xfffc8587},track.getX(),track.getY(),
juce::Colour{0xffb33b4d},track.getX(),track.getBottom(),false));
g.fillRect(track.getX(),track.getY(),
litRight-track.getX(),track.getHeight());
if(litRight>track.getX()+4.0f) {
g.setColour(juce::Colour{0xffffd1cf}.withAlpha(0.43f));
g.drawHorizontalLine(juce::roundToInt(cy-0.5f),
track.getX()+2.0f,litRight-1.0f);
}
const auto rail=geom.track.translated(static_cast<float>(x),
static_cast<float>(y));
const auto cap=geom.thumb.translated(static_cast<float>(x),
static_cast<float>(y));
if(sliderTrack.isValid() && sliderThumb.isValid()) {
g.setImageResamplingQuality(juce::Graphics::highResamplingQuality);
g.drawImage(sliderTrack,rail);
g.drawImage(sliderThumb,cap);
}

// Sharp graphite thumb with soft satin bevel + small red engraved grip.
// At actual 34px height the thumb remains 13-15px wide and 28px tall.
g.setColour(juce::Colours::black.withAlpha(0.48f));
g.fillRoundedRectangle(thumb.translated(0.0f,1.4f),3.2f);
juce::ColourGradient brushed(juce::Colour{0xff869198},thumb.getX(),cy,
juce::Colour{0xff414a51},thumb.getRight(),cy,false);
brushed.addColour(0.19,juce::Colour{0xff707c83});
brushed.addColour(0.40,juce::Colour{0xff333c43});
brushed.addColour(0.73,juce::Colour{0xff222b31});
g.setGradientFill(brushed);
g.fillRoundedRectangle(thumb,3.1f);
g.setColour(juce::Colour{0xffa3adb2}.withAlpha(0.62f));
g.drawRoundedRectangle(thumb.reduced(0.7f),2.6f,0.85f);
g.setColour(juce::Colours::white.withAlpha(0.10f));
g.drawVerticalLine(juce::roundToInt(thumb.getX()+2.1f),
thumb.getY()+4.0f,thumb.getBottom()-4.0f);
const juce::Rectangle<float> grip{
thumb.getX()+3.1f,cy-1.2f,thumb.getWidth()-6.2f,2.4f};
g.setColour(juce::Colour{0xff141a1f});
g.fillRoundedRectangle(grip.expanded(0.4f,0.65f),1.25f);
g.setColour(juce::Colour{0xffed7279});
g.fillRoundedRectangle(grip,1.2f);
}
void CompLook::drawToggleButton(juce::Graphics& g,juce::ToggleButton& button,
bool highlighted,bool down) {
Expand Down
1 change: 1 addition & 0 deletions plugin/Editor.h
Original file line number Diff line number Diff line change
Expand Up @@ -22,6 +22,7 @@ class CompLook final : public juce::LookAndFeel_V4 {
std::array<FaceCache,2> faces; // normal + oversized Threshold only
juce::Image sourceFace; // decoded once on GUI initialization
juce::Image toggleOn, toggleOff; // matched, predecoded state sprites
juce::Image sliderTrack, sliderThumb; // approved separate flat-metal PNGs
const juce::Image& knobFace(int diameter,bool primary);
};
class Editor final : public juce::AudioProcessorEditor, private juce::Timer {
Expand Down
28 changes: 16 additions & 12 deletions plugin/FaderGeometry.h
Original file line number Diff line number Diff line change
Expand Up @@ -3,23 +3,27 @@
#include <algorithm>

namespace arson::ui {
// Canonical vector geometry for the six horizontal faders.
// No bitmap aspect ratios, resampling or stretched controls.
// Cropped, transparent PNG source dimensions: 480x66 track, 96x96 thumb.
// The track remains stationary; the round silver cap slides on its axis.
struct FaderGeometry {
static constexpr float railHeight=6.0f;
juce::Rectangle<float> track, thumb;
float left=0.0f, right=0.0f, position=0.0f;
static constexpr float trackAspect=480.0f/66.0f;
juce::Rectangle<float> track,thumb;
float left=0.0f,right=0.0f,position=0.0f;
static FaderGeometry calculate(float width,float height,float sliderPos) noexcept {
const float inset=juce::jlimit(8.0f,11.0f,width*0.10f);
const float capW=juce::jlimit(12.0f,15.0f,height*0.40f);
const float capH=juce::jlimit(22.0f,29.0f,height-5.0f);
// Prevent image stretching at any supported Dynamics/Sidechain width.
const float trackWidth=juce::jmax(1.0f,
std::min(width-4.0f,(height-3.0f)*trackAspect));
const float trackHeight=trackWidth/trackAspect;
const float thumbSize=juce::jlimit(22.0f,33.0f,height-4.0f);
const float railX=(width-trackWidth)*0.5f;
const float cy=height*0.5f;
FaderGeometry g;
g.track={inset,cy-railHeight*0.5f,width-2.0f*inset,railHeight};
g.left=inset+capW*0.5f;
g.right=width-inset-capW*0.5f;
g.track={railX,cy-trackHeight*0.5f,trackWidth,trackHeight};
g.left=railX+thumbSize*0.5f+2.0f;
g.right=railX+trackWidth-thumbSize*0.5f-2.0f;
g.position=juce::jlimit(g.left,g.right,sliderPos);
g.thumb={g.position-capW*0.5f,cy-capH*0.5f,capW,capH};
g.thumb={g.position-thumbSize*0.5f,cy-thumbSize*0.5f,
thumbSize,thumbSize};
return g;
}
};
Expand Down
123 changes: 54 additions & 69 deletions tests/PluginSmoke.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -209,61 +209,50 @@ static int runSmoke(int argc,char** argv) {
if(std::abs(audio.getSample(0,0)-0.123f)>1.0e-6f ||
std::abs(audio.getSample(0,31)-0.123f)>1.0e-6f)return failHost(46);
}
// Fully vector JUCE Graphics faders; raster and geometric regression.
// Approved M6.3 PNG resources are embedded and independently decoded.
// Never replace the textured ruler or circular thumb with drawn shapes.
{
const auto track=juce::ImageFileFormat::loadFrom(
BinaryData::arsoncomp_flat_track_480_png,
static_cast<std::size_t>(BinaryData::arsoncomp_flat_track_480_pngSize));
const auto thumb=juce::ImageFileFormat::loadFrom(
BinaryData::arsoncomp_silver_thumb_96_png,
static_cast<std::size_t>(BinaryData::arsoncomp_silver_thumb_96_pngSize));
if(!track.isValid() || !thumb.isValid() ||
track.getWidth()!=480 || track.getHeight()!=66 ||
thumb.getWidth()!=96 || thumb.getHeight()!=96 ||
track.getPixelAt(0,0).getFloatAlpha()>0.05f ||
thumb.getPixelAt(0,0).getFloatAlpha()>0.05f ||
track.getPixelAt(240,33).getFloatAlpha()<0.80f ||
thumb.getPixelAt(48,48).getFloatAlpha()<0.80f) {
std::cerr<<"PHOTO_ASSET_47: invalid dimensions or alpha\n";
return 47;
}
for(float width : {70.0f,90.0f,105.0f,150.0f})
for(float height : {34.0f,36.0f,40.0f})
for(float height : {34.0f,40.0f})
for(float pos : {-100.0f,width*0.5f,width+100.0f}) {
const auto shape=arson::ui::FaderGeometry::calculate(
width,height,pos);
if(shape.track.getHeight()!=arson::ui::FaderGeometry::railHeight ||
shape.track.getX()<0||shape.track.getRight()>width ||
shape.thumb.getX()<0||shape.thumb.getRight()>width ||
shape.thumb.getY()<0||shape.thumb.getBottom()>height ||
shape.thumb.getWidth()<12.0f||shape.thumb.getHeight()<22.0f ||
shape.right<=shape.left)return 73;
if(std::abs(shape.track.getWidth()/shape.track.getHeight()-
arson::ui::FaderGeometry::trackAspect)>0.001f ||
std::abs(shape.thumb.getWidth()-shape.thumb.getHeight())>0.001f ||
shape.track.getX()<0.0f || shape.track.getRight()>width ||
shape.thumb.getX()<0.0f || shape.thumb.getRight()>width ||
shape.thumb.getY()<0.0f || shape.thumb.getBottom()>height ||
shape.left>=shape.right) {
std::cerr<<"PHOTO_GEOMETRY_73 w="<<width<<"\n";
return 73;
}
}
{
CompLook look;
juce::Image raster(juce::Image::ARGB,100,34,true);
{
juce::Graphics g(raster);
g.fillAll(juce::Colour{0xff262c31});
juce::Slider dummy;
look.drawLinearSlider(g,0,0,100,34,55.0f,0.0f,100.0f,
juce::Slider::LinearHorizontal,dummy);
}
const auto shape=arson::ui::FaderGeometry::calculate(100.0f,34.0f,55.0f);
const int px=juce::roundToInt(shape.thumb.getX()+2.0f);
const int py=juce::roundToInt(shape.thumb.getY()+5.0f);
const float cap=raster.getPixelAt(px,py).getBrightness();
const float backdrop=raster.getPixelAt(2,py).getBrightness();
if(cap<0.22f || cap-backdrop<0.06f) {
std::cerr<<"VECTOR_CAP_CONTRAST_87 cap="<<cap
<<" backdrop="<<backdrop<<std::endl;
return 87;
}
}
for(int width : {62,66,72,78,100})
for(bool threshold : {false,true}) {
const int diameter=arson::ui::KnobGeometry::facePixels(
width,arson::ui::EditorMetrics::knobHeight,threshold);
if(arson::ui::KnobGeometry::outerPaintRadius(diameter)
+arson::ui::KnobGeometry::safeInset >
0.5f*std::min(width,arson::ui::EditorMetrics::knobHeight)
+0.01f)return 83;
}
// Raster-render all three slider positions via the *production*
// LookAndFeel, then inspect the LED at a track location untouched
// by the thumb. Red must be off at minimum and lit at maximum.
// Test the production LookAndFeel at actual 34px compact height.
CompLook look;
juce::Slider slider;
constexpr int w=160,h=40;
const auto render=[&](float position) {
juce::Image canvas(juce::Image::RGB,w,h,true);
{
juce::Graphics g(canvas);
g.fillAll(juce::Colour{0xff44494d});
g.fillAll(juce::Colour{0xff454a4d});
look.drawLinearSlider(g,0,0,w,h,position,0.0f,0.0f,
juce::Slider::LinearHorizontal,slider);
}
Expand All @@ -272,35 +261,31 @@ static int runSmoke(int argc,char** argv) {
const auto low=render(21.0f);
const auto mid=render(80.0f);
const auto high=render(139.0f);
// Inset vector channel should be darker than chassis at centre.
const auto housingPixel=low.getPixelAt(61,17);
const auto backdrop=juce::Colour{0xff44494d};
if(housingPixel.getBrightness()>=backdrop.getBrightness()-0.045f) {
std::cerr<<"FADER_HOUSING_DEPTH_78 pixel="
<<housingPixel.toDisplayString(true)<<"\n";
return 78;
}
const auto off=low.getPixelAt(61,20);
const auto on=high.getPixelAt(61,20);
if(on.getRed()<=off.getRed()+35 ||
on.getRed()<=on.getGreen()+24) {
std::cerr<<"GUNMETAL_LED_54 off="<<off.toDisplayString(true)
<<" on="<<on.toDisplayString(true)<<'\n';
return 54;
}
// Photo thumb travels across the *same* stationary plate.
// The centre thumbnail area is metal at 50%, but at 100% is
// dark track; use contrast not a fragile exact RGB value.
float diff=0.0f;
for(int y=6;y<36;y+=4)
for(int x=74;x<=86;x+=4)
diff+=std::abs(mid.getPixelAt(x,y).getBrightness()-
high.getPixelAt(x,y).getBrightness());
if(diff<0.25f) {
std::cerr<<"GUNMETAL_THUMB_TRAVEL_55 image difference="
<<diff<<'\n';
// The ruler is stationary at low/high. No red LED or painted fill.
const float railDifference=std::abs(
low.getPixelAt(80,13).getBrightness()-
high.getPixelAt(80,13).getBrightness());
if(railDifference>0.04f)return 78;
// A brushed silver thumb must contrast the dark slot and travel.
const float leftDiff=std::abs(
low.getPixelAt(21,20).getBrightness()-
high.getPixelAt(21,20).getBrightness());
const float midDiff=std::abs(
mid.getPixelAt(80,20).getBrightness()-
high.getPixelAt(80,20).getBrightness());
if(leftDiff<0.10f || midDiff<0.10f) {
std::cerr<<"PHOTO_THUMB_TRAVEL_55 "<<leftDiff<<","<<midDiff<<"\n";
return 55;
}
for(int width : {62,66,72,78,100})
for(bool threshold : {false,true}) {
const int diameter=arson::ui::KnobGeometry::facePixels(
width,arson::ui::EditorMetrics::knobHeight,threshold);
if(arson::ui::KnobGeometry::outerPaintRadius(diameter)
+arson::ui::KnobGeometry::safeInset >
0.5f*std::min(width,arson::ui::EditorMetrics::knobHeight)
+0.01f)return 83;
}
}
// Production ON/OFF resources and Bypass inversion contract.
{
Expand Down
Loading