[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Aw: Re: [sc-users] VstPlugin.sc - a class to load VST plugins in SC



Hi, thanks for your feedback!
 
> 1. I was surprised that VstPlugin.new returns a Synth, and not a SynthDef.
 
that's because VstPlugin can't be created as an "ordinary" Synth because it's doing some additional work to setup/tear down the hidden messaging between Server and Client. that's why VstPlugin has to be a subclass of Synth as it overrides/extends some of Synth's functionality.
 
> the drawback is that the VST instance is killed when using cmd + period to stop all the patterns and hence getting
 
cmd + period releases all Nodes on the Server and since VST plugins must be created on the Server they are inevitably released too.
 
> 2. I am getting a lot of late messages when sending MIDI notes to VSTi, even if my server latency is the standard 0.2 seconds.
 
I noticed that too when I tested on macOS... Weirdly, this never happened for me on neither Windows nor Linux. I'm currently using OSC bundles, but it seems this is not necessary (anymore). I just switched to simple OSC messages and it seems to work OK (actually even better). I'll test on my Mac and post an updated version. thanks for reporting!
 
Christof
 
Gesendet: Montag, 14. Januar 2019 um 15:43 Uhr
Von: geoffroy.montel.ml@xxxxxxxxx
An: sc-users@xxxxxxxxxxxxxxxx
Betreff: Re: [sc-users] VstPlugin.sc - a class to load VST plugins in SC
Hey Christof
 
Honestly, this is really awesome, I was really eager to see VST(i) integration into SC and you made it !!! Thank you so much !
 
I've tried the alternative version and here are a few thoughts, please ignore if it is not relevant :)
I use SC 3.10 on a Macbook Air running Mac OS X 10.12
 
1. I was surprised that VstPlugin.new returns a Synth, and not a SynthDef.
Usually, in Supercollider, an instrument is represented by a SynthDef, and you create a Synth for each note or layer of polyphony.
I totally understand why you chose to map an instance of a VST plugin to a Synth, the drawback is that the VST instance is killed when using cmd + period to stop all the patterns and hence getting
VstPlugin freed!
 
2. I am getting a lot of late messages when sending MIDI notes to VSTi, even if my server latency is the standard 0.2 seconds.
late 0.023258091
 
However, this is really cool and for people who want to try it with patterns, here is an example :
 
(
Event.addEventType(\vstPlugin, { |server|
    var notes = [
        ~midinote.value,  // 0
        ~ctranspose.value,  // 1
        ~velocity.value, // 2
        ~sustain.value, // 3
        ~lag.value, // 4
        ~timingOffset.value, //5
        ~instrument, // 6
        ~midiChannel.value, // 7
    ].flop;
    var timeNoteOn, timeNoteOff;

    notes.do { |note|
        // sustain and timingOffset are in beats, lag is in seconds
        timeNoteOn = (thisThread.clock.tempo.reciprocal*note[5])+note[4];
        timeNoteOff = (thisThread.clock.tempo.reciprocal*(note[3]+note[5]))+note[4];

        SystemClock.sched(timeNoteOn, {
            note[6].midiNoteOn(chan: note[7] ? 0, note: (note[0]+note[1]).asInteger, veloc: note[2].asInteger.clip(0,127));
        });
        SystemClock.sched(timeNoteOff, {
            note[6].midiNoteOff(chan: note[7] ? 0, note: (note[0]+note[1]).asInteger, veloc: note[2].asInteger.clip(0,127));
        });
    }
});
)

(
Pbind(*[
    type: \vstPlugin,
    instrument: ~vst,
    dur: 4,
    degree: [0, 4],
    velocity: 64
]).play;
)

 
Thanks a lot !
 
Geoffroy
 

 
 
_______________________________________________ sc-users mailing list info (subscription, etc.): http://www.birmingham.ac.uk/facilities/ea-studios/research/supercollider/mailinglist.aspx archive: https://listarc.bham.ac.uk/marchives/sc-users/ search: https://listarc.bham.ac.uk/lists/sc-users/search/