UNIFY - Patch Loade...
 
Notifications
Clear all

UNIFY - Patch Loader

16 Posts
5 Users
5 Likes
723 Views
thsve
(@thsve)
Member
Joined: 3 years ago
Posts: 302
Topic starter  

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


   
Robert.P and RedRose68 reacted
Quote
craigr68
(@craigr68)
Member
Joined: 2 years ago
Posts: 172
 

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.


   
ReplyQuote
thsve
(@thsve)
Member
Joined: 3 years ago
Posts: 302
Topic starter  

@craigr68 

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


   
ReplyQuote
getdunne
(@getdunne)
Illustrious Member Admin
Joined: 3 years ago
Posts: 3683
 

@craigr

Patch loading OSC commands are described at https://pluginguru.net/unify/manual/doku.php?id=osc-support#command_messages


   
ReplyQuote
craigr68
(@craigr68)
Member
Joined: 2 years ago
Posts: 172
 

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".


   
ReplyQuote
getdunne
(@getdunne)
Illustrious Member Admin
Joined: 3 years ago
Posts: 3683
 

@craigr68

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?


   
ReplyQuote
craigr68
(@craigr68)
Member
Joined: 2 years ago
Posts: 172
 

@getdunne 

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.


   
ReplyQuote
getdunne
(@getdunne)
Illustrious Member Admin
Joined: 3 years ago
Posts: 3683
 

@craigr68

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.

   
ReplyQuote
getdunne
(@getdunne)
Illustrious Member Admin
Joined: 3 years ago
Posts: 3683
 

@craigr68

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.


   
ReplyQuote
thsve
(@thsve)
Member
Joined: 3 years ago
Posts: 302
Topic starter  

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


   
ReplyQuote
getdunne
(@getdunne)
Illustrious Member Admin
Joined: 3 years ago
Posts: 3683
 
Posted by: @thsve

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.


   
ReplyQuote
thsve
(@thsve)
Member
Joined: 3 years ago
Posts: 302
Topic starter  

@getdunne 

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


   
ReplyQuote
getdunne
(@getdunne)
Illustrious Member Admin
Joined: 3 years ago
Posts: 3683
 
Posted by: @thsve

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.


   
thsve reacted
ReplyQuote
thsve
(@thsve)
Member
Joined: 3 years ago
Posts: 302
Topic starter  

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


   
JeremyH and Robert.P reacted
ReplyQuote
Robert.P
(@robert-p)
Reputable Member
Joined: 3 years ago
Posts: 217
 
Posted by: @thsve

I was asked to share this app, so here it is. (...)

Thanks!


   
ReplyQuote
JeremyH
(@zinct)
Member
Joined: 2 years ago
Posts: 499
 

@thsve

Thanks Thomas!


   
ReplyQuote
Share: