UNIFY - Patch Loade...
 
Notifications
Clear all

UNIFY - Patch Loader

20 Posts
6 Users
6 Likes
1,136 Views
(@195507170073)
MR
Joined: 3 years ago
Posts: 327
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)
Member
Joined: 3 years ago
Posts: 195
 

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
(@195507170073)
MR
Joined: 3 years ago
Posts: 327
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)
Illustrious Member Admin
Joined: 4 years ago
Posts: 4095
 

@craigr

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


   
ReplyQuote
(@craigr68)
Member
Joined: 3 years ago
Posts: 195
 

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)
Illustrious Member Admin
Joined: 4 years ago
Posts: 4095
 

@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)
Member
Joined: 3 years ago
Posts: 195
 

@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)
Illustrious Member Admin
Joined: 4 years ago
Posts: 4095
 

@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)
Illustrious Member Admin
Joined: 4 years ago
Posts: 4095
 

@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
(@195507170073)
MR
Joined: 3 years ago
Posts: 327
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)
Illustrious Member Admin
Joined: 4 years ago
Posts: 4095
 
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
(@195507170073)
MR
Joined: 3 years ago
Posts: 327
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)
Illustrious Member Admin
Joined: 4 years ago
Posts: 4095
 
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.


   
195507170073 reacted
ReplyQuote
(@195507170073)
MR
Joined: 3 years ago
Posts: 327
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: 284
 
Posted by: @thsve

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

Thanks!


   
ReplyQuote
JeremyH
(@zinct)
Member
Joined: 3 years ago
Posts: 514
 

@thsve

Thanks Thomas!


   
ReplyQuote
(@neakeba)
Active Member
Joined: 1 year ago
Posts: 10
 

Posted by: @195507170073

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

Β 


   
ReplyQuote
(@neakeba)
Active Member
Joined: 1 year ago
Posts: 10
 

@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.]


   
ReplyQuote
(@195507170073)
MR
Joined: 3 years ago
Posts: 327
Topic starter  

@neakebaΒ 

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


   
ReplyQuote
(@neakeba)
Active Member
Joined: 1 year ago
Posts: 10
 

ok thanks


   
ReplyQuote
Share: