Two Rookie questions

Post Reply
boingy
Posts: 11
Joined: Sun Jun 05, 2022 12:21 pm

Two Rookie questions

Post by boingy »

Hi folks,

I'm far from new to software but I am new to VM Designer.

1. Is there a decent programmer's reference guide somewhere? I've gleaned some stuff from the "Manual" on CA's website, from the example projects, from the list of library functions in the IDE and from this forum but it's slow going because I have to experiment to learn how stuff works, stuff that must be documented somewhere. Two recent examples are how to process Poly CV signals and how to send MIDI messages.

2. Is there a way to send text/values to the Output window in the debugger? Trace() or console.log() type stuff.
User avatar
honki-bobo
Posts: 306
Joined: Sat Nov 09, 2019 1:18 pm

Re: Two Rookie questions

Post by honki-bobo »

Hi boingy,

log in to your CA account and go to your library at https://store.cherryaudio.com/my/settin ... ge+Modular

Download and extract the VM Designer Development kit. Inside is a folder called "Documentation" where you will find a programmer's guide PDF and the JavaDoc API documentation (open the "index.html" and go from there).

For polyphonic signals you simply process each voice sequencially and use the GetPolyVaue(int polyChannel) and SetPolyValue(int polyChannel, double value) methods of the PolyJacks.

For example, instead of

Code: Select all

double myJackValue = myAudioJack.GetValue();
// do stuff with myJackValue
myOutputJack.SetValue(myJackValue)
you would code

Code: Select all

for (int polyChannel = 0; polyChannel < this.GetNumberOfPolyVoices(); polyChannel++) {
	double myJackValue = myPolyAudioJack.GetPolyValue(polyChannel);
	// do stuff with myJackValue
	myPolyOutputJack.SetPolyValue(polyChannel, myJackValue)
}
You can send MIDI messages by constructing a ShortMessage , setting the parameters you need according to MIDI standard and send it through the MIDI jack's AddMessage​(javax.sound.midi.ShortMessage message) method.

For console output use the Log(java.lang.String logStatement) or LogError(java.lang.String logStatement) methods of the VoltagModule class.

Best regards,
Martin
Image
Monkey Business Audio
Modules - Music - Twitter - YouTube
boingy
Posts: 11
Joined: Sun Jun 05, 2022 12:21 pm

Re: Two Rookie questions

Post by boingy »

Thanks Martin. I don't know how I didn't spot the documentation in my account. :oops:
The Log() thing is a lifesaver. I've been sending debug data to text labels, which is far from ideal!
ColinP
Posts: 951
Joined: Mon Aug 03, 2020 7:46 pm

Re: Two Rookie questions

Post by ColinP »

A word of warning on Log(). It works fine the vast majority of the time but I've seen some very strange behaviour on occasion. So sometimes writing to labels is a good fall back.

When doing anything dynamic, logging isn't much use anyway so one technique I use a lot is to add a temporary socket to a module and send test signals to the outside world through it. I call these sockets stomas after the medical technique.

Another thing to note is that multi-threading in VM isn't properly documented so if you do anything even remotely fancy you need to keep on your toes looking for thread safety issues.
boingy
Posts: 11
Joined: Sun Jun 05, 2022 12:21 pm

Re: Two Rookie questions

Post by boingy »

Thanks Colin, some good tips there. I'm some way from doing fancy stuff just yet. I'm still at the stage of fumbling around the class methods and cross referencing the many example files I have loaded up in a text editor on the second monitor. It won't take me long to get up to speed though, and then I can produce some proper bugs rather than rookie ones.

My core skill is real-time embedded C so I am very familiar with the quirks of minority-audience development tools. VM designer is pretty good so far but I know that tools like this make it really easy to get 95% of the way there but that the final 5% can drive you mad. Or maybe even be impossible.

So I imagine you'll be seeing a few more posts from me... :D
Post Reply

Return to “Module Designer”