Forum Rule: Always post complete source code & details to reproduce any issue!
Results 1 to 4 of 4

Thread: Help with Heavy Compiler API

  1. #1
    Junior Member
    Join Date
    Mar 2016
    Posts
    16

    Help with Heavy Compiler API

    https://github.com/enzienaudio/hvcc

    I've had luck using this API within JUCE but I'm getting some errors when trying to use it to create new Teensy audio library objects.

    In JUCE I'm able to create a new context using

    HeavyContextInterface* context = hv_sine440_new(44100);

    Then I can use the processinline function. When doing this in Teensy I get undefined reference errors for hv_processInline and hv_sine440_new. I've included the main Heavy_sine440.h file in my .h file for the audio object.

    Does anyone have experience with hvcc or know what piece I may be missing in using this API on Teensy?

  2. #2
    Could you post the contents of Heavy_sine440.h? Their documentation doesn't have a full example with source (as far as I can see) to tell where stuff is located.

    Seems like a cool library though.

  3. #3
    Junior Member
    Join Date
    Mar 2016
    Posts
    16
    Code:
    /**
     * Copyright (c) 2019 Enzien Audio, Ltd.
     * 
     * Redistribution and use in source and binary forms, with or without modification,
     * are permitted provided that the following conditions are met:
     * 
     * 1. Redistributions of source code must retain the above copyright notice,
     *    this list of conditions, and the following disclaimer.
     * 
     * 2. Redistributions in binary form must reproduce the phrase "powered by heavy",
     *    the heavy logo, and a hyperlink to https://enzienaudio.com, all in a visible
     *    form.
     * 
     *   2.1 If the Application is distributed in a store system (for example,
     *       the Apple "App Store" or "Google Play"), the phrase "powered by heavy"
     *       shall be included in the app description or the copyright text as well as
     *       the in the app itself. The heavy logo will shall be visible in the app
     *       itself as well.
     * 
     * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
     * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO,
     * THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
     * ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE
     * FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
     * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR
     * SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER
     * CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY,
     * OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF
     * THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
     * 
     */
    
    #ifndef _HEAVY_SINE440_H_
    #define _HEAVY_SINE440_H_
    
    #include "HvHeavy.h"
    
    #ifdef __cplusplus
    extern "C" {
    #endif
    
    #if HV_APPLE
    #pragma mark - Heavy Context
    #endif
    
    
    
    /**
     * Creates a new patch instance.
     * Sample rate should be positive and in Hertz, e.g. 44100.0.
     */
    HeavyContextInterface *hv_sine440_new(double sampleRate);
    
    /**
     * Creates a new patch instance.
     * @param sampleRate  Sample rate should be positive (> 0) and in Hertz, e.g. 48000.0.
     * @param poolKb  Pool size is in kilobytes, and determines the maximum amount of memory
     *   allocated to messages at any time. By default this is 10 KB.
     * @param inQueueKb  The size of the input message queue in kilobytes. It determines the
     *   amount of memory dedicated to holding scheduled messages between calls to
     *   process(). Default is 2 KB.
     * @param outQueueKb  The size of the output message queue in kilobytes. It determines the
     *   amount of memory dedicated to holding scheduled messages to the default sendHook.
     *   See getNextSentMessage() for info on accessing these messages. Default is 0 KB.
     */
    HeavyContextInterface *hv_sine440_new_with_options(double sampleRate, int poolKb, int inQueueKb, int outQueueKb);
    
    #ifdef __cplusplus
    } // extern "C"
    #endif
    
    #endif // _HEAVY_SINE440_H_

  4. #4
    Junior Member
    Join Date
    Mar 2016
    Posts
    16
    Once I put all the files from the API in the sketch folder directly I got it to compile. Not a big deal, I guess compilation works differently for files in subfolders. I'll report back when I've tested some patches on my Teensy.

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •