Giter Site home page Giter Site logo

enzienaudio / hvcc Goto Github PK

View Code? Open in Web Editor NEW
360.0 34.0 52.0 2.44 MB

The heavy hvcc compiler for Pure Data patches.

License: GNU General Public License v3.0

Python 43.45% Makefile 0.85% C# 2.12% JavaScript 0.65% HTML 0.42% C 29.40% C++ 18.66% Objective-C 3.50% Max 0.90% Rich Text Format 0.04%
enzien enzienaudio pd puredata compiler python python27

hvcc's People

Contributors

diplojocus avatar mhroth 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  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

hvcc's Issues

How do [adc~] and [dac~] work in Unity?

Hello,

I was wondering if anyone knows how the default stereo channels of [adc~] and [dac~] in hvcc patches interact with Unity's audio engine.

If you're using the AudioLib plugin attached to a GameObject, is only the input into the left inlet of [dac~] taken and spatialized within the scene? Is the right inlet's input ignored?

And what about when using the AudioPlugin in Unity's Audio Mixer? Are both outlets of [adc~] and both inlets of [dac~] used?

-p path not working

When using other objects from heavylib , the command to specify the path doesn't work . I´ve tried all the combinations possible . If someone finds out how to do it would be great . For the moment it only works if locating all the abstractions in the same folder as the main.pd and the hvcc.py script

"Input message queue is full" Assertion failure in Unity

I'm having mixed results building my patch for Unity using the same .pd files that produced working .dll's on the enzienaudio.com website generator. On my end the python script seems to complete with no errors. I can take the resulting files and use the jdk to produce an Android AudioLib.so that builds and works correctly in Unity and built on my Android device.

I'm running into issue with the Win64 and iOS plugins though. Building the visual studio project completes with no errors, but in the Unity editor, I receive the following error when trying to run with the resulting AudioLib.dll:

`Microsoft Visual C++ Runtime Library
Assertion failed!
Program: ...layer.010.unity.win.x64\Hv AccoPlayer AudioLib.dll File: d: heavy builds \accordata \ unity\ sour... \ heavycontext.cpp Line: 133
Expression: false && -::sendMessageToReceiver - The input message queue is full and cannot accept more messages until they have been processed. Try increasing the inQueueKb size in the new with_options(l constructor.'

Since I had success with the Android build I also tried my luck with OSX, but when using the Xcode built bundle Unity crashes with a similar error:

Process: Accordata [12836]
Path: /Users/USER/Desktop/Accordata.app/Contents/MacOS/Accordata
Identifier: com.Company.ProductName
Version: 1.0 (0)
Code Type: X86-64 (Native)
Parent Process: ??? [1]
Responsible: Accordata [12836]
User ID: 524

Date/Time: 2018-09-06 23:40:35.891 -0700
OS Version: Mac OS X 10.13.6 (17G65)
Report Version: 12
Anonymous UUID: 5493484B-7E15-24B4-A0D2-220CD4E1DDC3

Time Awake Since Boot: 40000 seconds

System Integrity Protection: disabled

Crashed Thread: 0 Dispatch queue: com.apple.main-thread

Exception Type: EXC_CRASH (SIGABRT)
Exception Codes: 0x0000000000000000, 0x0000000000000000
Exception Note: EXC_CORPSE_NOTIFY

Application Specific Information:
Assertion failed: (false && "::sendMessageToReceiver - The input message queue is full and cannot accept more messages until they " "have been processed. Try increasing the inQueueKb size in the new_with_options() constructor."), function sendMessageToReceiver, file /Users/user912434/Downloads/AccoplayerV10_buildFiles/unity/source/heavy/HeavyContext.cpp, line 133.

I have tried with a less complex test patch, and there it was working correctly in Unity and built for both Android and Win64. It would suggest there is something wrong with my source patch, but the same patch worked correctly when it was built on enzienaudio.com.

My .pd source files are located here: https://github.com/moshang/Accordata/tree/master/Assets/Plugins/AccoPlayer_Source
The project on on Github runs correctly, by the way, since I'm still using the Win64 AudioLib.dll created on by your website. With those files I'm good to go on Android and Win64, but I'm stuck making updates to the PD project and I don't have a working OSX/iOS solution.

Fx unit crashes Wwise

I have a problem, where a flanger Fx from heavy lib is crashing Wwise every time I tried to use it. I have updated the Wwise SDK version to the latest one. One thing I noticed in the instructions for Windows build, that the code ends like this:
/t:Rebuild Hv_****_WwiseSourcePlugin.sln /m

When I first compiled this Fx patch, I got a Hv_flanger_WwiseFXPlugin.sln, so I just changed the WwiseSourcePlugin into WwiseFXPlugin and the build was successful. I can load the plugin into the fx rack in Wwise just fine, but when I press play and start to change values, it crashes Wwise.

range of noteout, ctlout, pgmout, touchout, bendout

In Pd, channel numbers are 1-16 for the first opened MIDI port, and then they keep going if you have more ports (e.g.: 17-32 is the second port).

This is what libpd does:

  • Channel numbers start at 0.
  • Channel numbers in libpd encode both Pd channels and ports in the following way: libpd_channel = pd_channel + 16 * pd_port. In particular, any nonnegative integer is a valid channel number as far as libpd is concerned.

It's convenient for me (and I think it may also make sense for others) to have heavy behave the same way.

(a separate issue should be granted for handling the range of [bendin]/[bendout], which is also peculiar in libpd)

Possible to use with externals?

So I have coded some PD externals of my own, and I was wondering if there is any way to compile them along with a patch with hvcc? I guess all (most?) of the standard PD objects must have been already implemented in heavy. Would it somehow be possible to expand heavy with your own custom externals before compiling your patch which uses those custom externals?

Any thoughts?

vcf~ requires perf information

When trying to use vcf~ get this error message

c:\Python27\python.exe C:\Users\x\Documents\Pd\hvcc\hvcc.py C:\Users\x\Documents\Pd\hvcc\main.pd -o C:/myTest2/ -n myOSC -g unity
__cos~f requires perf information.
__sqrt~f requires perf information.

**any hints apreciated , Will keep testing **

Building wwise plugin on mac - need xml and dll files

I'm trying to build a PD plugin for wwise using a mac. When I compile and try to build with xcode it spits out a .bundle file and a .dylib but no xml or dll (which is what I need to use the plugin in wwise authoring program). I can't build the VS version because visual studio for mac doesn't work with C++. How should i create the dll and xml?

Not outputting .dll files

Trying to generate a Wwise plugin and HVCC is only outputting the .xml file, but nothing else. I've tried simplifying the Pd patch just to test and it's still not working. Am I missing something stupid?

compiled using this line:
python hvcc.py ../pd/TEST.pd -o ../output/ -n TEST -g wwise

lv2 generator

It would be really nice to have a generator that outputs the basic lv2 structures so we can more easily go from a Pd design to a fully functioning lv2 plugin.

VST doc incorrect

The instructions say to download the VST3 Audio Plugins SDK from Steinberg, and some of the folder that is supposed to be copied over does not exist within the zip nor do any of the files exist individually anywhere:

/pluginterfaces
      /vst2.x
          aeffect.h
          aeffectx.h
          vstfxstore.h

Also the building instructions seems to have been copied over from the Unity instructions:

MacOS
An Xcode project exists in the unity/xcode directory and the plugin may be built manually. It can also be compiled directly from the commandline.

$ cd unity/xcode
$ xcodebuild -project heavy.xcodeproj -arch x86_64 -alltargets

The results are placed in unity/build/macos/x86_64/Release.

Linux

$ cd unity/linux
$ make -j

The results are placed in unity/build/linux/x86_64/release.

Windows
A Visual Studio 2015 project exists in the unity/vs2015 directory and the plugin may be built manually. It can also be compiled directly from the commandline.

$ cd unity/vs2015
$ "C:/Program Files (x86)/MSBuild/14.0/Bin/MSBuild.exe" /property:Configuration=Release /property:Platform=x64 /t:Rebuild heavy.sln /m

The results are placed in unity/build/win/x64/Release.

Plugins for x86 may also be built by specifying /property:Platform=x86.

Windows 7 x64 .dll compile issue

Currently trying to compile functioning .dll and .cs files for Unity 2018 (Windows 7 64-bit). Able to generate plugins, but running into issues when "_context" is called within Hv_heavy_AudioLib.cs (line 347) - audio engine unable to construct/receive sampleRate, poolKb, etc. Unity outputs "DllNotFoundException: Hv_heavy_AudioLib" error. Anyone able to get this to work on Windows 7 64bit?

Running the following for build:

  • pd vanilla 0.49.0
  • Python 2.7.14
  • Visual Studio 2015, Version 14.0, Update 3 (VCTarget path: v140)
  • MSBuild 14.0
  • npm (for windows-build-tools install)
  • Unity 2018.3.2f1 (64-bit)

Relatively new to programming, so please bear with me if terminology is inaccurate or important information is missing. Any thoughts/suggestions/directions would be much appreciated - thank you!

hvcc documentation

I'm looking through the documentation here on github and it seems some things from the old website's documentation are missing, eg. a list of the vanilla PD objects supported by hvcc. Additionally, there are some quirks of hvcc that were not documented on the old site that could be worth documenting (eg. the send/receive objects' right inlet doesn't work, graphical objects like the Toggle are converted into [float] upon compiling).

If I'm mistaken and that documentation is still around here or elsewhere, let me know! Or if there's interest compiling such a document, let's talk about how to go about doing so.

heap-allocated objects do not necessarily respect the prescribed alignment

The symptom was: getting SIGBUS occasionally when running specific patches on Bela. The immediate reason was that some NEON instructions were generated which assumed 128bit alignment, but at runtime the memory was not aligned.

Turns out the Heavy_{{name}} object created through

  HV_EXPORT HeavyContextInterface *hv_{{name}}_new(double sampleRate) {
    return new Heavy_{{name}}(sampleRate);
  }

  HV_EXPORT HeavyContextInterface *hv_{{name}}_new_with_options(double sampleRate,
      int poolKb, int inQueueKb, int outQueueKb) {
    return new Heavy_{{name}}(sampleRate, poolKb, inQueueKb, outQueueKb);
  }

was not necessarily aligned as prescribed by alignof(Heavy_{{name}}). I dug through this ancient discussion of gcc devs: https://gcc.gnu.org/bugzilla/show_bug.cgi?id=15795 . And the reason for that boils down to the C++ standard itself: the alignment of the pointer returned by operator new is undefined.

As such, the behaviour we observed is the expected behaviour, however this makes all C++ code using the default operator new for classes with intrinsics unusable on Linux, where the underlying call to malloc() returns values aligned to 8 bytes. On Mac (and I shall assume iOS), malloc() always returns a pointer aligned to 16 bytes, making this not an issue for these intrinsics.

My proposed fix, not relying on newer compiler flags such as -faligned-new=16, is to provide an override for operator new for the class, which ensures that the alignment is the same as prescribed by alignof().

This is the same underlying cause for BelaPlatform/Bela#265, and is further discussed here

Run on Android?

Is it possible to develop a game in Unity to run on Android with this project?

how to -p Search Paths

Hello. I don't fully understand how to add -p into the command line. In my patch, I have an [hv.reverb]. My command line looks like this:
python hvcc.py C:\Users\Reeson\Desktop\pd_learn\For_Unreal\drone_main.pd -n drone -g wwise -p "[C:\Users\Reeson\AppData\Roaming\Pd\heavylib_master/]"

With this command line, it doesn't want to compile, it says Don't know how to parse object "hv.reverb"

Alternative to [fexpr~]

Hello. I'm learning PD and doing Andy Farnell's patches from his book. I want to use some of the patches in the game. I'm stuck on compiling this patch that has [fexpr~] object in it. Is there an alternative? I saw that Heavylib has this [hv.epx] object, but I'm guessing it's not the same.

Get the unity source But Unity fails with NullException on Play

DllNotFoundException: Hv_mySynth2_AudioLib

Hv_mySynth2_Context..ctor (Double sampleRate, Int32 poolKb, Int32 inQueueKb, Int32 outQueueKb) (at Assets/unity/unity/source/unity/Hv_mySynth2_AudioLib.cs:323)
Hv_mySynth2_AudioLib.Awake () (at Assets/unity/unity/source/unity/Hv_mySynth2_AudioLib.cs:203)

compiled using this line :

c:\Python27\python.exe hvcc.py main.pd -n mySynth2 -g unity

and importing the unity source files inside the file inspector.

At run keeps giving - did not found exception , and if activated on the inspector :

NullReferenceException: Object reference not set to an instance of an object
Hv_mySynth2_AudioLib.Update () (at Assets/unity/unity/source/unity/Hv_mySynth2_AudioLib.cs:213)

PD/hvcc Discord?

The "Issues" section of a GitHub isn't really the place for free discussion of PD/hvcc. As there still seem to be a few of us active hvcc users, it'd be nice to have a Discord or something (There used to be a Slack that the devs were on, but everyone stopped using it when they stopped developing hvcc).

There are at least two possibilities: 1) Make a new Discord. 2) Join another Discord as a subchannel. I've been recently active in TheAudioProgrammer's Discord (He does a JUCE tutorial series on YouTube) and I could ask him if we could make a subchannel for PD/hvcc there.

Let me know which of these appeals to you more or if you have another idea.

Compiling .so for Android

Thanks a lot for making hvcc available, it's brilliant!

For those trying to compile an android .so for Unity (see line 172 onwards here), I ran into difficulties with the android.mk file.
I thought it was a problem with the paths in the .mk but it's actually a simple matter with the instructions in the help. Don't cd into unity/Android, cd into the jni instead, e.g. cd unity/android/jni

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.