Git Product home page Git Product logo

damiensellier / ctrlrx Goto Github PK

View Code? Open in Web Editor NEW

This project forked from romankubiak/ctrlr

18.0 18.0 3.0 108.23 MB

CtlrX is an alternative fork of Roman Kubiak's Ctrlr. This project is ONLY aimed at delivering updates, a wiki, documentations, tutorials or anything that the community cannot share on the original Ctrlr github due to credential restrictions.

License: BSD 3-Clause "New" or "Revised" License

C 18.32% C++ 74.56% Shell 0.14% NSIS 0.02% Lua 0.21% Makefile 0.45% CMake 3.71% Python 0.02% Java 0.29% Objective-C++ 2.17% Objective-C 0.07% R 0.01% Batchfile 0.01% Rez 0.02%
audiounit midi midi-controller sysex vst vst3

ctrlrx's People

Contributors

cybercbm avatar damiensellier avatar dehnhardt avatar fredzo avatar instigat0r avatar jmechnich avatar jojonas avatar romankubiak avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

ctrlrx's Issues

LUA mod:getMidiMessage():getProperty("midiMessageCtrlrNumber") crashing on PC

local myNumber = mod:getMidiMessage():getProperty("midiMessageCtrlrNumber")
crashes on v5.6 on Windows. It works in 5.3.201.

NOTE : All mod:getMidiMessage():getProperty() won't work on macOS and will return :

Error message: [string "sendCC"]:10: attempt to call method 'getProperty' (a nil value)

sendCC = function(--[[ CtrlrModulator --]] mod --[[ number --]], value --[[ number --]], source)
    if panel:getBootstrapState() then
        return
    end
    local myNumber = mod:getMidiMessage():getProperty("midiMessageCtrlrNumber") -- CRASHES
  -- myNumber=15 -- WORKS
    panel:sendMidiMessageNow(CtrlrMidiMessage(string.format("B0 %.2x %.2x", myNumber, value)))
end

See @dnaldoog test panel for testing : test midiMessageCtrlrNumber_1_0_2024-05-30_11-40.zip

Review and improvement of Ctrlr Preferences

Draft!

Requirements:

  • remove all properties that are not used anymore
  • review all properties and group them by theme
  • modify popup to present one tab by theme
  • add possibility to apply the properties on Ctrlr IDE without the need to close Ctrlr (that will be a nice one ;-) Hope it is doable)
  • add tab for L&F with possibility to load/save L&F property files
  • make a clear differentiation between panel properties and Ctrlr IDE properties (incl. for the L&F)

TBC...

Method editor: space between methods and methods fonts

Space between methods
CtrlrX - UIComponents - CtrlrValueTreeEditor.h
Change line 13
virtual const int getItemHeight(const ValueTree &item) const { return (32); }
Changed from 32 (5.6.30) to 24 to come closer to 5.3.201 density

Fonts used to display the methods in the tree
CtrlrX - UIComponents - CtrlrLua - MethodEditor - CtrlrLuaMethodEditor.cpp at about line 703

5.3.201: Method= Font(12.0f, Font::plain) size= Font(10.0f, Font::italic) Group= Font(14.0f, Font::plain) Group children= Font(10.0f, Font::italic)
5.6.30: Method= fNormal, size=fSmall Group=fNormal

const AttributedString CtrlrLuaMethodEditor::getDisplayString(const ValueTree &item)	const
{
	AttributedString str;

//	5.6.30 original
// 	Font fNormal = owner.getOwner().getFontManager().getDefaultNormalFont();
//	Font fSmall = owner.getOwner().getFontManager().getDefaultSmallFont();

//	Back to 5.3.201...
	Font fNormal = Font(12.0f, Font::plain);
	Font fMedium = Font(14.0f, Font::plain);
	Font fSmall = Font(10.0f, Font::plain);
	Font fSmallItalic = Font(10.0f, Font::italic);

	if (item.getType () == Ids::luaMethod)
	{
		Colour text;

		if ((bool)item.getProperty(Ids::luaMethodValid) == false)
			text = Colours::red;
		else
			text = Colours::black;

		str.append (item.getProperty(Ids::luaMethodName).toString()+"\n", fNormal, text);

		if ((int)item.getProperty(Ids::luaMethodSource) == CtrlrLuaMethod::codeInFile)
		{
//			str.append(File::descriptionOfSizeInBytes(owner.getLuaMethodSourceFile(&item).getSize()), fSmall, text.brighter(0.2f));
			str.append(File::descriptionOfSizeInBytes(owner.getLuaMethodSourceFile(&item).getSize()), fSmallItalic, text.brighter(0.2f));
		}
		else
		{
			str.append (File::descriptionOfSizeInBytes (item.getProperty(Ids::luaMethodCode).toString().length()), fSmall, text.brighter(0.2f));
		}

		str.setJustification (Justification::left);
	}

	if (item.getType() == Ids::luaMethodGroup)
	{
//		str.append(item.getProperty(Ids::name), fNormal, Colours::black);
		str.append(item.getProperty(Ids::name), fMedium, Colours::black);
		str.append (" ["+String(item.getNumChildren())+"]", fSmall, Colours::darkgrey);

		str.setJustification (Justification::left);
	}

	if (item.getType() == Ids::luaManagerMethods)
	{
		str.append ("LUA", fMedium.boldened(), Colours::black);

		str.setJustification (Justification::left);
	}

	return (str);
}

"Max exported VST params" ctrlrMaxExportedVstParameters not working as intended

SEE : RomanKubiak#654

The parameter "Max exported VST params" ctrlrMaxExportedVstParameters is often useless.
If you export a panel as vst restricted instance, from the function getNumModulators() only the highest vstindex should set the limit. But it's not if the vstindex highest number is above 64. From what I can see, it falls back to the default settings from global Ctrlr preferences (64) because of JMAX comparator.

"Max exported VST params" ctrlrMaxExportedVstParameters should be removed/commented.

and CtrlrProcessor::getNumParameters() needs to be updated :

int CtrlrProcessor::getNumParameters()
{
    if (ctrlrManager)
        // return (jmax(ctrlrManager->getNumModulators(true), (int)overridesTree.getProperty (Ids::ctrlrMaxExportedVstParameters))); // Removed 5.6.31 because VST Host was returning 64 params most of the time since panels hardly have more than 64 parameters passed as vst controls
        return (ctrlrManager->getNumModulators(true)); // Updated v5.6.31.
    else
        return (CTRLR_DEFAULT_PARAMETER_COUNT);
}

Look and Feel: V4 Grey/Dark/Midnight Lua Editors: Console Pane Text is white on white background

Look and Feel: V4 Grey/Dark/Midnight Lua Editors: Text is white on white background

  • Lua Editor Text not legible on those themes [white text | white background ]

  • likely should be [FF000000] vs [FFFFFFFF]

  • Menu>Settings allows for changing background & font(not colorr), but doesn't adjust the console area so could use that for work around.

    • in the screencaps, I already changed the background color just to show the console color pallette isn't affected by those settings
  • didn't find any CtrlrPanelEditor properties where it could be changed in-app

    • but it might be linked to one of those properties where end-user could inadvertently mess it up
  • V4 Light uses black text, so is simple workaround

Lua Editor for each theme

ctrlr-lua-editor-text-color-issue

Lua Editor Settings

image

Linux build results in error "target pattern contains no '%'"

After finding out that I need to be inside the directory Builds/LinuxMakefile/
before i run build.sh, then also need to install libcurl and alsa-lib development packages, the linux build still fails for me at:

$ ./build.sh 
CTRLR[linux]: Building for x86_64, JOBS 16
Makefile:336: *** target pattern contains no '%'.  Stop.
CTRLR[linux]: build failed

What could I be missing?

Remove VS warning

1>G:\2. Source code for build\CtrlrX 5.6.30.1\Source\UIComponents\CtrlrApplicationWindow\CtrlrDocumentPanel.cpp(19,56):

warning C4305: 'argument': truncation from 'double' to 'float'
setBackgroundColour((Colours::lightgrey).darker(0.2));

becomes:
setBackgroundColour((Colours::lightgrey).darker(0.2f));

1>G:\2. Source code for build\CtrlrX 5.6.30.1\Source\UIComponents\CtrlrPanel\CtrlrPanelEditor.cpp(357,35): warning C4458: declaration of 'canvasHeight' hides class member
1>G:\2. Source code for build\CtrlrX 5.6.30.1\Source\UIComponents\CtrlrPanel\CtrlrPanelEditor.h(82,16): message : see declaration of 'CtrlrPanelEditor::canvasHeight' (compiling source file ....\Source\UIComponents\CtrlrPanel\CtrlrPanelEditor.cpp)
1>G:\2. Source code for build\CtrlrX 5.6.30.1\Source\UIComponents\CtrlrPanel\CtrlrPanelEditor.cpp(358,34): warning C4458: declaration of 'canvasWidth' hides class member
1>G:\2. Source code for build\CtrlrX 5.6.30.1\Source\UIComponents\CtrlrPanel\CtrlrPanelEditor.h(83,16): message : see declaration of 'CtrlrPanelEditor::canvasWidth' (compiling source file ....\Source\UIComponents\CtrlrPanel\CtrlrPanelEditor.cpp)
1>G:\2. Source code for build\CtrlrX 5.6.30.1\Source\UIComponents\CtrlrPanel\CtrlrPanelEditor.cpp(359,40): warning C4458: declaration of 'canvasAspectRatio' hides class member
1>G:\2. Source code for build\CtrlrX 5.6.30.1\Source\UIComponents\CtrlrPanel\CtrlrPanelEditor.h(84,16): message : see declaration of 'CtrlrPanelEditor::canvasAspectRatio' (compiling source file ....\Source\UIComponents\CtrlrPanel\CtrlrPanelEditor.cpp)

            double canvasHeight = getCanvas()->getHeight();
            double canvasWidth = getCanvas()->getWidth();
            double canvasAspectRatio = double(canvasWidth) / double(canvasHeight);

becomes:

            canvasHeight = getCanvas()->getHeight();
            canvasWidth = getCanvas()->getWidth();
            canvasAspectRatio = canvasWidth / canvasHeight;

because they are already declared as double in CtrlrPanelEditor.h

!!! To get confirmation from Damien if those are not local variables rather than class variables (then do not change but use other variable names)

1>G:\2. Source code for build\CtrlrX 5.6.30.1\Source\UIComponents\CtrlrApplicationWindow\CtrlrEditor.cpp(92,20): warning C4458: declaration of 'constrainer' hides class member
1>G:\2. Source code for build\CtrlrX 5.6.30.1\Source\UIComponents\CtrlrApplicationWindow\CtrlrEditor.h(169,30): message : see declaration of 'CtrlrEditor::constrainer' (compiling source file ....\Source\UIComponents\CtrlrApplicationWindow\CtrlrEditor.cpp)

            `if (auto* constrainer = getConstrainer())`

becomes

           ` if (constrainer = getConstrainer())`

because they are already declared in CtrlrEditor.h

!!! To get confirmation from Damien if those are not local variables rather than class variables (then do not change but use other variable names)

Why auto*?

Red colour for close button on mouse over

Source\UIComponents\CtrlrApplicationWindow\CtrlrDocumentPanel.cpp Row 195 and further

  else if (isMouseOverButton)
   {
       //g.setColour (Colour(findColour(TextButton::buttonOnColourId)).brighter(0.4));
//        g.setColour (Colour (0xdfe7e7e8));
       g.setColour (Colour (0xffcc7878));      // Light red (I saw 0xffff1100 somewhere else)

       g.fillRoundedRectangle((float) (proportionOfWidth (0.0500f)),
                              (float) (proportionOfHeight (0.0500f)),
                              (float) (proportionOfWidth (0.9000f)),
                              (float) (proportionOfHeight (0.9000f)),
                              (float) (proportionOfWidth(0.1f)));

//        g.setColour(Colour(0xdf3f3e45));
       g.setColour(Colour(0xffffffff));
       g.fillPath (internalPath3);

//        g.setColour(Colour(0xdf3f3e45));
       g.setColour(Colour(0xffffffff));
       g.fillPath (internalPath4);
   }

light red can be red 0xffff0000 ou 0xffff1100

Help me finish this simple lua method please

155958319-560fc6e4-5be5-4251-9458-6295ef88b449

Hello.

I try to make a method that turn off "panelMIDIpauseOut".
Then a similar method that turn on "panelMIDIpauseOut".

I'll use them at "called before a snapshot is launched" and "called after a snapshot".

Please HELP ME because without this lua code, There is a bug (double midi bug) in all my setup that creates big problems with some of my synth/panel.

I am pretty sure this is a solution to the problem I encounter. I have to manually toggle "panelMIDIpauseOut" dozens and dozens of time per session I can't stand it anymore. Each time I send a snapshot basically.

I do not code, I only copy pasted some piece of code found on the old CTRLR forum on a thread about the double-midi bug. Don't expect any skills from me, I'm a total lua punk, I just want to solve this one bug with LUA, not become a coder. I'll consider a small donation to anybody that can help me.

Notifications at the bottom of the window are not showing up in 5.6.23+

Due to JUCE updates, the notify() is no longer available to display notification overlays at the bottom of the window.

notify()

We need to find where the notify() function was implemented and backtrace it to make it work again.
OR
If not possible because of the outdated JUCE class, notifications should be displayed in the menu bar next to title for a short while as a workaround.

NOTE :

Source/Core/CtrlrPanel/CtrlrPanelFileOperations.cpp

Source/Core/CtrlrPanel/CtrlrPanel.cpp LINE 1702

void CtrlrPanel::notify (const String &notification, CtrlrNotificationCallback *callback, const CtrlrNotificationType ctrlrNotificationType)
{
	if (luaPanelMessageHandlerCbk && !luaPanelMessageHandlerCbk.wasObjectDeleted())
	{
		if (luaPanelMessageHandlerCbk->isValid())
		{
			getCtrlrLuaManager().getMethodManager().call (luaPanelMessageHandlerCbk, notification, ctrlrNotificationType);
		}
	}

	_INF (notification);
}

CtrlrDocumentPanel::activeDocumentChanged() throws error on findColour(): Workaround: add IF for colourID == 16799763/5

Running in debug mode and found the exceptions thrown for those two colors a nuisance, so added IF statement for the colourIDs specifically.
Ultimate fix might be choosing a colour from the JUCE color list... I think they are HTML(websafe) colours.
Might be able to just add them to the JUCE h file, but I didn't want to go mucking around in a bunch of places and diverge off your [master] branch.

Workaround

    if (index >= 0)
        return colours[index].colour;
    **if (colourID == 16799763 || colourID == 16799765)
        return Colours::black;**

    jassertfalse;
    return Colours::black;

Steps to Reproduce

  1. Start in Debug
  2. File>New Panel
// CtrlrManager::addPanel
void CtrlrManager::addPanel (CtrlrPanelEditor *panelToAdd)
{
	ctrlrDocumentPanel->addDocument ((Component *)panelToAdd, Colours::lightgrey, true);
}

// memory
    _NODISCARD pointer operator->() const noexcept {
        return _Mypair._Myval2;
    }

image

//juce_MultiDocumentPanel.cpp

bool MultiDocumentPanel::addDocument (Component* const component,
                                      Colour docColour,
                                      const bool deleteWhenRemoved)
{
    // If you try passing a full DocumentWindow or ResizableWindow in here, you'll end up
    // with a frame-within-a-frame! Just pass in the bare content component.
    jassert (dynamic_cast<ResizableWindow*> (component) == nullptr);

    if (component == nullptr || (maximumNumDocuments > 0 && components.size() >= maximumNumDocuments))
        return false;

    components.add (component);
    component->getProperties().set ("mdiDocumentDelete_", deleteWhenRemoved);
    component->getProperties().set ("mdiDocumentBkg_", (int) docColour.getARGB());

// Autos: 
// juce::Colour::getARGB returned | 4292072403 | unsigned int


// CtrlrDocumentPanel::activeDocumentChanged
void CtrlrDocumentPanel::activeDocumentChanged()
{
	CtrlrEditor *ed = dynamic_cast <CtrlrEditor*> (getParentComponent());
	if (ed)
    {
		ed->activeCtrlrChanged();
        setBackgroundColour(Component::findColour(DocumentWindow::backgroundColourId));
    }
    if (getCurrentTabbedComponent()) {
        getCurrentTabbedComponent()->setTabBarDepth(owner.getProperty(Ids::ctrlrTabBarDepth));
        getCurrentTabbedComponent()->getTabbedButtonBar().setColour(TabbedButtonBar::tabTextColourId, **findColour(TabbedButtonBar::tabTextColourId)); // Not working
        getCurrentTabbedComponent()->getTabbedButtonBar().setColour(TabbedButtonBar::frontTextColourId, findColour(TabbedButtonBar::frontTextColourId)); // Not working**
    }
    setBackgroundColour(Colours::lightgrey); // Sets background colour behind main window by default on grey to please everyone :)
}

//Colour LookAndFeel::findColour 
Colour LookAndFeel::findColour (int colourID) const noexcept
{
    const ColourSetting c = { colourID, Colour() };
    auto index = colours.indexOf (c);

    if (index >= 0)
        return colours[index].colour;
    **if (colourID == 16799763 || colourID == 16799765)
        return Colours::black;**

    jassertfalse;
    return Colours::black;
}

Save message error

Row 1035 in Core - CtrlrPanelFileOperations.cpp

int ret = AlertWindow::showYesNoCancelBox(AlertWindow::QuestionIcon, "Save panel (" + getName() + ")", "There are unsaved changes in this panel.\nDo you want to save them before closing ?", "Save", "Discard", "Cancel");
Added \n and corrected "berfore"

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.