grame-cncm / faust

Functional programming language for signal processing and sound synthesis
http://faust.grame.fr
Other
2.59k stars 326 forks source link

daisy_midi class of daisy architecture is outdated #1084

Closed ghoppla closed 5 days ago

ghoppla commented 5 days ago

daisy_midi class of daisy architecture is outdated

When compiling code using faust2daisy class daisy_midi generates g++ compiler errors.

Steps Done

Versions Used:

Daisy Toolchain Setup on Linux:

  1. Create a folder, e.g.

    $ mkdir ~/daisy
  2. Get arm-none-eabi:

  3. Get libDaisy:

    $ git clone --recurse-submodules https://github.com/electro-smith/libDaisy
  4. Create environment.rc file with the following content:

    export LIBDAISY_DIR=~/daisy/libDaisy
    
    GCC_PATH=~/daisy/gcc-arm-none-eabi-10-2020-q4-major/bin
    export PATH=$GCC_PATH:$PATH
  5. Compile libDaisy:

    $ source environment.rc
    $ cd libDaisy
    $ make

Compilation:

  1. dsp file minimal_example.dsp
    
    import("stdfaust.lib");
    declare name "Daisy Seed Bug";
    declare options "[midi:on]";
    declare options "[nvoices:4]";

gate = button("gate"); vel = hslider("gain", 0, 0, 1, .01); freq = hslider("freq", 440, 0, 20000, 0.01);

process = os.triangle(freq) vel : _en.adsr(.1,.1,.7,.2, gate) <: ,;


2. Generated cpp code with:
```bash
$ faust2daisy -patchsm -midi -sr 48000 -bs 32 -uim -source minimal_example.dsp

when running make within the generated folder

$ cd minimal_example
$ make

. ... the following errors are thrown:

ex_faust.cpp:4117:9: error: invalid use of template-name 'daisy::MidiHandler' without an argument list
 4117 |         daisy::MidiHandler fMidi;
      |         ^~~~~
ex_faust.cpp:4117:9: note: class template argument deduction is only available with '-std=c++17' or '-std=gnu++17'
In file included from /home/georg/Programmierung/daisy/Projects/bug_minimal_example/libDaisy/src/daisy.h:23,
                 from /home/georg/Programmierung/daisy/Projects/bug_minimal_example/libDaisy/src/daisy_patch_sm.h:3,
                 from ex_faust.cpp:55:
/home/georg/Programmierung/daisy/Projects/bug_minimal_example/libDaisy/src/hid/midi.h:152:7: note: 'template<class Transport> class daisy::MidiHandler' declared here
  152 | class MidiHandler
      |       ^~~~~~~~~~~
ex_faust.cpp: In member function 'virtual bool daisy_midi::startMidi()':
ex_faust.cpp:4131:13: error: 'fMidi' was not declared in this scope
 4131 |             fMidi.Init(daisy::MidiHandler::INPUT_MODE_UART1, daisy::MidiHandler::OUTPUT_MODE_NONE);
      |             ^~~~~
ex_faust.cpp:4131:31: error: 'template<class Transport> class daisy::MidiHandler' used without template arguments
 4131 |             fMidi.Init(daisy::MidiHandler::INPUT_MODE_UART1, daisy::MidiHandler::OUTPUT_MODE_NONE);
      |                               ^~~~~~~~~~~
ex_faust.cpp:4131:69: error: 'template<class Transport> class daisy::MidiHandler' used without template arguments
 4131 |             fMidi.Init(daisy::MidiHandler::INPUT_MODE_UART1, daisy::MidiHandler::OUTPUT_MODE_NONE);
      |                                                                     ^~~~~~~~~~~
ex_faust.cpp: In member function 'void daisy_midi::processMidi()':
ex_faust.cpp:4140:13: error: 'fMidi' was not declared in this scope
 4140 |             fMidi.Listen();
      |             ^~~~~
sletz commented 5 days ago

Can you fix the code and prepare a PR ?

sletz commented 5 days ago

Fixed here: https://github.com/grame-cncm/faust/pull/1085