AO Dual Quantizer

You appear to be missing jumpers on the 3-pin headers near the CV outputs. They should be on the pairs of pins closer to the top in your photo.

2 Likes

Of course I don’t get that error. I’m guessing the compiler version you are using is more strict than mine. It’d help if the error message weren’t cut off on the right; is it “initialization of non-const static member”?

The lines just before the error are:

private:
  static constexpr unsigned k_numCVOutputs = 2;

  static constexpr unsigned k_pinChipSelectDAC = 10;

  static constexpr uint8_t  k_pinGateInA = 2;
  static constexpr uint8_t  k_pinGateInB = 3;
  static constexpr uint8_t  k_pinGateInC = 4;
  static constexpr uint8_t  k_pinGateInD = 5;
  static constexpr uint8_t  k_pinGateInE = 8;
  static constexpr uint8_t  k_pinGateInF = 9;
  static constexpr uint8_t  k_pinGateOutA = 6;
  static constexpr uint8_t  k_pinGateOutB = 7;
  static constexpr uint8_t  k_pinGateOutC = 8;
  static constexpr uint8_t  k_pinGateOutD = 9;

  static bool m_gateInEEnabled = false;
  static bool m_gateInFEnabled = false;
  static bool m_gateOutCEnabled = false;
  static bool m_gateOutDEnabled = false;
    

So it’s not complaining about the similar declarations with initialization above them. Presumably the key difference is they are constexprs. But m_gateInEEnabled and so forth should not be const. Anyway, they are set in dac_ino::begin so presumably it’s safe to remove the initializers here,

static bool m_gateInEEnabled;

and so on. Let me know if that fixes it.

2 Likes

According to cppreference.com (https://en.cppreference.com/w/cpp/language/static), your code isn’t legal… I think :slight_smile:
You either have to declare non-const statics as inline, or initialize them out-of-class.
i.e. either one of :
inline static bool m_gateInEEnabled = false; //warning, only since C++17, I don’t know which version of the Arduino IDE you’ll need, or if even there is one yet supporting C++17
or
static bool m_gateOutCEnabled; // in the class declaration
bool <theclassname>::m_gateOutCEnabled = false; // no ‘static’ keyword, outside of the class declaration, usually in the .cpp file to avoid multiple definitions, but the arduino IDE does some “magic” here…

Edit: fixed < theclassname>

1 Like

I’m not having much success so I’m going to go set up a linux box really quick. :slight_smile:

1 Like

I’m wondering whether you have to add the bool keyword outside of the class. The type of the variable is already known I would think and would this not introduce another variable with the same name?

1 Like

Yep, as long as dac_in::begin is called, sets them and they are not used beforehand they are redundant.

1 Like

I tried on both Linux and Mac using the latest Arduino IDE (1.8.5 and 1.8.13 respectively). Both output identical errors.

QuantSketch:22:18: error: 'di' is not a namespace-name
  using namespace di;
                  ^~
QuantSketch:22:20: error: expected namespace-name before ';' token
  using namespace di;
                    ^
QuantSketch:26:1: error: 'dac_ino' does not name a type
 dac_ino::CVInChannel   cv1InChan[2] = {dac_ino::CVInChannel::A, dac_ino::CVInChannel::C};
 ^~~~~~~
QuantSketch:27:1: error: 'dac_ino' does not name a type
 dac_ino::CVInChannel   cv2InChan[2] = {dac_ino::CVInChannel::B, dac_ino::CVInChannel::D};
 ^~~~~~~
QuantSketch:28:1: error: 'dac_ino' does not name a type
 dac_ino::CVInChannel   scaleChan[2] = {dac_ino::CVInChannel::H, dac_ino::CVInChannel::F};
 ^~~~~~~
QuantSketch:29:1: error: 'dac_ino' does not name a type
 dac_ino::CVInChannel   bankChan[2] = {dac_ino::CVInChannel::G, dac_ino::CVInChannel::E};
 ^~~~~~~
QuantSketch:30:1: error: 'dac_ino' does not name a type
 dac_ino::CVOutChannel  cvOutChan[2] = {dac_ino::CVOutChannel::A, dac_ino::CVOutChannel::B};
 ^~~~~~~
QuantSketch:32:1: error: 'dac_ino' does not name a type
 dac_ino::GateInChannel quantInChan[2] = {dac_ino::GateInChannel::C, dac_ino::GateInChannel::D};
 ^~~~~~~
QuantSketch:33:1: error: 'dac_ino' does not name a type
 dac_ino::GateInChannel trigChan[2] = {dac_ino::GateInChannel::A, dac_ino::GateInChannel::B};
 ^~~~~~~
/Users/heck/Downloads/QuantizerModule-master/software/QuantSketch/QuantSketch.ino: In function 'void setup()':
QuantSketch:76:3: error: 'dac_inoBoard' was not declared in this scope
   dac_inoBoard.begin();
   ^~~~~~~~~~~~
/Users/heck/Downloads/QuantizerModule-master/software/QuantSketch/QuantSketch.ino:76:3: note: suggested alternative:
In file included from /Users/heck/Downloads/QuantizerModule-master/software/QuantSketch/QuantSketch.ino:11:0:
/Users/heck/Documents/Arduino/libraries/dac_ino/dac_ino.h:212:16: note:   'dcrd::dac_inoBoard'
 extern dac_ino dac_inoBoard;
                ^~~~~~~~~~~~
QuantSketch:83:6: error: 'trigChan' was not declared in this scope
      trigChan[0],
      ^~~~~~~~
QuantSketch:85:6: error: 'dac_ino' has not been declared
      dac_ino::GateInterrupt::RisingEdge
      ^~~~~~~
QuantSketch:91:6: error: 'dac_ino' has not been declared
      dac_ino::GateInterrupt::RisingEdge
      ^~~~~~~
/Users/heck/Downloads/QuantizerModule-master/software/QuantSketch/QuantSketch.ino: In function 'void loop()':
QuantSketch:114:28: error: 'dac_inoBoard' was not declared in this scope
       if (triggered[iq] || dac_inoBoard.readGate(trigChan[iq]))
                            ^~~~~~~~~~~~
/Users/heck/Downloads/QuantizerModule-master/software/QuantSketch/QuantSketch.ino:114:28: note: suggested alternative:
In file included from /Users/heck/Downloads/QuantizerModule-master/software/QuantSketch/QuantSketch.ino:11:0:
/Users/heck/Documents/Arduino/libraries/dac_ino/dac_ino.h:212:16: note:   'dcrd::dac_inoBoard'
 extern dac_ino dac_inoBoard;
                ^~~~~~~~~~~~
QuantSketch:114:50: error: 'trigChan' was not declared in this scope
       if (triggered[iq] || dac_inoBoard.readGate(trigChan[iq]))
                                                  ^~~~~~~~
QuantSketch:117:37: error: 'bankChan' was not declared in this scope
    rsbank[iq] = dac_inoBoard.readCV(bankChan[iq]);
                                     ^~~~~~~~
/Users/heck/Downloads/QuantizerModule-master/software/QuantSketch/QuantSketch.ino:117:37: note: suggested alternative: 'bankBins'
    rsbank[iq] = dac_inoBoard.readCV(bankChan[iq]);
                                     ^~~~~~~~
                                     bankBins
QuantSketch:118:38: error: 'scaleChan' was not declared in this scope
    rsscale[iq] = dac_inoBoard.readCV(scaleChan[iq]);
                                      ^~~~~~~~~
/Users/heck/Downloads/QuantizerModule-master/software/QuantSketch/QuantSketch.ino:118:38: note: suggested alternative: 'scaleBins'
    rsscale[iq] = dac_inoBoard.readCV(scaleChan[iq]);
                                      ^~~~~~~~~
                                      scaleBins
QuantSketch:120:39: error: 'cv1InChan' was not declared in this scope
    cv[iq] = 2.0 * dac_inoBoard.readCV(cv1InChan[iq]);
                                       ^~~~~~~~~
QuantSketch:121:40: error: 'cv2InChan' was not declared in this scope
    cv2[iq] = 2.0 * dac_inoBoard.readCV(cv2InChan[iq]);
                                        ^~~~~~~~~
QuantSketch:123:38: error: 'quantInChan' was not declared in this scope
    qgate[iq] = dac_inoBoard.readGate(quantInChan[iq]);
                                      ^~~~~~~~~~~
QuantSketch:162:27: error: 'cvOutChan' was not declared in this scope
      dac_inoBoard.writeCV(cvOutChan[iq], cvq);
                           ^~~~~~~~~
exit status 1
'di' is not a namespace-name

I commented out the initializations as suggested. I tried fixing the namespace error on line 22. I see no difference in the output with it commented or uncommented. I suspect it might part of further errors, but I know very little about C++.

I could try downgrading my Arduino install if you provide a version number that works.

In stead of switching OS which often leads to getting away from the problem at hand and introducing other complications, I’d suggest to stick to the original OS and check the compiler version you are running. When you compile anything in the arduino IDE (for the platform of choice), have a look at the status screen showing the compilation process. There may be a whole lot of commands passing in the screen but if you scroll back, what you could do is find the compile command and copy that to a terminal window. In that terminal run the command without all the parameters but instead type --version or -version. The command will then show its version number. Next compare that to the one @analogoutput uses. Using the same compiler is probably the best solution to the problem.

On my linux machine I see:

/home/jos/.arduino15/packages/STM32/tools/xpack-arm-none-eabi-gcc/9.2.1-1.1/bin/arm-none-eabi-g++ [ followed by a whole lot of stuff ]

running the command:

/home/jos/.arduino15/packages/STM32/tools/xpack-arm-none-eabi-gcc/9.2.1-1.1/bin/arm-none-eabi-g++ --version

This gives:

arm-none-eabi-g++ (xPack GNU Arm Embedded GCC, 64-bit) 9.2.1 20191025 (release) [ARM/arm-9-branch revision 277599]
Copyright (C) 2019 Free Software Foundation, Inc.
This is free software; see the source for copying conditions. There is NO
warranty; not even for MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.

You should be able to do this on your windows machine.

Obviously in this case in the path to the g++ command the version number 9.2.1-1.1 is already listed, but that need not be the case on your machine.

Next choose the same IDE version as @analogoutput (check that it uses the intended compiler) and compile.

2 Likes

The fact that you are missing the namespace di that is mentioned in the code, shows that you have not installed or copied all necessary code files and or library which defines what di is.

2 Likes

Or that there’s a compilation error in the library, which is where this started out.

I’m trying to follow all this… Have you in fact tried changing nothing other than changing

static bool m_gateInEEnabled = false;
static bool m_gateInFEnabled = false;
static bool m_gateOutCEnabled = false;
static bool m_gateOutDEnabled = false;

to

static bool m_gateInEEnabled;
static bool m_gateInFEnabled;
static bool m_gateOutCEnabled;
static bool m_gateOutDEnabled;

? What happens if you do that? If there are error messages, what are they?

1 Like

Here is the result of that change (and only that change) with verbose output during compilation:

Arduino: 1.8.13 (Mac OS X), Board: "Arduino Nano, ATmega328P"

/Applications/Arduino.app/Contents/Java/arduino-builder -dump-prefs -logger=machine -hardware /Applications/Arduino.app/Contents/Java/hardware -tools /Applications/Arduino.app/Contents/Java/tools-builder -tools /Applications/Arduino.app/Contents/Java/hardware/tools/avr -built-in-libraries /Applications/Arduino.app/Contents/Java/libraries -libraries /Users/heck/Documents/Arduino/libraries -fqbn=arduino:avr:nano:cpu=atmega328 -ide-version=10813 -build-path /var/folders/lg/8gvdwd0j2d76lmn371dll8vw0000gn/T/arduino_build_282920 -warnings=none -build-cache /var/folders/lg/8gvdwd0j2d76lmn371dll8vw0000gn/T/arduino_cache_825842 -prefs=build.warn_data_percentage=75 -prefs=runtime.tools.arduinoOTA.path=/Applications/Arduino.app/Contents/Java/hardware/tools/avr -prefs=runtime.tools.arduinoOTA-1.3.0.path=/Applications/Arduino.app/Contents/Java/hardware/tools/avr -prefs=runtime.tools.avrdude.path=/Applications/Arduino.app/Contents/Java/hardware/tools/avr -prefs=runtime.tools.avrdude-6.3.0-arduino17.path=/Applications/Arduino.app/Contents/Java/hardware/tools/avr -prefs=runtime.tools.avr-gcc.path=/Applications/Arduino.app/Contents/Java/hardware/tools/avr -prefs=runtime.tools.avr-gcc-7.3.0-atmel3.6.1-arduino7.path=/Applications/Arduino.app/Contents/Java/hardware/tools/avr -verbose /Users/heck/Downloads/QuantizerModule-master/software/QuantSketch/QuantSketch.ino
/Applications/Arduino.app/Contents/Java/arduino-builder -compile -logger=machine -hardware /Applications/Arduino.app/Contents/Java/hardware -tools /Applications/Arduino.app/Contents/Java/tools-builder -tools /Applications/Arduino.app/Contents/Java/hardware/tools/avr -built-in-libraries /Applications/Arduino.app/Contents/Java/libraries -libraries /Users/heck/Documents/Arduino/libraries -fqbn=arduino:avr:nano:cpu=atmega328 -ide-version=10813 -build-path /var/folders/lg/8gvdwd0j2d76lmn371dll8vw0000gn/T/arduino_build_282920 -warnings=none -build-cache /var/folders/lg/8gvdwd0j2d76lmn371dll8vw0000gn/T/arduino_cache_825842 -prefs=build.warn_data_percentage=75 -prefs=runtime.tools.arduinoOTA.path=/Applications/Arduino.app/Contents/Java/hardware/tools/avr -prefs=runtime.tools.arduinoOTA-1.3.0.path=/Applications/Arduino.app/Contents/Java/hardware/tools/avr -prefs=runtime.tools.avrdude.path=/Applications/Arduino.app/Contents/Java/hardware/tools/avr -prefs=runtime.tools.avrdude-6.3.0-arduino17.path=/Applications/Arduino.app/Contents/Java/hardware/tools/avr -prefs=runtime.tools.avr-gcc.path=/Applications/Arduino.app/Contents/Java/hardware/tools/avr -prefs=runtime.tools.avr-gcc-7.3.0-atmel3.6.1-arduino7.path=/Applications/Arduino.app/Contents/Java/hardware/tools/avr -verbose /Users/heck/Downloads/QuantizerModule-master/software/QuantSketch/QuantSketch.ino
Using board 'nano' from platform in folder: /Applications/Arduino.app/Contents/Java/hardware/arduino/avr
Using core 'arduino' from platform in folder: /Applications/Arduino.app/Contents/Java/hardware/arduino/avr
Detecting libraries used...
/Applications/Arduino.app/Contents/Java/hardware/tools/avr/bin/avr-g++ -c -g -Os -w -std=gnu++11 -fpermissive -fno-exceptions -ffunction-sections -fdata-sections -fno-threadsafe-statics -Wno-error=narrowing -flto -w -x c++ -E -CC -mmcu=atmega328p -DF_CPU=16000000L -DARDUINO=10813 -DARDUINO_AVR_NANO -DARDUINO_ARCH_AVR -I/Applications/Arduino.app/Contents/Java/hardware/arduino/avr/cores/arduino -I/Applications/Arduino.app/Contents/Java/hardware/arduino/avr/variants/eightanaloginputs /var/folders/lg/8gvdwd0j2d76lmn371dll8vw0000gn/T/arduino_build_282920/sketch/QuantSketch.ino.cpp -o /dev/null -DARDUINO_LIB_DISCOVERY_PHASE
Alternatives for dac_ino.h: [dac_ino@0.1]
ResolveLibrary(dac_ino.h)
  -> candidates: [dac_ino@0.1]
/Applications/Arduino.app/Contents/Java/hardware/tools/avr/bin/avr-g++ -c -g -Os -w -std=gnu++11 -fpermissive -fno-exceptions -ffunction-sections -fdata-sections -fno-threadsafe-statics -Wno-error=narrowing -flto -w -x c++ -E -CC -mmcu=atmega328p -DF_CPU=16000000L -DARDUINO=10813 -DARDUINO_AVR_NANO -DARDUINO_ARCH_AVR -I/Applications/Arduino.app/Contents/Java/hardware/arduino/avr/cores/arduino -I/Applications/Arduino.app/Contents/Java/hardware/arduino/avr/variants/eightanaloginputs -I/Users/heck/Documents/Arduino/libraries/dac_ino /var/folders/lg/8gvdwd0j2d76lmn371dll8vw0000gn/T/arduino_build_282920/sketch/QuantSketch.ino.cpp -o /dev/null -DARDUINO_LIB_DISCOVERY_PHASE
Alternatives for SPI.h: [SPI@1.0]
ResolveLibrary(SPI.h)
  -> candidates: [SPI@1.0]
/Applications/Arduino.app/Contents/Java/hardware/tools/avr/bin/avr-g++ -c -g -Os -w -std=gnu++11 -fpermissive -fno-exceptions -ffunction-sections -fdata-sections -fno-threadsafe-statics -Wno-error=narrowing -flto -w -x c++ -E -CC -mmcu=atmega328p -DF_CPU=16000000L -DARDUINO=10813 -DARDUINO_AVR_NANO -DARDUINO_ARCH_AVR -I/Applications/Arduino.app/Contents/Java/hardware/arduino/avr/cores/arduino -I/Applications/Arduino.app/Contents/Java/hardware/arduino/avr/variants/eightanaloginputs -I/Users/heck/Documents/Arduino/libraries/dac_ino -I/Applications/Arduino.app/Contents/Java/hardware/arduino/avr/libraries/SPI/src /var/folders/lg/8gvdwd0j2d76lmn371dll8vw0000gn/T/arduino_build_282920/sketch/QuantSketch.ino.cpp -o /dev/null -DARDUINO_LIB_DISCOVERY_PHASE
Alternatives for DirectIO.h: [DirectIO@1.2.0]
ResolveLibrary(DirectIO.h)
  -> candidates: [DirectIO@1.2.0]
/Applications/Arduino.app/Contents/Java/hardware/tools/avr/bin/avr-g++ -c -g -Os -w -std=gnu++11 -fpermissive -fno-exceptions -ffunction-sections -fdata-sections -fno-threadsafe-statics -Wno-error=narrowing -flto -w -x c++ -E -CC -mmcu=atmega328p -DF_CPU=16000000L -DARDUINO=10813 -DARDUINO_AVR_NANO -DARDUINO_ARCH_AVR -I/Applications/Arduino.app/Contents/Java/hardware/arduino/avr/cores/arduino -I/Applications/Arduino.app/Contents/Java/hardware/arduino/avr/variants/eightanaloginputs -I/Users/heck/Documents/Arduino/libraries/dac_ino -I/Applications/Arduino.app/Contents/Java/hardware/arduino/avr/libraries/SPI/src -I/Users/heck/Documents/Arduino/libraries/DirectIO /var/folders/lg/8gvdwd0j2d76lmn371dll8vw0000gn/T/arduino_build_282920/sketch/QuantSketch.ino.cpp -o /dev/null -DARDUINO_LIB_DISCOVERY_PHASE
Alternatives for Quantizer.h: [Quantizer]
ResolveLibrary(Quantizer.h)
  -> candidates: [Quantizer]
/Applications/Arduino.app/Contents/Java/hardware/tools/avr/bin/avr-g++ -c -g -Os -w -std=gnu++11 -fpermissive -fno-exceptions -ffunction-sections -fdata-sections -fno-threadsafe-statics -Wno-error=narrowing -flto -w -x c++ -E -CC -mmcu=atmega328p -DF_CPU=16000000L -DARDUINO=10813 -DARDUINO_AVR_NANO -DARDUINO_ARCH_AVR -I/Applications/Arduino.app/Contents/Java/hardware/arduino/avr/cores/arduino -I/Applications/Arduino.app/Contents/Java/hardware/arduino/avr/variants/eightanaloginputs -I/Users/heck/Documents/Arduino/libraries/dac_ino -I/Applications/Arduino.app/Contents/Java/hardware/arduino/avr/libraries/SPI/src -I/Users/heck/Documents/Arduino/libraries/DirectIO -I/Users/heck/Documents/Arduino/libraries/Quantizer /var/folders/lg/8gvdwd0j2d76lmn371dll8vw0000gn/T/arduino_build_282920/sketch/QuantSketch.ino.cpp -o /dev/null -DARDUINO_LIB_DISCOVERY_PHASE
/Applications/Arduino.app/Contents/Java/hardware/tools/avr/bin/avr-g++ -c -g -Os -w -std=gnu++11 -fpermissive -fno-exceptions -ffunction-sections -fdata-sections -fno-threadsafe-statics -Wno-error=narrowing -flto -w -x c++ -E -CC -mmcu=atmega328p -DF_CPU=16000000L -DARDUINO=10813 -DARDUINO_AVR_NANO -DARDUINO_ARCH_AVR -I/Applications/Arduino.app/Contents/Java/hardware/arduino/avr/cores/arduino -I/Applications/Arduino.app/Contents/Java/hardware/arduino/avr/variants/eightanaloginputs -I/Users/heck/Documents/Arduino/libraries/dac_ino -I/Applications/Arduino.app/Contents/Java/hardware/arduino/avr/libraries/SPI/src -I/Users/heck/Documents/Arduino/libraries/DirectIO -I/Users/heck/Documents/Arduino/libraries/Quantizer /Users/heck/Documents/Arduino/libraries/dac_ino/dac_ino.cpp -o /dev/null -DARDUINO_LIB_DISCOVERY_PHASE
/Applications/Arduino.app/Contents/Java/hardware/tools/avr/bin/avr-g++ -c -g -Os -w -std=gnu++11 -fpermissive -fno-exceptions -ffunction-sections -fdata-sections -fno-threadsafe-statics -Wno-error=narrowing -flto -w -x c++ -E -CC -mmcu=atmega328p -DF_CPU=16000000L -DARDUINO=10813 -DARDUINO_AVR_NANO -DARDUINO_ARCH_AVR -I/Applications/Arduino.app/Contents/Java/hardware/arduino/avr/cores/arduino -I/Applications/Arduino.app/Contents/Java/hardware/arduino/avr/variants/eightanaloginputs -I/Users/heck/Documents/Arduino/libraries/dac_ino -I/Applications/Arduino.app/Contents/Java/hardware/arduino/avr/libraries/SPI/src -I/Users/heck/Documents/Arduino/libraries/DirectIO -I/Users/heck/Documents/Arduino/libraries/Quantizer /Applications/Arduino.app/Contents/Java/hardware/arduino/avr/libraries/SPI/src/SPI.cpp -o /dev/null -DARDUINO_LIB_DISCOVERY_PHASE
/Applications/Arduino.app/Contents/Java/hardware/tools/avr/bin/avr-g++ -c -g -Os -w -std=gnu++11 -fpermissive -fno-exceptions -ffunction-sections -fdata-sections -fno-threadsafe-statics -Wno-error=narrowing -flto -w -x c++ -E -CC -mmcu=atmega328p -DF_CPU=16000000L -DARDUINO=10813 -DARDUINO_AVR_NANO -DARDUINO_ARCH_AVR -I/Applications/Arduino.app/Contents/Java/hardware/arduino/avr/cores/arduino -I/Applications/Arduino.app/Contents/Java/hardware/arduino/avr/variants/eightanaloginputs -I/Users/heck/Documents/Arduino/libraries/dac_ino -I/Applications/Arduino.app/Contents/Java/hardware/arduino/avr/libraries/SPI/src -I/Users/heck/Documents/Arduino/libraries/DirectIO -I/Users/heck/Documents/Arduino/libraries/Quantizer /Users/heck/Documents/Arduino/libraries/Quantizer/Quantizer.cpp -o /dev/null -DARDUINO_LIB_DISCOVERY_PHASE
Generating function prototypes...
/Applications/Arduino.app/Contents/Java/hardware/tools/avr/bin/avr-g++ -c -g -Os -w -std=gnu++11 -fpermissive -fno-exceptions -ffunction-sections -fdata-sections -fno-threadsafe-statics -Wno-error=narrowing -flto -w -x c++ -E -CC -mmcu=atmega328p -DF_CPU=16000000L -DARDUINO=10813 -DARDUINO_AVR_NANO -DARDUINO_ARCH_AVR -I/Applications/Arduino.app/Contents/Java/hardware/arduino/avr/cores/arduino -I/Applications/Arduino.app/Contents/Java/hardware/arduino/avr/variants/eightanaloginputs -I/Users/heck/Documents/Arduino/libraries/dac_ino -I/Applications/Arduino.app/Contents/Java/hardware/arduino/avr/libraries/SPI/src -I/Users/heck/Documents/Arduino/libraries/DirectIO -I/Users/heck/Documents/Arduino/libraries/Quantizer /var/folders/lg/8gvdwd0j2d76lmn371dll8vw0000gn/T/arduino_build_282920/sketch/QuantSketch.ino.cpp -o /var/folders/lg/8gvdwd0j2d76lmn371dll8vw0000gn/T/arduino_build_282920/preproc/ctags_target_for_gcc_minus_e.cpp -DARDUINO_LIB_DISCOVERY_PHASE
/Applications/Arduino.app/Contents/Java/tools-builder/ctags/5.8-arduino11/ctags -u --language-force=c++ -f - --c++-kinds=svpf --fields=KSTtzns --line-directives /var/folders/lg/8gvdwd0j2d76lmn371dll8vw0000gn/T/arduino_build_282920/preproc/ctags_target_for_gcc_minus_e.cpp
Compiling sketch...
/Applications/Arduino.app/Contents/Java/hardware/tools/avr/bin/avr-g++ -c -g -Os -w -std=gnu++11 -fpermissive -fno-exceptions -ffunction-sections -fdata-sections -fno-threadsafe-statics -Wno-error=narrowing -MMD -flto -mmcu=atmega328p -DF_CPU=16000000L -DARDUINO=10813 -DARDUINO_AVR_NANO -DARDUINO_ARCH_AVR -I/Applications/Arduino.app/Contents/Java/hardware/arduino/avr/cores/arduino -I/Applications/Arduino.app/Contents/Java/hardware/arduino/avr/variants/eightanaloginputs -I/Users/heck/Documents/Arduino/libraries/dac_ino -I/Applications/Arduino.app/Contents/Java/hardware/arduino/avr/libraries/SPI/src -I/Users/heck/Documents/Arduino/libraries/DirectIO -I/Users/heck/Documents/Arduino/libraries/Quantizer /var/folders/lg/8gvdwd0j2d76lmn371dll8vw0000gn/T/arduino_build_282920/sketch/QuantSketch.ino.cpp -o /var/folders/lg/8gvdwd0j2d76lmn371dll8vw0000gn/T/arduino_build_282920/sketch/QuantSketch.ino.cpp.o
QuantSketch:22:17: error: 'di' is not a namespace-name
 using namespace di;
                 ^~
QuantSketch:22:19: error: expected namespace-name before ';' token
 using namespace di;
                   ^
QuantSketch:26:1: error: 'dac_ino' does not name a type
 dac_ino::CVInChannel   cv1InChan[2] = {dac_ino::CVInChannel::A, dac_ino::CVInChannel::C};
 ^~~~~~~
QuantSketch:27:1: error: 'dac_ino' does not name a type
 dac_ino::CVInChannel   cv2InChan[2] = {dac_ino::CVInChannel::B, dac_ino::CVInChannel::D};
 ^~~~~~~
QuantSketch:28:1: error: 'dac_ino' does not name a type
 dac_ino::CVInChannel   scaleChan[2] = {dac_ino::CVInChannel::H, dac_ino::CVInChannel::F};
 ^~~~~~~
QuantSketch:29:1: error: 'dac_ino' does not name a type
 dac_ino::CVInChannel   bankChan[2] = {dac_ino::CVInChannel::G, dac_ino::CVInChannel::E};
 ^~~~~~~
QuantSketch:30:1: error: 'dac_ino' does not name a type
 dac_ino::CVOutChannel  cvOutChan[2] = {dac_ino::CVOutChannel::A, dac_ino::CVOutChannel::B};
 ^~~~~~~
QuantSketch:32:1: error: 'dac_ino' does not name a type
 dac_ino::GateInChannel quantInChan[2] = {dac_ino::GateInChannel::C, dac_ino::GateInChannel::D};
 ^~~~~~~
QuantSketch:33:1: error: 'dac_ino' does not name a type
 dac_ino::GateInChannel trigChan[2] = {dac_ino::GateInChannel::A, dac_ino::GateInChannel::B};
 ^~~~~~~
/Users/heck/Downloads/QuantizerModule-master/software/QuantSketch/QuantSketch.ino: In function 'void setup()':
QuantSketch:76:3: error: 'dac_inoBoard' was not declared in this scope
   dac_inoBoard.begin();
   ^~~~~~~~~~~~
/Users/heck/Downloads/QuantizerModule-master/software/QuantSketch/QuantSketch.ino:76:3: note: suggested alternative:
In file included from /Users/heck/Downloads/QuantizerModule-master/software/QuantSketch/QuantSketch.ino:11:0:
/Users/heck/Documents/Arduino/libraries/dac_ino/dac_ino.h:216:16: note:   'dcrd::dac_inoBoard'
 extern dac_ino dac_inoBoard;
                ^~~~~~~~~~~~
QuantSketch:83:6: error: 'trigChan' was not declared in this scope
      trigChan[0],
      ^~~~~~~~
QuantSketch:85:6: error: 'dac_ino' has not been declared
      dac_ino::GateInterrupt::RisingEdge
      ^~~~~~~
QuantSketch:91:6: error: 'dac_ino' has not been declared
      dac_ino::GateInterrupt::RisingEdge
      ^~~~~~~
/Users/heck/Downloads/QuantizerModule-master/software/QuantSketch/QuantSketch.ino: In function 'void loop()':
QuantSketch:114:28: error: 'dac_inoBoard' was not declared in this scope
       if (triggered[iq] || dac_inoBoard.readGate(trigChan[iq]))
                            ^~~~~~~~~~~~
/Users/heck/Downloads/QuantizerModule-master/software/QuantSketch/QuantSketch.ino:114:28: note: suggested alternative:
In file included from /Users/heck/Downloads/QuantizerModule-master/software/QuantSketch/QuantSketch.ino:11:0:
/Users/heck/Documents/Arduino/libraries/dac_ino/dac_ino.h:216:16: note:   'dcrd::dac_inoBoard'
 extern dac_ino dac_inoBoard;
                ^~~~~~~~~~~~
QuantSketch:114:50: error: 'trigChan' was not declared in this scope
       if (triggered[iq] || dac_inoBoard.readGate(trigChan[iq]))
                                                  ^~~~~~~~
QuantSketch:117:37: error: 'bankChan' was not declared in this scope
    rsbank[iq] = dac_inoBoard.readCV(bankChan[iq]);
                                     ^~~~~~~~
/Users/heck/Downloads/QuantizerModule-master/software/QuantSketch/QuantSketch.ino:117:37: note: suggested alternative: 'bankBins'
    rsbank[iq] = dac_inoBoard.readCV(bankChan[iq]);
                                     ^~~~~~~~
                                     bankBins
QuantSketch:118:38: error: 'scaleChan' was not declared in this scope
    rsscale[iq] = dac_inoBoard.readCV(scaleChan[iq]);
                                      ^~~~~~~~~
/Users/heck/Downloads/QuantizerModule-master/software/QuantSketch/QuantSketch.ino:118:38: note: suggested alternative: 'scaleBins'
    rsscale[iq] = dac_inoBoard.readCV(scaleChan[iq]);
                                      ^~~~~~~~~
                                      scaleBins
QuantSketch:120:39: error: 'cv1InChan' was not declared in this scope
    cv[iq] = 2.0 * dac_inoBoard.readCV(cv1InChan[iq]);
                                       ^~~~~~~~~
QuantSketch:121:40: error: 'cv2InChan' was not declared in this scope
    cv2[iq] = 2.0 * dac_inoBoard.readCV(cv2InChan[iq]);
                                        ^~~~~~~~~
QuantSketch:123:38: error: 'quantInChan' was not declared in this scope
    qgate[iq] = dac_inoBoard.readGate(quantInChan[iq]);
                                      ^~~~~~~~~~~
QuantSketch:162:27: error: 'cvOutChan' was not declared in this scope
      dac_inoBoard.writeCV(cvOutChan[iq], cvq);
                           ^~~~~~~~~
Using library dac_ino at version 0.1 in folder: /Users/heck/Documents/Arduino/libraries/dac_ino 
Using library SPI at version 1.0 in folder: /Applications/Arduino.app/Contents/Java/hardware/arduino/avr/libraries/SPI 
Using library DirectIO at version 1.2.0 in folder: /Users/heck/Documents/Arduino/libraries/DirectIO 
Using library Quantizer in folder: /Users/heck/Documents/Arduino/libraries/Quantizer (legacy)
exit status 1
'di' is not a namespace-name

Ohcrap. Looks like I changed di to dcrd in the version on GitHub but didn’t change it in my Arduino/library folder or in Quantsketch. Let me clean my slate, get everything consistent, and push an update.

3 Likes

For future reference, being human I have discovered that synchronization errors like this always creep in no matter what procedures and tools you set up. The only way to be sure is to create a clean workspace and test the entire build and test process from scratch using only the published source code. If possible, use a different computer than your development box.

4 Likes

Yeah, there’s the shoulds and there’s the woulds…

tldr; Updated versions of dac/ino library and QuantSketch are needed to get quantizer working!

I have found several issues with the code in the repositories (plural), which gave me the same errors you were seeing and that I hadn’t been because I’d been compiling a different version apparently, and have now pushed updates. Everything compiles, loads to the Arduino, and runs. I haven’t actually checked functionality on the quantizer module yet but debug prints from a bare Arduino look fine. Updated files are: dac_ino.h, dac_ino.cpp from the dac_ino repository, and QuantSketch.ino from the Quantizer repository.

Sorry about the avoidable problems! Let me know if this works for you.

7 Likes

Hey no worries. I’ll check it out tomorrow. I appreciate you taking the time to help and work out the issues.

5 Likes

The code compiled perfectly this morning after a pull from both repos. The module, on the other hand… I’ll need to take another look at the wiring this evening. Nothing blew up so that’s a small win. Will walk through the schematic closely and see what I did wrong.

5 Likes

I look on the components for DAC INO and i have a question about the REF02CP

i only find some “REF02CP +5V/+10V precision”, not only +5V precision.

is it normal cause we can use the same chip for the both , with a different circuit to have 5V or 10V out ?
or i don’t find the good one on internet and the REF02CP +5V precision only exist somewhere ?

thx

I don’t know why it’s described that way. See the datasheet:
https://www.mouser.com/datasheet/2/609/REF01_02_03-1504377.pdf

As shown there, REF01 is 2.5V, REF02 is 5V, and REF03 is 10V.

It’s available at Mouser:
https://www.mouser.com/ProductDetail/Analog-Devices/REF02CPZ?qs=WIvQP4zGanimGNU1Qc96kg%3D%3D

REF02AP is a better grade than REF02CPZ so can be used instead.

Octopart shows a number of other sources:
https://octopart.com/search?q=ref02

2 Likes