Plug'n Script - no sound?

Official support for: bluecataudio.com
Post Reply New Topic
RELATED
PRODUCTS

Post

I am demoing PnS. I like the concept, it makes a lot of sense. But...

1. As a VSTi, there's no sound coming out of it in Renoise, at all. I've tried multiple presets. It does work as a VST though.
2. (SOLVED) The Sample Player preset doesn't produce any sound in Reaper, whether loaded as a VSTi or a VST. In Renoise, it makes sound as a VST, but is silent as a VSTi. In Reaper, other synth presets work as VSTi, and filter presets work as VST.

So I'd like to figure out how to use it as an instrument in Renoise, and to get sample playback to work. These are just the presets after a fresh installation that aren't working properly. If those don't work, not sure how much hope I have of getting my own working :)
Last edited by padillac on Thu Mar 17, 2022 9:05 am, edited 1 time in total.

Post

Alright I've worked out why Sample Player wasn't making sound in Reaper - it uses processSample, so the DAW needs to actually send it a sample. So I had to put some audio on the track and play it. Changing to processBlock and it plays non-stop as expected.

Not sure what's up with Renoise VSTi though. Guess I'll try a bare bones MIDI thing next and see what's going on...

Post

Renoise MIDI mystery (somewhat) solved: audioOutputsCount returns 0. This is for the VST plugin. Renoise shows it as having 8 outputs though.

Interestingly, it looks like PnS clears out samples[0] per block when audioOutputsCount == 0, but not the other channels.

The following script is effectively a MIDI gate tone, and works in Reaper. In Renoise, output 1 is correctly gated, but output 2 sustains indefinitely after receiving a Midi ON. Anyway I think the fix (?) may be to correctly read the audioOutputsCount from Renoise. But I can also work around it for the time being by always assuming 2 channels out, and clearing out the rest of the channels when it's not playing.

I'm only a few hours into reading docs and code and poking around, but I'm off and running! Never done any DSP / plugin coding before. This is really cool.

Code: Select all

string name = "Pat Test MIDI";
string description = "A simple MIDI plugin";

#include "library/Midi.hxx"

bool isPlaying = false;

void initialize()
{
  print("how many channels?");
  print(formatInt(audioOutputsCount));
}

void processBlock(BlockData& data)
{
  for(uint eventIndex = 0; eventIndex < data.inputMidiEvents.length; eventIndex++)
  {
    MidiEvent event = data.inputMidiEvents[eventIndex];
    MidiEventType eventType = MidiEventUtils::getType(event);

    if(eventType == kMidiNoteOn)
    {
      print("Midi ON");
      isPlaying = true;
    }
    else if(eventType == kMidiNoteOff)
    {
      print("Midi OFF");
      isPlaying = false;
    }
    else
    {
      print("Unknown Midi type");
    }
  }

  if(isPlaying) {
    print("PLAYING!");
    for(uint sampleIndex = 0; sampleIndex < data.samplesToProcess; sampleIndex++)
    {
      data.samples[0][sampleIndex] = 0.2;
      data.samples[1][sampleIndex] = 0.2;
    }
  }
}

Post

Thanks for the heads up, we'll have to check it out!

Post Reply

Return to “Blue Cat Audio”