I have expanded my idea of ββa utility to load random patches in UNIFY using the built-in OSC support.
After wrestling with JUCE / C ++ for a while 😓 , I developed it in C # instead. At the same time, I added some functionality.
See my YouTube clip for a demo and description of functionality.
Edit: Link removed
Win 10 and 11/Cubase Pro 12/Unify/Wavelab 8/Vienna Pro 7/Spectrasonics all/NI 13 Ultimate/Izotope MPS2/Serum/Cthulhu/Scaler 2.5/MusicLab guitar vsts/BIAB 2022/TouchOSC/Metagrid Pro etc
Hey, that's awesome.Β I'm hoping OSC for Unify will work for plugin versions in future.Β Any interest in having your program display a dropdownlist of libraries and show in wide format all the patches like my script?
Also, could you tell me what the OSC command is to init or to send a patch - like an actual example?Β I couldn't see where enough was revealed in the manual so far.Β Thanks.
Hi,
I thought back and forth about what to do with the filtration. A drop-down list for libraries was an option I was considering. I finally decided on the method I chose because it is completely flexible. But you should never say never, I may change that in the future 😎 .
Here is the main code lines for communication between the app and UNIFY ( in C#):
// Setup for communication var sender1 = new CoreOSC.UDPSender("127.0.0.1", 9001); var listener = new UDPListener(9000); // Send message to initiate session var message = new CoreOSC.OscMessage("/hello/127.0.0.1", 9000); sender1.Send(message); ... // Send to Unify for LOAD, EMBED or INIT float x = (float)i; message = new CoreOSC.OscMessage("/load", x); // loads x = rownumber in presets.db or message = new CoreOSC.OscMessage("/embed", x); // embeds x = rownumber in presets.db or message = new CoreOSC.OscMessage("/init", 0f); // Inits Unify sender1.Send(message); ... //Wait for Unify to answer that preset is loaded OscMessage messageReceived = null; while (messageReceived == null) //wait for UNIFY to answer /presetLoaded { messageReceived = (OscMessage)listener.Receive(); Thread.Sleep(1); s++; } // Tell Unify that it is done message = new CoreOSC.OscMessage("/goodbye", 1f); sender1.Send(message); // End session sender1.Close(); listener.Close();
I hope it helps you?
Win 10 and 11/Cubase Pro 12/Unify/Wavelab 8/Vienna Pro 7/Spectrasonics all/NI 13 Ultimate/Izotope MPS2/Serum/Cthulhu/Scaler 2.5/MusicLab guitar vsts/BIAB 2022/TouchOSC/Metagrid Pro etc
@craigr
Patch loading OSC commands are described at https://pluginguru.net/unify/manual/doku.php?id=osc-support#command_messages
Thanks guys.Β I'm just trying to understand UDP a little more because I've never used it in a programming situation.Β I thought it was connectionless unlike TCP.Β I thought I could just blast out a UDP packet using packet sender utility (screenshot) and Unify would respond, but it's not.Β If that's not true, why do the various hosts respond that are listed like DNS example.com?Β See anything wrong with my init command?
From https://en.wikibooks.org/wiki/Communication_Networks/TCP_and_UDP_Protocols:
Unlike TCP, UDP doesn't establish a connection before sending data, it just sends. Because of this, UDP is called "Connectionless".
Your code looks OK, so I'm not sure why you're not getting a response from Unify. UDP is indeed connectionless; this is why the "hello" command is important, because it tells Unify how to respond.
If I get time, I'll try setting up a test in C#, but I'm kinda busy right now, so it may be a while. Does it seem like Unify is getting your load/embed/init commands, i.e., does it perform the action?
No, I haven't even gotten to load or embed.Β In that example I'm sending the init command shown in screenshot.Β I start with a patch loaded in Unify so I can tell if it initializes, which it does not.Β I'm not sure if I have the correct syntax - like if the quotes should be there etc.Β Is sending the hello command prior required for init to work?Β The way I interpreted it from the manual isΒ that it's optional unless you want a response to a load completion.Β
"/init", 0f
/init, 0f
init, 0f
/hello/127.0.0.1", 9000 - I've tried sending this prior a couple times
That utility shows my port as 63580 and I can't figure out how to change that to 9000.
I attached Unify settings screenshot.Β I've also tried Any IP setting.
Thanks for the response - I'm just messing around - no need for quick replies.
I'm just starting to try this. Trying to figure out how to get and use the CoreOSC package.
To answer some of your other questions:
- The "hello" command is NOT required; neither is "goodbye". The "init", "load", and "embed" should work fine without, but Unify won't attempt to send a confirmation.
- The syntax will depend on the specifics of thisΒ CoreOSC package for C#, which I don't have yet, so I can't advise.
- Port numbers above 65536 are automatically assigned by the operating system. What you're seeing may be normal behavior.
I'm hardly an expert, but here is some C#/WinForms code that works:
using System; using System.Collections.Generic; using System.ComponentModel; using System.Data; using System.Drawing; using System.Linq; using System.Text; using System.Threading.Tasks; using System.Windows.Forms; using CoreOSC; using CoreOSC.IO; using System.Net.Sockets; namespace WindowsFormsApp1 { public partial class Form1 : Form { public Form1() { InitializeComponent(); } private async void initButton_Click(object sender, EventArgs e) { using (var udpClient = new UdpClient("127.0.0.1", 9001)) { var message = new OscMessage(new Address("/init"), new object[] { 0.0F }); await udpClient.SendMessageAsync(message); } } private async void loadButton_Click(object sender, EventArgs e) { using (var udpClient = new UdpClient("127.0.0.1", 9001)) { var message = new OscMessage(new Address("/load"), new object[] { 8690.0F }); await udpClient.SendMessageAsync(message); } } private async void embedButton_Click(object sender, EventArgs e) { using (var udpClient = new UdpClient("127.0.0.1", 9001)) { var message = new OscMessage(new Address("/embed"), new object[] { 8690.0F }); await udpClient.SendMessageAsync(message); } } } }
- The form itself simply has three buttons "init", "load", and "embed".
- Note how I'm adding a single floating-point argument to eachΒ OscMessage.
- For the /init command, the argument is ignored, but it must still be present. I've set the value to 0.0.
- For the other two commands, the value 8690 is theΒ rowid of a specific patch in my Presets.db file.
- Use of the C#Β async qualifier is necessary, for the compiler to accept use of the await function.
To find the rowid's for specific patches, you need to read the patch databaseΒ Presets.db, which lives Unify'sΒ Libraries folder. You can open it yourself in DB Browser for SQLite, and issue SQL commands like
SELECT ROWID, name FROM Presets WHERE library='Unify Standard Library'
to find validΒ rowid numbers. These are integers, but must be expressed as floating-point (just append ".0F") in the OSC messages.
A question @gerdunne?
It seems like /presetLoaded is sent before the patch is fully loaded when the patch takes long time to load. Is that the case?
Win 10 and 11/Cubase Pro 12/Unify/Wavelab 8/Vienna Pro 7/Spectrasonics all/NI 13 Ultimate/Izotope MPS2/Serum/Cthulhu/Scaler 2.5/MusicLab guitar vsts/BIAB 2022/TouchOSC/Metagrid Pro etc
It seems like /presetLoaded is sent before the patch is fully loaded when the patch takes long time to load. Is that the case?
It shouldn't be, but this can be hard to control. Can you give an example?
Also note some plug-ins take time to load resources like samples, so when Unify itself has finished loading a patch, one or more of the plug-ins it uses might not yet be ready to play. Unify has no way of knowing this.
I tested some more and I think you are right. PresetLoaded is sent when the patch βappearsβ to be loaded in Unify, but it still takes a while until you can play it. I noticed it in Kontakt patches with a lot of samples. I suspect that plugins donβt βtellβ Unify when it is fully loaded?
Win 10 and 11/Cubase Pro 12/Unify/Wavelab 8/Vienna Pro 7/Spectrasonics all/NI 13 Ultimate/Izotope MPS2/Serum/Cthulhu/Scaler 2.5/MusicLab guitar vsts/BIAB 2022/TouchOSC/Metagrid Pro etc
I suspect that plugins donβt βtellβ Unify when it is fully loaded?
Correct. I'm not aware of any provision for this in any plug-in standard. Hence it's not specific to Unify. DAWs will be the same.
I was asked to share this app, so here it is. Edit: Link removed
Beware:
- This is not a supported program. It is made for my own benefit for experimenting and testing purposes. So you are using it on your own risk.
- I can only give very limited support.
- It is Windows only (developed and tested on Win Pro 10)
- Requires UNIFY 1.7.2 or later for OSC functionality.
The program doesn't require installation so the footprint is minimal.
A short "Manual" is included in the downloaded folder describing how to get started and how it works.
Win 10 and 11/Cubase Pro 12/Unify/Wavelab 8/Vienna Pro 7/Spectrasonics all/NI 13 Ultimate/Izotope MPS2/Serum/Cthulhu/Scaler 2.5/MusicLab guitar vsts/BIAB 2022/TouchOSC/Metagrid Pro etc
I was asked to share this app, so here it is. (...)
Thanks!
@thsve
Thanks Thomas!
I have expanded my idea of ββa utility to load random patches in UNIFY using the built-in OSC support.
After wrestling with JUCE / C ++ for a while 😓 , I developed it in C # instead. At the same time, I added some functionality.
See my YouTube clip for a demo and description of functionality.Edit: Link removed
Β
@thsve how can I get your patch loader?
[@getdunne here. I edited this to add @thsve's name. @thsve if you have any trouble adding a link, just "spell it out" like blah <at> blah <dot> com and I'll edit your response and fix the link.]
Sorry. After my latest additions to the program, Iβve decided to not publish it. The main reason for this is that the latest version has some new features that is not standard UNIFY behavior (e.g ratings) and it makes changes to the patch database to make that work. It works and for me and is not an issue since I know the program, but for that reason I donβt feel comfortable to share it.
Win 10 and 11/Cubase Pro 12/Unify/Wavelab 8/Vienna Pro 7/Spectrasonics all/NI 13 Ultimate/Izotope MPS2/Serum/Cthulhu/Scaler 2.5/MusicLab guitar vsts/BIAB 2022/TouchOSC/Metagrid Pro etc
ok thanks