On 24.09.25 15:43, Will Godfrey wrote:
Looking into this further and putting a canary in PartUI it seems YoshiType
is not being set. Unfortunately there are so many changes since then (and I
can't remember the origin routing) it's proving difficult to find out why :(

On 24.09.25 20:30, ichthyo wrote:
Found it : a trival bug -- introduced by me :-P


As part of my XML refactoring this spring, I had investigated the handling
of the "Yoshimi type" and then re-built the logic, now using the information
I had previously made explicit and stored into a Metadata record in XMLStore.

What I overlooked: just some lines later, the existing code called the
defaultsinstrument() function, and so the information will be immediately
replaced by the default again, which is to mark it as Zyn type.


Note for testing:
Prior to my refactoring, under some circumstances the information was
picked up from the file extension, and not from the actual file content.
This is now different. What counts is the type mark in the XML.
That means: to test that,

- you need a file with <Yoshimi-data...>
- and another file with <ZynAddSubFX-data...>



For sake of simplicity, I attached the (trivial) patch.


You may apply it directly by

# stepping into the Git tree

git am BugFix-Yoshimi-format-information-discarded-after-in.patch



-- Hermann
From 60673bb6e90d9d3a0f87ad896748b58bd9ee11ba Mon Sep 17 00:00:00 2001
From: Ichthyostega <[email protected]>
Date: Wed, 24 Sep 2025 20:40:51 +0200
Subject: [PATCH] BugFix: Yoshimi format information discarded after instrument
 load

I introduced this bug this spring, while re-building the logic
to load an instrument and evaluate the metadata, based on the new XMLStore

35136949be8

Calling defaultsinstrument() after evaluating the Yoshimi / Zyn type
will overwrite this information with, well, the default
---
 src/Misc/Part.cpp | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/src/Misc/Part.cpp b/src/Misc/Part.cpp
index d28f81f6..141a44a5 100644
--- a/src/Misc/Part.cpp
+++ b/src/Misc/Part.cpp
@@ -1475,11 +1475,11 @@ int Part::loadXML(string filename)
         logg(filename + " is not an instrument file");
         return 0;
     }
+    defaultsinstrument();
     PyoshiType = not xml.meta.isZynCompat();
     if (PyoshiType != marked_as_Yoshi)
         logg("WARNING: file extension does not match Yoshimi format in file \""+filename+"\"");
 
-    defaultsinstrument();
     Pname = findLeafName(filename);
     int chk = findSplitPoint(Pname);
     if (chk > 0)
-- 
2.47.3

_______________________________________________
Yoshimi-devel mailing list
[email protected]
https://lists.sourceforge.net/lists/listinfo/yoshimi-devel

Reply via email to