@clevername27 no I am not looking for the fft in the scripting api, I want an fft I can process in a script node using something like snex or c++, I need speed
Posts made by jdurnil
-
RE: FFT processing inside of scriptnode
-
RE: FFT analysis programmatically?
@ThomAce please do share, I am looking for a way to process fft in a script node and I can’t find anything
-
FFT processing inside of scriptnode
I find SNEX and scriptnode to be incredibly powerful and flexible tools when worinf in the time domain. However I’m wondering what my options are for spectral processing with just HISE tools. ️ have looked under the hood and there is plenty HISE source code that deals with handling ffts but it doesn’t appear to be at least readily available to do that type of processing inside SNEX. I have the option of rolling my own with a third party node or using FAUST or RNBO. For now I’ve chosen RNBO as it was fairly trivial to do what I wanted to do in there but I’d love to have this inside HISE out of the box. Maybe I’m missing something but it doesn’t appear to be an option.
-
RE: RNBO frequency ducking
Hey, that was my first ever Max and RNBO patch. I realized it causes crazy distortion when you move the gain up on the sidechain due to producing negative numbers and feeding those back into the poltocar. I do have a fix for this and will post it later. I’m going to use a multiplier instead and determine a gain reduction factor based on a threshold.
-
RNBO frequency ducking
I just created this frequency ducking algorithm in RNBO to use ultimately as a node in script node. I’ve tested it out and it works perfectly. I am going to add a strength of effect parameter but beyond that it works really well. If anyone who has Mac and Rnbo is interested in the patch let me know and I’ll send it on
-
RE: Juce named pipe code sanity check,
never mind about waitable event, I just found out it will not work across instances, back to the drawing board
-
RE: Juce named pipe code sanity check,
@Christoph-Hart I don't know if you noticed but I am using a cross thread waitable event to attempt to synchronize read/write. I am also not going to process any incoming buffer here in this node, I am using your sidechain2 snippet example to try and ensure that the pipe data is read in first before sending it over to be processed with any incoming buffer from master. I'll paste a few screenshots to explain, first the waitable, then the script fx. Does any of this help solve sync?
-
RE: Juce named pipe code sanity check,
@jdurnil NamedPipe.read is a blocking call and could be put in the processblock of master and you could get rid of the fifo all together, then master process would not continue until buffer is full, but blocking processblock sounds like a bad idea
-
RE: Juce named pipe code sanity check,
@Christoph-Hart these are all questions I don’t have the answer to, I’ve been worried about sync. I am pretty new to audio processing but not programming so there are some things I’m trying to still get my head around. If the fifo buffer is not full when master goes to process you can see I’m just skipping that process block, but that creates an issue. Is there a better way I can look to sync the reader and writer? And resolve some of these glaring issues?
-
RE: Fft based processing
@HISEnberg i can report that the RNBO fft processing is working fine. I don’t know if they’ve updated it or if people weren’t passing on the imaginary output all the way back to the ifft, that would cause issues. I am going to use RNBO for my fft processing
-
RE: Scriptnode parameter value not changing
@HISEnberg yes everything works correctly, so it’s not a big deal at all. Was just curious if there was something I was not getting.
-
Juce named pipe code sanity check,
Hello, I would be eternally grateful if someone could help me with a Juce named pipe sanity check. This code will be ported to a third party scriptnode to take in signal from another instance and then I will move it along for processing. Namedpipe.read is a blocking call so I didn’t want to call it directly in processblock. So, I am running it in a new thread and filling up a fifo buffer that will be ingested in process block and written to the block being processed(no signal will be coming in to the scriptnode node) . Here is my juce class for namedpipereader and audioprocessor, the variables used are declared in header files not included here. It’s kind of hairy code and I’m not sure it will work, synchronization, race conditions etc. If you see any glaring or not so glaring issues I could fix I would be very grateful. I am an adequate programmer in general but audio processing is still kind of new to me.
#include "NamedPipeReader.h" NamedPipeReader::NamedPipeReader(const juce::String& pipeName, juce::AbstractFIFO& fifo, bool createNewPipeIfNeeded) : Thread("NamedPipeReaderThread"), namedPipe(), fifo(fifo), fifoBuffer(nullptr), bufferSize(0) { if (createNewPipeIfNeeded) { if (!namedPipe.openExistingPipe(pipeName)) { namedPipe.createNewPipe(pipeName); } } else { namedPipe.openExistingPipe(pipeName); } startThread(); } NamedPipeReader::~NamedPipeReader() { stopThread(5000); delete[] fifoBuffer; } void NamedPipeReader::setBufferSize(int newSize) { if (newSize != bufferSize) { bufferSize = newSize; delete[] fifoBuffer; fifoBuffer = new juce::uint8[bufferSize]; } } void NamedPipeReader::run() { while (!threadShouldExit()) { if (namedPipe.isOpen() && fifoBuffer) { if (dataAvailable.wait(10)) // Wait for data or timeout after 10 ms { juce::MemoryBlock buffer(bufferSize); int bytesRead = namedPipe.read(buffer.getData(), buffer.getSize(), 100); // 100ms timeout if (bytesRead > 0) { // Write data to the FIFO int start1, size1, start2, size2; fifo.prepareToWrite(bytesRead, start1, size1, start2, size2); if (size1 > 0) memcpy(fifoBuffer + start1, buffer.getData(), size1); if (size2 > 0) memcpy(fifoBuffer + start2, buffer.getData() + size1, size2); fifo.finishedWrite(size1 + size2); } } } } } void NamedPipeReader::writeData(const float* data, int numSamples) { if (namedPipe.isOpen()) { namedPipe.write(data, numSamples * sizeof(float)); signalDataAvailable(); // Signal that data is available } } void NamedPipeReader::signalDataAvailable() { dataAvailable.signal(); }
#include "MyAudioProcessor.h" MyAudioProcessor::MyAudioProcessor() : fifo(2048), namedPipeReader("MyNamedPipe", fifo, true), isMaster(false) // Set to true to create a new pipe if it doesn't exist { } void MyAudioProcessor::prepareToPlay(double sampleRate, int samplesPerBlock) { juce::ignoreUnused(sampleRate); setFifoSize(samplesPerBlock * sizeof(float)); // Set initial FIFO size } void MyAudioProcessor::processBlock(juce::dsp::AudioBlock<float>& audioBlock, juce::MidiBuffer&) { const int blockSize = audioBlock.getNumSamples(); const int numChannels = audioBlock.getNumChannels(); // Adjust FIFO size if necessary setFifoSize(blockSize * numChannels * sizeof(float)); if (isMaster) { // Check if the FIFO has enough data before copying if (fifo.getNumReady() >= blockSize * numChannels * sizeof(float)) { for (int channel = 0; channel < numChannels; ++channel) { int start1, size1, start2, size2; fifo.prepareToRead(blockSize * sizeof(float), start1, size1, start2, size2); if (size1 > 0) memcpy(audioBlock.getChannelPointer(channel), fifoBuffer + start1, size1); if (size2 > 0) memcpy(audioBlock.getChannelPointer(channel) + (size1 / sizeof(float)), fifoBuffer + start2, size2); fifo.finishedRead(size1 + size2); } } else { // If the FIFO does not have enough data, clear the audio block to silence audioBlock.clear(); } } else { // Write data to the named pipe if this instance is a slave for (int channel = 0; channel < numChannels; ++channel) { namedPipeReader.writeData(audioBlock.getChannelPointer(channel), blockSize); } } } void MyAudioProcessor::setIsMaster(bool master) { isMaster = master; } void MyAudioProcessor::setFifoSize(int newSize) { if (newSize != fifo.getTotalSize()) { fifo = juce::AbstractFIFO(newSize); namedPipeReader.setBufferSize(newSize); } }
-
RE: HISE JUCE 8 license question
@Christoph-Hart thank you, I’m not quite ready to put juce 8 features in yet, but when the time comes and they release it I want to utilize Midi 2 implementation but that may be a big ask.
-
RE: Scriptnode parameter value not changing
@HISEnberg thank you for your reply I'll try and explain it a little better with screenshots. This is a simple gain example with all knobs set to a range of -100 to 0, as you can see it is all working correctly but the value indicator on the script node parameter is still showing -100, this is my issue.
-
Scriptnode parameter value not changing
I have a dropdown with three options. I have hooked that dropdown to a scriptnode parameter which is then fed into a parameter on a third party node. The min max is 1 to 3 , skew is 1, and step size is 1 the two parameters in script node. However the “master” parameter has a value option which I leave to the default which is 1. This all works quite well and accomplishes my goal of getting the combo box choice into my third party node. But, when I change the 🪮 box from say the first option to the second the “master” parameter in the scriptnode stays at 1.0, the knob clearly indicates a position of 2 and the third party nodes value and knob are set to 2. So visually the top level scriptnode displays a 1.0 no matter what your ui choice. When you click the parameter to get its settings it says its value is 1.0 no matter what. Is there something I’m not understanding?
-
RE: HISE JUCE 8 license question
I would just point the build to the juce8 core modules when building and cross my fingers
-
HISE JUCE 8 license question
I have come to discover that HISE is an extremely powerful and well written and well maintained framework. I want to continue using it for as long as I can. I understand that there are some licensing issues with HISE and JUCE 8. My question is if I hold a JUCE license can I try and build HISE with JUCE 8 and use the JUCE 8 projucer. There are some things in JUCE 8 I want to use and I’m happy to code them myself to integrate into HISE. Is this something that’s even feasible to think about?
-
RE: Named Pipe idea
@Christoph-Hart yes it would, that was pretty much what I was thinking
-
RE: Named Pipe idea
@aaronventure it looks like you have something working for and that was very clever to come up with that, but I do think it would be cleaner with named pipe