Author |
Topic: [ANN] for devs: SMCore objects and libraries - Collection, Map, strings & more (Read 2237 times) |
|
Sylvain Machefert
Administrator
    

WWW |
Gender: 
Posts: 7827
|
 |
[ANN] for devs: SMCore objects and libraries - Collection, Map, strings & more
« on: May 16th, 2022, 6:31pm » |
Quote | Modify
|
Ce sujet est en anglais, car déjà assez long comme ça, et adressé aux développeurs de scripts, habitués ou forcés à l'anglais. With most of my scripts, my library is automatically installed or updated at first run. It's named SMCore, SM are my initials. This topic is a quick view on library functions and objects. Questions, request and bug reports are welcome here. Latest version is 2026-04-15, included in HA 2026H1.. Version history: - Full change log is here
- 2026-04-15 / HA 2026H1: GetFilesInFolder and Grid improvments, bugfixes.
- 2025-12-14 / HA 2026H1 beta1: new functions for notes and rests, optimizations, bugfixes. SMDialog component receive MIDI CC event.
- 2025-09-10 / HA 9.9.9i: Added search symbol functions SearchNextSymbol and SearchPreviousSymbol, bugfixes.
- 2025-07-19 / HA 9.9.9g: 2 functions SMFirstSelectedSymbol and SMLastSelectedSymbol, more accurate and flexible than Staff.FirstSelectedSymbol and Score.LastSelectedSymbol
- 2025-05-01 / HA 9.9.9e: SMDialog component and menu accept MIDI pitch bend and controllers for navigation and or to set value. Added utility functions, and a replacement for bogus PushAllTableElts(...) from MSLibrary.
- 2025-01-24 / HA 9.9.9c: Optimization, new componants and events, light-weight lexicon, free objects functions, serialization/deserialization (kind of JSON for Lua), batch processing mechanism.-
- 2024-09-14: fixes and improvments in menu, XY slider, load & save score display setup, syntaxic sugars...
- 2024-08-25: MAJOR release : some fixes, new functions, menus and new components.
- 2023-11-30: Better documentation, demo scripts, better error handling...
- 2022-11-10: Documentation has been moved from the forum to external pages. SMDialog allow you to create sliders and grids. (Grids are still in beta-test and not 100% implemented).
- 2022-06-16: SMDialog, switch / cases keywords, Map and Collection simultaneous iterators
- 2022-05-26: better documentation, parameters check, and removed debugs in Collection:retainsAll
- 2022-05-16: initial version
1. What is SMCore? It's a collection of .mys files that will be installed into Scripts/Includes directory. Then you can use them freely in every script you need. You don't have to modify them, unless you are crazy developper and want to help me fix a bug. More infos about all files is in the documentation. 2. How to use SMCore in your scripts? You have to insert 1 or 2 lines of code in your Init function (for floatting window and interface composer) or at the beginning of your script (.mys). Code:Include "SMUtils" IncludeOnce("SMDialog") -- for floating / composer windows where you want to use my componants. |
| 3. Quick start & documentation Full documentation and code samples are available at: https://www.myriad-users.com/~sylvain-machefert/archive/api/index.html I may enrich it from times to times. You can have a look to SMCore.mys to see concrete examples. In Scripts > Miscellaneous > Dev tools, you also have demo of Grid (a Excel-like grid) and easy picture drawing. Enjoy !
|
| « Last Edit: Apr 16th, 2026, 10:50pm by Sylvain Machefert » |
offline |
HA+HQ+VS+PdfToM, Reaper+Audiveris+Transcribe, Win10+Focusrite Scarlet 4i4+Nord Electro 3 Linktree: VS languages, my scripts, my bands, my performances...
|
|
|
bubu42
Board Master
    

Gender: 
Posts: 10781
|
 |
Re: [DEV] SMCore objects and libraries
« Reply #1 on: May 16th, 2022, 7:31pm » |
Quote | Modify
|
Food for thought... No doubt, our brains won't be starving !
|
|
offline |
Harmony Assistant 32 bits - Ubuntu + Wine et Windows XP sur machine virtuelle. VS, OMeR, PDF2M
|
|
|
Sylvain Machefert
Administrator
    

WWW |
Gender: 
Posts: 7827
|
 |
Re: [ANN] for devs: SMCore objects and libraries - Collection, Map, strings & more
« Reply #2 on: May 27th, 2022, 5:21pm » |
Quote | Modify
|
Hello, new version is published : 2022-05-26 with more security in parameters checks, and Collection/Map documentation fully updated. Enjoy !
|
| « Last Edit: May 29th, 2022, 12:00am by Sylvain Machefert » |
offline |
HA+HQ+VS+PdfToM, Reaper+Audiveris+Transcribe, Win10+Focusrite Scarlet 4i4+Nord Electro 3 Linktree: VS languages, my scripts, my bands, my performances...
|
|
|
Sylvain Machefert
Administrator
    

WWW |
Gender: 
Posts: 7827
|
 |
Re: [ANN] for devs: SMCore objects and libraries - Collection, Map, strings & more
« Reply #3 on: Jun 18th, 2022, 11:42pm » |
Quote | Modify
|
Hi! New version 20220616 is online! What's new? - SMDialog - create user interface like Danièl, but easily
- switch / case keywords
- Collection and Map iterators accept one argument (not mandatory). This allow to have concurrent (simultaneous) browsing of the same Collection / Map.
Use the same argument for iterator, hasNext and next calls. More info about SMDialog on this topic
|
| « Last Edit: Nov 16th, 2022, 6:33pm by Sylvain Machefert » |
offline |
HA+HQ+VS+PdfToM, Reaper+Audiveris+Transcribe, Win10+Focusrite Scarlet 4i4+Nord Electro 3 Linktree: VS languages, my scripts, my bands, my performances...
|
|
|
Sylvain Machefert
Administrator
    

WWW |
Gender: 
Posts: 7827
|
 |
Re: [ANN] for devs: SMCore objects and libraries - Collection, Map, strings & more
« Reply #5 on: Apr 6th, 2023, 4:12am » |
Quote | Modify
|
What's coming in next version? - IncludeOnce: Include enhanced for big included files
- Durations conversions: 256th of quarter to milliseconds, milliseconds to % of a note, etc...
- GetDynamicsThatApplyToStaff: dynamics may apply to merged staves, group, or whole score. So which ones apply to a specified staff?
- Collections now accept sorting function for table, but still can't guarantee unicity.
-
|
|
offline |
HA+HQ+VS+PdfToM, Reaper+Audiveris+Transcribe, Win10+Focusrite Scarlet 4i4+Nord Electro 3 Linktree: VS languages, my scripts, my bands, my performances...
|
|
|
Sylvain Machefert
Administrator
    

WWW |
Gender: 
Posts: 7827
|
continue teasing - Grid composant is more functional
- A little database about instruments: classifications (orchestra, midi, alphabetic...) and their related sound
- An instrument or sound selector: for 2 scripts I'm planning to write, I need to select an instrument but don't need the sound, the selector then will have only the 2 left lists.
The screen capture show the sound selector which is 3 nested lists. - The right-most have 2 columns, but it's not yet complete.
- The "duplicates" drums is the result of comparing all drum sets.
i.e. the "ride bell" sounds is unique for standard/rock/pop and pop3, but the pop2 set reuse a sound found in another set. This may simplify the choice of a sound. - work in progress...!
As you can imagine, I'm planning to write a script about drums... But I'm working on another before where I'll need to select only instrument (piano, violin, ..) and don't need the sound. In the future I hope this selector may help share with you some new sounds, a kind of extension of Gold base.
|
|
offline |
HA+HQ+VS+PdfToM, Reaper+Audiveris+Transcribe, Win10+Focusrite Scarlet 4i4+Nord Electro 3 Linktree: VS languages, my scripts, my bands, my performances...
|
|
|
Sylvain Machefert
Administrator
    

WWW |
Gender: 
Posts: 7827
|
I'm working on several scripts so nothing is yet fully finished. Here are new things that will come when I'll do the huge update - Spinners: component that act like a menu or a list, but use less space, display 2 arrows for previous/next value, and accept mouse scroll. See image below.
I had the idea before I saw this kind of buttons in DPDP - Music theory (solfege) Chord and Interval objects
Interval can calculate the second note. What is second note of C# + diminished fourth ? => F. Second note of C# + major third ==> E#. This is the core of the algorithm I wrote some years ago in Java for transposition. Chord understands more notations than HA, including Δ (delta) for Maj7, ° for diminished, even weird symbols used by My Chord font (' for half-diminshed, ! for Δ(delta)...). Chord also understand bass progressions Cm, Cm/Bb, Cm/A...
|
| « Last Edit: Aug 26th, 2023, 10:18am by Sylvain Machefert » |
offline |
HA+HQ+VS+PdfToM, Reaper+Audiveris+Transcribe, Win10+Focusrite Scarlet 4i4+Nord Electro 3 Linktree: VS languages, my scripts, my bands, my performances...
|
|
|
Sylvain Machefert
Administrator
    

WWW |
Gender: 
Posts: 7827
|
 |
Re: [ANN] for devs: SMCore objects and libraries - Collection, Map, strings & more
« Reply #8 on: Dec 1st, 2023, 10:16am » |
Quote | Modify
|
Hi ! Here we are! I uploaded my major release of SMCore. It comes with two demo scripts I invite you to download (right click > save as) and try. The .msa files extract to Scripts > Miscellaneous > Dev tools. They let you play with all arguments and copy the code to paste it in your script. DrawPicture(...) The first demonstrate DrawPicture(...) function from SMGraph.mys. It's "just" a enhanced version of Graph.DrawPicture(...) with simpler arguments. It can do alignments and scaling in a rectangle, or around a line or dot. More flexible and no more headache! SMGraphDrawPicture.msa Grid Grid is an advanced componant which display like Excel spreadsheet. It internaly use Map and Collection. It's navigable using keyboard. It can replace List item if you need several columns, hidden datas, or want to customize display (picture, text color). SMDialogGrid.msa. Both scripts require latest version of SMCore. Running them for the first time will download some files in Myriad Documents/Settings/Scripts/Includes, and perform tests. Next run won't. If you experience problem during the tests, please report it here.
|
|
offline |
HA+HQ+VS+PdfToM, Reaper+Audiveris+Transcribe, Win10+Focusrite Scarlet 4i4+Nord Electro 3 Linktree: VS languages, my scripts, my bands, my performances...
|
|
|
Sylvain Machefert
Administrator
    

WWW |
Gender: 
Posts: 7827
|
 |
Re: [ANN] for devs: SMCore objects and libraries - Collection, Map, strings & more
« Reply #9 on: Dec 3rd, 2023, 8:23pm » |
Quote | Modify
|
Si quelqu'un a essayé l'un des deux scripts et as eu une erreur dans le log, il suffit de supprimer le fichier Myriad Documents/Settings/Scripts/Includes/SMCore-version.txt et relancer le script. Il y avait une erreur de fichier à télécharger. If you tried one of the two scripts, you may have seen an error in the log, just remove Myriad Documents/Settings/Scripts/Includes/SMCore-version.txt file and run it again, there was a mistake in the download list of files.
|
|
offline |
HA+HQ+VS+PdfToM, Reaper+Audiveris+Transcribe, Win10+Focusrite Scarlet 4i4+Nord Electro 3 Linktree: VS languages, my scripts, my bands, my performances...
|
|
|
Sylvain Machefert
Administrator
    

WWW |
Gender: 
Posts: 7827
|
 |
Re: [ANN] for devs: SMCore objects and libraries - Collection, Map, strings & more menu-teasing.png
« Reply #11 on: Jul 26th, 2024, 4:10pm » |
Quote | Modify
|
Still teasing... The very soon late. I had heavy works on HA last months. Writing, arranging, scripting to do it faster..., bugs and features requests... Before new work session, I'm rushing on scripts that will save me time. One of these use menus. You'll be able to build menus in your scripts. Better than popup menus, these can display icons, be hierarchical and have keyboard shortcut everywhere (you can browse entirely without mouse). Here is a compound screenshot of 3 cascading menus, only one is visible at once. In this capture : P opens "Palettes" menu, then C opens "Clefs..." menu, then I can pick one tool, e.g. "Fine" with F. A keyboard shortcut to run the script then 3 or 4 keys to get any tool. The "menu" script will be published too, but you have here an example of what you will be able to do in yours. Telle me what you think about this. I don't publish now, just before holidays. Hope I'll do in late August.
|
|
offline |
HA+HQ+VS+PdfToM, Reaper+Audiveris+Transcribe, Win10+Focusrite Scarlet 4i4+Nord Electro 3 Linktree: VS languages, my scripts, my bands, my performances...
|
|
|
Sylvain Machefert
Administrator
    

WWW |
Gender: 
Posts: 7827
|
 |
Re: [ANN] for devs: SMCore objects and libraries - Collection, Map, strings & more
« Reply #12 on: Aug 27th, 2024, 9:17pm » |
Quote | Modify
|
New version released : 20240825. Documentation is still here. Enjoy the new components. The "hotkey menu" script will come soon, demonstrating the use of SMMenu object, and saving you time
|
| « Last Edit: Aug 27th, 2024, 9:18pm by Sylvain Machefert » |
offline |
HA+HQ+VS+PdfToM, Reaper+Audiveris+Transcribe, Win10+Focusrite Scarlet 4i4+Nord Electro 3 Linktree: VS languages, my scripts, my bands, my performances...
|
|
|
Sylvain Machefert
Administrator
    

WWW |
Gender: 
Posts: 7827
|
 |
Re: [ANN] for devs: SMCore objects and libraries - Collection, Map, strings & more
« Reply #13 on: Sep 14th, 2024, 11:56pm » |
Quote | Modify
|
New version 2024-09-16 - fixes and improvments in menu and XY slider
- load & save score display setup
- functions for StavesGroup, and a better alternative to Score.JumpToBar(...)
- syntaxic sugars
- Minor fixes in menu colors and dialog buttons.
|
| « Last Edit: Sep 16th, 2024, 10:18pm by Sylvain Machefert » |
offline |
HA+HQ+VS+PdfToM, Reaper+Audiveris+Transcribe, Win10+Focusrite Scarlet 4i4+Nord Electro 3 Linktree: VS languages, my scripts, my bands, my performances...
|
|
|
Sylvain Machefert
Administrator
    

WWW |
Gender: 
Posts: 7827
|
 |
Re: [ANN] for devs: SMCore objects and libraries - Collection, Map, strings & more
« Reply #14 on: Feb 4th, 2025, 4:20pm » |
Quote | Modify
|
New version 2025-01-24 is now included in HA 9.9.9. In Scripts > Miscellaneous > Dev tools, you'll find 2 demos, a link to the documentation, and the "unit test" you can run to check integrity of the code and report here if a problem occurs.
|
|
offline |
HA+HQ+VS+PdfToM, Reaper+Audiveris+Transcribe, Win10+Focusrite Scarlet 4i4+Nord Electro 3 Linktree: VS languages, my scripts, my bands, my performances...
|
|
|
|