Code Monkey home page Code Monkey logo

gin's People

Contributors

asimilon avatar benstatbl avatar christofmuc avatar drowaudio avatar figbug avatar jpcima avatar kcoul avatar majormurphy avatar marckamradt avatar modosc avatar refx-mike avatar stfufane avatar taylordotfish avatar timothyschoen avatar witte avatar yatskevich avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

gin's Issues

applyBrightnessContrast changes alpha values?

Changing the brightness affects completely invisible pixels whose alpha values are 0. When used on an image like that, and lowering the brightness, the invisible pixels become visibly darker.

It seems almost as if the alpha values are darkened too.

Note: this function interprets the input value for contrast correctly, so positive values increase contrast, negative values decrease it.

Feature: HTTP/Websocket server

Currently the project exports a WebSocket client for use. Can this code be easily augmented to support hosting a WebSocket server?

Web Sockets Connection Failed Intermittently

I've been getting a "Connection error!" message while using the web sockets classes in Gin. Our javascript and other implementations seem to work correctly without issue on the same server so I'm wondering if it has to do with Gin specifically, or the low level juce classes that it uses. Just wondering if you've ever seen this behavior. Thanks by the way- awesome library all around.

Knob's text value won't update.

Hi, I think it's a Gin issue. Every knob text label doesn't update on changing:

изображение

Standalone and all plugins format. It's on linux (openSUSE TW, X11)

Fix for filenamelength on Windows

e.file = folder.getChildFile (String (fni->FileName, fni->FileNameLength));

The fni->FileNameLength field is the size of the file name in bytes, not the number of wchars in the String.

The fix is this :

e.file = folder.getChildFile(String(fni->FileName, fni->FileNameLength / sizeof(wchar_t)));

Most of the time you don't see the bug because for single event buffers the byte after the fni record is already null, but when you have multiple events, there is not always a null byte after the end of the string so it was creating invalid filenames.

layout doesn't work on macos when app sandbox is enabled

this code won't work on macos if app sandbox is enabled. specifically only a single element is rendered:

image

i ended up getting it to work with this horribleness:

void Editor::resized() {
#if JUCE_DEBUG
#if JUCE_MAC
  if (juce::SystemStats::isAppSandboxEnabled()) {
    DBG("disabling layout reloading because AppSandbox is enabled");
    layout.setLayout("layout.json");
  } else {
    auto f = juce::File(__FILE__).getChildFile("../../Resources/layout.json");
    layout.setLayout("layout.json", f);
  }
#else
  auto f = juce::File(__FILE__).getChildFile("../../Resources/layout.json");
  layout.setLayout("layout.json", f);
#endif
#else
  layout.setLayout("layout.json");
#endif
}

i'm not suggesting you do this in the demos but maybe a comment about AppSandbox compatibility would help the next person who hits this?

FileSystemWatcher: add a removeAllFolders() method

More a feature request really.

Use case:

I have a list in my GUI showing the files in a folder.
Said list gets updated when the FileSystemWatcher says something has changed.
The user can press a "browse" a button to change which folder has its content listed.
When the folder to display changes, I must tell the FileSystemWatcher to stop watching the old folder and watch the new one.
This implies that at that moment I must have a track of what the old folder was to call removeFolder(), while what I really would like to do is tell the watcher: "forget whatever folder you were watching before", and then call addFolder(newFolder) to watch the new one

Demo does not build OOTB with JUCE 6.1

The following snippet missing a lot of JUCE 6.1 functions

`void ResamplingFifo::pushAudioBufferInt (const juce::AudioSampleBuffer& src)
{
jassert (src.getNumSamples() <= blockSize);

int todo = src.getNumSamples();
int done = 0;

{
    using SourceFormat = juce::AudioData::Format<juce::AudioData::Float32, juce::AudioData::NativeEndian>;
    using DestFormat   = juce::AudioData::Format<juce::AudioData::Float32, juce::AudioData::NativeEndian>;

    juce::AudioData::interleaveSamples (juce::AudioData::NonInterleavedSource<SourceFormat> { src.getArrayOfReadPointers(),      numChannels },
                                        juce::AudioData::InterleavedDest<DestFormat>        { ilInputBuffer.getWritePointer (0), numChannels },
                                        src.getNumSamples());
}


SRC_DATA data;
data.data_in = ilInputBuffer.getReadPointer (0);
data.data_out = ilOutputBuffer.getWritePointer (0);
data.output_frames = 4 * blockSize;
data.src_ratio = ratio;
data.end_of_input = 0;

while (todo > 0)
{
    data.input_frames = todo;
    data.input_frames_used = 0;
    data.output_frames_gen = 0;

    data.data_in = ilInputBuffer.getReadPointer (0) + done * numChannels;

    src_process (impl->state, &data);

    todo -= data.input_frames_used;
    done += data.input_frames_used;

    if (data.output_frames_gen > 0)
    {
        using SourceFormat = juce::AudioData::Format<juce::AudioData::Float32, juce::AudioData::NativeEndian>;
        using DestFormat   = juce::AudioData::Format<juce::AudioData::Float32, juce::AudioData::NativeEndian>;
        
        juce::AudioData::deinterleaveSamples (juce::AudioData::InterleavedSource<SourceFormat> { ilOutputBuffer.getReadPointer (0),      numChannels },
                                              juce::AudioData::NonInterleavedDest<DestFormat>  { outputBuffer.getArrayOfWritePointers(), numChannels },
                                              int (data.output_frames_gen));

        outputFifo.write (outputBuffer, int (data.output_frames_gen));
    }
}

}`

DownloadManager: uninitialized "pause" boolean

In DownloadManager, the member atomic pause (std::atomic<bool> pause;) is left uninitialized.
This can cause random hangs if by any chance it's uninitialized state is true.
It shoud be std::atomic<bool> pause = false;

How to use gin::PerlinNoise correctly?

Hey Roland.

Thanks for fixing that I assert I posted.

I'm using your Perlin Noise class from Gin. It's saving us a lot of time, so thanks for making it.

I'm feeding it a 2D array of x/y coordinates ranging from 0 to 1, with the class declared as gin::PerlinNoise<float>.

I'm expecting to see something like this:
expected noise

I'm getting this instead when I use an input range of [0, 1]
Screen Shot 2022-12-29 at 12 43 44 PM

If I use a higher range, some weird tiling happens:
Screen Shot 2022-12-29 at 12 40 17 PM

Is this due to how many octaves you're calculating?

Parameters names and count not used properly for LV2

I've encountered this problem while working on PAPU, which supports LV2.

When building the Synth example in LV2 format on Linux, it seems that parameter name and parameter count is not detected properly. There's probably something missing for the lv2 helper program provided by Juce to map everything properly, although manually inspecting the generated dsp.ttl file shows the the parameters were indeed found, with the right names and number.

Below is a screen capture of Carla showing the VST3 version (left) vs the LV2 version (right), showing the missing parameters.
synthvssynth

In LevelTracker, only the first channel of the audio buffer is referenced.

Hello Roland,

I found a code that is probably a mistake.
As the title says, only the first channel of the audio buffer is referenced in LevelTracker component.

trackBuffer (buffer.getReadPointer (0), buffer.getNumSamples());

This code is causing, if the plugin can receive stereo signals, the level meter do not respond when the signal is input to the R channel only.
e.g. Compressor and Limiter in the slPlugins repository.
If I change this code as follows, such behavior will be collected.

trackBuffer (buffer.getReadPointer (i), buffer.getNumSamples());

Transparent pixels affected by brightness contrast

Hi,
we noticed that when applying brightness/contrast to a ARGB image, the transparent pixels becomes opaque someways.

Original:
knob_before

With brightness/contrast
knob_after

You can clearly see the "box" around the knob, which is not desired.

Would like support for new CMake based JUCE

Hi! Love your work! I integrate the Gin module into a bigger application using the new JUCE 6's CMake mechanism.

I wrote a mini CMakeLists.txt for the Gin library, which works as expected on Linux and Windows, but utterly fails on the Mac build. Me, not being Mac savvy, have no idea what is going wrong. It seems the #import pragma somehow is wrong.

The CMakeLists.txt I have written is here: https://github.com/christofmuc/KnobKraft-orm/blob/master/third_party/CMakeLists.txt

I include Gin as a git submodule.

The error message on the Mac is in the build log (hope the access permissions allow you to follow that link:
https://dev.azure.com/christof0759/KnobKraft/_build/results?buildId=292&view=logs&j=e0fca624-2401-5624-f540-1c188feac080&t=95b3b2e9-1390-5b19-59f2-dbccb23e7f0a

Basically it reads:

In file included from /Users/runner/work/1/s/third_party/Gin/modules/gin/gin.cpp:30:
In file included from /Applications/Xcode_11.3.1.app/Contents/Developer/Platforms/MacOSX.platform/Developer  /SDKs/MacOSX10.15.sdk/System/Library/Frameworks/Foundation.framework/Headers/Foundation.h:8:
/Applications/Xcode_11.3.1.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX10.15.sdk/System /Library/Frameworks/Foundation.framework/Headers/NSObjCRuntime.h:492:1: error: expected unqualified-id
@class NSString, Protocol;
^

The error seems to indicate it has interpreted the #import as Objective-C?

Sorry if that is confusing, but maybe it's an opportunity for you to update Gin to the latest JUCE?

can't compile demo to IOS phone

i can't seem to compile the demo project to my IOS phone (iphone 6).
i get about 20 errors, almost all are semantic issues.

the last couple:
/Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/lib/clang/11.0.0/include/mmintrin.h:387:19: error: use of undeclared identifier '__builtin_ia32_paddw' return (__m64)__builtin_ia32_paddw((__v4hi)__m1, (__v4hi)__m2); ^ /Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/lib/clang/11.0.0/include/mmintrin.h:408:19: error: use of undeclared identifier '__builtin_ia32_paddd' return (__m64)__builtin_ia32_paddd((__v2si)__m1, (__v2si)__m2); ^ /Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/lib/clang/11.0.0/include/mmintrin.h:430:19: error: use of undeclared identifier '__builtin_ia32_paddsb' return (__m64)__builtin_ia32_paddsb((__v8qi)__m1, (__v8qi)__m2); ^ /Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/lib/clang/11.0.0/include/mmintrin.h:453:19: error: use of undeclared identifier '__builtin_ia32_paddsw' return (__m64)__builtin_ia32_paddsw((__v4hi)__m1, (__v4hi)__m2); ^ /Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/lib/clang/11.0.0/include/mmintrin.h:475:19: error: use of undeclared identifier '__builtin_ia32_paddusb' return (__m64)__builtin_ia32_paddusb((__v8qi)__m1, (__v8qi)__m2); ^ fatal error: too many errors emitted, stopping now [-ferror-limit=] 20 errors generated.

my steps are:

  1. I open demo in projucer
  2. Add my signing id & bundle identifier to the projucer project
  3. open iOS project with XCode
  4. select my phone as target
  5. press run.
  6. get errors

Adding a glow effect? :-)

Hello there,
Great piece of software that you did.
Do you plan to add a "glow effect" ? ;-)

Thanks

gin::PerlinNoise(seed) constructor triggers a jassert

This constructor causes a jassert in juce::ArrayBase:

    PerlinNoise (unsigned int seed)
    {
        juce::Random r (seed);

        for (int i = 0; i <= 255; i++)
            p.add (i);

        shuffleArray (r, p);

        p.addArray (p);
    }

the line in question is:

p.addArray (p);

The jassert being triggered is:

    template <class OtherArrayType>
    void addArray (const OtherArrayType& arrayToAddFrom)
    {
        jassert ((const void*) this != (const void*) &arrayToAddFrom); // can't add from our own elements!

Here is a solution that gets around the jassert:

    PerlinNoise (unsigned int seed)
    {
        juce::Random r (seed);

        for (int i = 0; i <= 255; i++)
            p.add (i);

        shuffleArray (r, p);

        auto copy = p; //insert this line
        
        p.addArray (copy);
    }

MessagePack serialization is broken for negative integers

Hi 👋 ,
There are seem to be some unhandled cases in the MessagePack serializer:

  • fromData does not handle cases 0xd0, 0xd1, 0xd2, and 0xd3:
...
        else if (d == 0xd0)
        {
            return int(is.readByte());
        }
        else if (d == 0xd1)
        {
            return int(is.readShortBigEndian());
        }
        else if (d == 0xd2)
        {
            return is.readIntBigEndian();
        }
        else if (d == 0xd3)
        {
            return is.readInt64BigEndian();
        }
...
  • toData code reads
...
            else if (v >= 32768)
            {
                os.writeByte (char (0xd1));
                os.writeShortBigEndian (short (v));
            }
            else if (v >= 2147483648)
            {
                os.writeByte (char (0xd2));
                os.writeIntBigEndian (int (v));
            }
...

has to be

...
            else if (v >= -32768)
            {
                os.writeByte (char (0xd1));
                os.writeShortBigEndian (short (v));
            }
            else if (v >= -2147483648LL)
            {
                os.writeByte (char (0xd2));
                os.writeIntBigEndian (int (v));
            }
...
  • Also on line 167:
        else
        {
            os.writeByte (char (0xdc));
            os.writeIntBigEndian (n);
        }

must be

        else
        {
            os.writeByte (char (0xdd));
            os.writeIntBigEndian (n);
        }

Thanks!

gin::Dynamics usage

I don't really understand how to properly use this class. Here's my current usage:

// during setup:
m_limiter.setSampleRate(sampleRate);
m_limiter.setNumChannels(2);
m_limiter.setMode(gin::Dynamics::limiter);
m_limiter.setParams(
	0.002f, // Attack in seconds
	0.08f, // Release in seconds
	0, // Threshold in dB?
	10, // Ratio in ?
	0 // Knee width in ?
);

// during processing:
m_limiter.process(buffer);

If I set the threshold to -50, it only seems to lower the output volume. Am I doing something wrong? What parameters do I use to get a similar result as juce::dsp::Limiter?

Also, I assume the extra pointer in process() is for displaying the envelope in UI?

SimpleVerb doesn't seem to initialize correctly

I don't know so much about reverb algorithms, but I think there's a glitch in the initialization of this class. The comb1Length member variable (and the other combLengths) aren't initialized until setParameters is called. This would be fine, except the setParameters method checks if the input differs from the current fader values which actually are initialized in the constructor. Meaning, if someone called setParameters once with roomSizeIn=0.5 then the combLengths would continue to be uninitialized.

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.