What do I do now - Compiling on Sonoma
-
The docs say to use 13.1 or below of Xcode but it won't run on my computer.
Using Xcode 15, my exported AU is instant crashing any DAW it's in, with EXC_BAD_ACCESS (SIGSEGV)
I don't know where to go from here. Any ideas?
-
@Fergler If it compiles the problem is probably with your plugin rather than the version of xcode. Make a simple test plugin with just a sinewave generator and see if that works.
-
So I removed 4/5ths of my UI as a test, and I did get a compile. Interesting though - I have two issues with what remains in AU vs what's in preview.
- Combo boxes do not have contents. Their contents should be coming from an array converted to a string with new lines.
- Some images I put on the GUI have incorrect X values when they use a global integer in their calculation.
For 1, here is the code: Anything jump out to anyone?
const resetJSON = Engine.loadFromJSON("../Reset.json"); const presetsJSON = Engine.loadFromJSON("../Presets.json"); const jsonObj = { "Reset": resetJSON, "Presets": presetsJSON }; var resetChoices = []; var presetsChoices = []; for (choice in resetJSON) resetChoices.push(choice); for (choice in presetsJSON) presetsChoices.push(choice); resetChoices = resetChoices.join("\n"); presetsChoices = presetsChoices.join("\n"); const comboH = 22; const resetCombo = Content.addComboBox("Reset", 10, 4); Content.setPropertiesFromJSON("Reset", { "width": 60, "items": resetChoices, "height": comboH, "parentComponent": "Header", "bgColour": 0, "itemColour": defaultColour, "itemColour2": 0, "textColour": defaultColour, }); const presetsCombo = Content.addComboBox("Presets", 76, 4); Content.setPropertiesFromJSON("Presets", { "width": 68, "items": presetsChoices, "height": comboH, "parentComponent": "Header", "bgColour": 0, "itemColour": defaultColour, "itemColour2": 0, "textColour": defaultColour, }); inline function setValues(json, c) { for (k in json) { if (k.contains("FaderPack")) { Content.getComponent(k).setAllValues(json[k]); } else { Content.getComponent(k).setValue(json[k]); } } c.setValue(0); } inline function onSetControl(c, value) { if (value > 0) { local id = c.getId(); local selection = c.getItemText(); local json = jsonObj[id][selection]; setValues(json, c); } } Content.getComponent("Reset").setControlCallback(onSetControl); Content.getComponent("Presets").setControlCallback(onSetControl);
-
@Fergler Use local for your arrays instead of var. Declare them when you populate them.
If the combo boxes are empty it implies your json isn't loaded correctly in the compiled plugin.
-
@d-healey "If the combo boxes are empty it implies your json isn't loaded correctly in the compiled plugin." I mean.. yeah? :D But I need a way to trace why this is.. the issue is really why is it fine in HISE but breaking in compile. I have no way to explore why this is happening except to try different iterations.
As for local vs var, these are not within an inline function so I can't. Are you then suggesting I move all this into an inline function?
For my understanding:
When I declare the const of Engine.loadFromJSON(), I am writing this object into the compiled program, not passing a reference to a real file in the real time code - correct?
-
@Fergler said in What do I do now - Compiling on Sonoma:
I have no way to explore why this is happening except to try different iterations.
Have you placed the json file in the user presets folder in AppData? I assume that's where it's expecting to find it.
@Fergler said in What do I do now - Compiling on Sonoma:
As for local vs var, these are not within an inline function so I can't
Sorry, I meant
const
notlocal
.@Fergler said in What do I do now - Compiling on Sonoma:
When I declare the const of Engine.loadFromJSON(), I am writing this object into the compiled program, not passing a reference to a real file in the real time code - correct?
You're loading it in dynamically, it's not embedded.
-
@d-healey Ah ok. So huge critical misunderstanding about Engine.loadFromJSON then.
I guess then all I need to do is add one more step to save the finished .push()'d string to as a const and use that. Not at the computer right now to test butI think that will clear things up.
-
@Fergler If you want the json to be part of the plugin and not loaded from outside, you can include it as a .js file.
-
@d-healey Thanks, simultaneously I just found this thread:
https://forum.hise.audio/topic/9830/attaching-text-json-files-to-the-compiled-binary/6I really assumed that I could load data like this but that's ok - I will do the suggestion in there of checking for a file and falling back to a default object if not found, at least for the resets/presets code. The main data I can definitely move to a .js no problem. The main data of my entire script including samplers came from a JSON file and I was tricked into thinking it was working fine because the samplers are created at compile with the correct data, and so I figure the UI was as well. No wonder absolutely nothing has been working correctly.