Cantabile dot NET library

Hi @brad and all :smile:

It’s a long time I’m coding myself utilities in VB.Net interacting with Cantabile via Midi.
I recently, tried a few simple Network API interactions like asking Cantabile for States list or Song List.

So the idea came to have a .NET library somewhat mimicking the JavaScript API behaviour.

As you can guess from VB.net, I’m not a skilled programmer. My business is music.

In fact this is already a pretty advanced project and Claude helped a lot (Sorry @brad :downcast_face_with_sweat:) . Library is built with all documented functions available in Cantabile API, events etc…
Tests with a local Cantabile instance basically works

At the moment it’s an internal VB.net Nuget ready.library.

The idea after deep testing is to share a C# source version and a Nuget Package.

@brad tell me your thoughts about idea, sharing and naming.
.

1 Like

Here is a vb.net usage example:


Imports Cantabile

’ Create and connect a session
Dim session = New CantabileSession(“localhost”, 35007)
Await session.ConnectAsync()

’ Read current state
Console.WriteLine($“Song : {session.Song.Name}”)
Console.WriteLine($“Transport : {session.Transport.State} @ {session.Transport.Tempo} BPM”)

’ Event subscription
AddHandler session.Transport.StateChanged, Sub(s, e)
Console.WriteLine($“New State : {session.Transport.State}”)
End Sub

’ Control
Await session.Transport.PlayAsync()

’ Disconnection
Await session.DisconnectAsync()
Await session.DisposeAsync()


Available Endpoints

session.Transport
session.Song
session.SetList
session.SongStates
session.Application
session.Variables
session.Commands
session.Bindings
session.ShowNotes
session.KeyRanges
session.OnscreenKeyboard
session.Engine

1 Like