New Firmware for NS1 Nanosynth

Home Forums Products NS1nanosynth New Firmware for NS1 Nanosynth

This topic contains 33 replies, has 8 voices, and was last updated by  Niklas 1 month ago.

Viewing 15 posts - 1 through 15 (of 34 total)
  • Author
    Posts
  • #1395

    liamfpower
    Participant

    Hi from Australia,
    I recently received my Nanosynth and have been loving hacking away at it, implementing a hardware glide etc, and connecting it to all of my DIY modules.
    I have written some new code for it, which expands on the base code found on the Soundmachines GitHub,
    here is a link to the file on Google Drive, as I can’t seem to work out how to add it to GitHub.

    https://drive.google.com/file/d/0B8-6EeQxPfYdUjhmU3pHWVdyLTg/view?usp=sharing

    Here are the features I implemented.
    Different Waveshapes for the Mozzi Oscillator:
    Connect one of the PushButtons to Pin 2 of the Arduino on the NanoSynth
    Press to Cycle through Waves

    Waves available are:
    1. Sine
    2. Triangle
    3. Saw
    4. Square
    5. Triangle Distorted
    6. Triangle Valve Overdrive

    I also added Midi Clock Sync over USB.
    To use this, attach C1 or C2 to Analog in 5 on the Arduino.
    The Clock Signal is available at pin 13, and you can see the LED light up in time with the Music.

    Please let me know if you have any problems with the code, syntax is not my strong point so if someone wants to clean it up go ahead.

    I tried but failed to add external LFO modulation of the mozzi Oscillator frequency, anyone have any Ideas?

    Thanks
    Liam

    #1396

    liamfpower
    Participant

    Also I am working on converting over the open source code from the ARDCore system to work with the Nanosynth,
    here is the repo
    https://github.com/darwingrosse/ArdCore-Code

    if we could get some of these converted to the nanosynth, that would unlock a whole lot of CV processing capabilities!!

    #1493

    jonncgiles
    Participant

    Liam

    Forgive my ignorance of C++ and coding in general. I am a beginner at arduino coding, relying on my poor memory for C syntax and google, but I can’t seem to get your firmware code you linked to above to compile. I am assuming that I am using the wrong versions of the IDE, libraries, or just not including the proper libraries. any help would be really appreciated. and if you can’t that’s ok too. this might not be the right place for me to post this.

    errors posted below. thanks in advance! jg

    In file included from /Users/jgiles/Downloads/NANOSYNTH_MULTIPLE_WAVES_BUTTON/NANOSYNTH_MULTIPLE_WAVES_BUTTON.ino:16:0:
    /Users/jgiles/Documents/Arduino/libraries/Mozzi/EventDelay.h: In constructor ‘EventDelay::EventDelay(unsigned int)’:
    /Users/jgiles/Documents/Arduino/libraries/Mozzi/EventDelay.h:29:86: error: ‘AUDIO_RATE’ was not declared in this scope
    EventDelay(unsigned int delay_milliseconds = 0): AUDIO_TICKS_PER_MILLISECOND((float)AUDIO_RATE/1000.0f)
    ^
    /Users/jgiles/Documents/Arduino/libraries/Mozzi/EventDelay.h: In member function ‘void EventDelay::start()’:
    /Users/jgiles/Documents/Arduino/libraries/Mozzi/EventDelay.h:53:23: error: ‘audioTicks’ was not declared in this scope
    deadline=audioTicks()+ticks;
    ^
    /Users/jgiles/Documents/Arduino/libraries/Mozzi/EventDelay.h: In member function ‘bool EventDelay::ready()’:
    /Users/jgiles/Documents/Arduino/libraries/Mozzi/EventDelay.h:75:21: error: ‘audioTicks’ was not declared in this scope
    return(audioTicks()>=deadline); // 1us
    ^
    In file included from /Users/jgiles/Downloads/NANOSYNTH_MULTIPLE_WAVES_BUTTON/NANOSYNTH_MULTIPLE_WAVES_BUTTON.ino:21:0:
    /Users/jgiles/Documents/Arduino/libraries/Mozzi/Metronome.h: In member function ‘void Metronome::start()’:
    /Users/jgiles/Documents/Arduino/libraries/Mozzi/Metronome.h:42:23: error: ‘audioTicks’ was not declared in this scope
    deadline=audioTicks()+ticks;
    ^
    /Users/jgiles/Documents/Arduino/libraries/Mozzi/Metronome.h: In member function ‘bool Metronome::ready()’:
    /Users/jgiles/Documents/Arduino/libraries/Mozzi/Metronome.h:77:34: error: ‘audioTicks’ was not declared in this scope
    unsigned long now = audioTicks();
    ^

    #1494

    liamfpower
    Participant

    Hi Jonn,
    Don’t worry, my coding is as sloppy as it gets! Looks to me like you dont have the Mozzi library installed? Or maybe incorrectly installed? Just a guess. From memory I was using the newest Mozzi livrary. Try downloading the newest library, deleting the one you have in “libraries” and installing the new library instead. Let me know how this goes for you.
    Cheers
    Liam

    #1495

    jonncgiles
    Participant

    Liam

    Started fresh with all new downloads etc. but still having the same error but worse. What version of IDE are you running? Thanks so much for the help! jg

    #1496

    jonncgiles
    Participant

    Hey there!
    Figured out that I was missing an include. Sorry about that.

    Next error is
    “error MIDIUSB can only be used with an USB MCU.”

    Since I have the Arduino Leonardo (MIDI) selected for the board I would think that it would have an USB MCU, so I have to imagine it is some other missing include/library. Any ideas would be rally appreciated!

    jg

    #1499

    Davide Mancini
    Keymaster

    Hi there!
    You need to include the ‘arcore’ USB libraries.
    Keep in mind that those are not standard libs BUT they need to be installed into your folders.
    Please have a look at the soundmachines’s github, this process is defined there.
    Let me know!!!!!!!!

    #1500

    jonncgiles
    Participant

    Davide

    I think I see my issue, and it’s mostly due to my ignorance.

    I generally include all the Mozzi includes that get added when you add the library with the drop down menu. I see now that there are already includes for mozzi in the sketch, and adding all of them causes the issues above. If I add the arcore board definition, select it as the current board for compilation, add the DAC library, don’t add includes and leave the includes already there, the sketch compiles. I haven’t tried uploading and testing yet, I bet it will work. If it doesn’t I will let you know.

    Thanks to Liam for the support, and of course you too, Davide.

    jg

    #1512

    rssutcliffe
    Participant

    Hi guys,

    Liam, thanks for the new firmware, like the midi clock a lot! I’ve compiled the sketch with some help from Davide (thanks Davide!) installed the arcore USBMIDI and the DAC also. On compiling I get zero errors, which is nice! Some warnings though. I’m not sure if this will affect the operation, I don’t think so, but just to check. The bootloader is also missing. Is this ok to upload to the NS1? Thanks again, appreciated!

    WARNING: Category ” in library EEPROM is not valid. Setting to ‘Uncategorized’
    WARNING: Category ” in library SPI is not valid. Setting to ‘Uncategorized’
    WARNING: Category ” in library SoftwareSerial is not valid. Setting to ‘Uncategorized’
    WARNING: Category ” in library Wire is not valid. Setting to ‘Uncategorized’
    Warning: platform.txt from core ‘Leonardo & Micro MIDI-USB (arcore)’ contains deprecated recipe.ar.pattern=”{compiler.path}{compiler.ar.cmd}” {compiler.ar.flags} {compiler.ar.extra_flags} “{build.path}/{archive_file}” “{object_file}”, automatically converted to recipe.ar.pattern=”{compiler.path}{compiler.ar.cmd}” {compiler.ar.flags} {compiler.ar.extra_flags} “{archive_file_path}” “{object_file}”. Consider upgrading this core.
    Bootloader file specified but missing: /Users/Goosehoof/Library/Arduino15/packages/arcore/hardware/avr/1.0.0/bootloaders/caterina/Caterina-Leonardo.hex

    Sketch uses 26,520 bytes (92%) of program storage space. Maximum is 28,672 bytes.
    Global variables use 1,353 bytes (52%) of dynamic memory, leaving 1,207 bytes for local variables. Maximum is 2,560 bytes.

    #1513

    liamfpower
    Participant

    Hi rssutcliffe,
    If the sketch compiles, then it should work fine. I can’t speak for your particular setup, other than to maybe go the arcore github and upload the Midi Echo tests
    found here and see whether the messages sent to your Arduino are echoed back to the PC. This will make sure that MIDI USB is working for you. Also test the basic Mozzi Examples and make sure they work in isolation. I don’t think its possible for you to damage your Arduino by uploading firmware to it in most cases, so just give it a go! Let me know how it turns out for you. You will know the firware is working correctly if you send a midi clock signal to the nanosynth and the led on D13 starts flashing in time with the clock signal.
    Thanks
    Liam

    #1516

    rssutcliffe
    Participant

    Hi Liam,

    Yes, it worked out fine. I don’t hear a difference between 5 and 6 Mozzi waveform though, although the others sound good.
    Thanks for your reply. I recall reading how to switch between the midi clock division but now can’t seem to find that again! I can control it with C1 to A5. Please can you remind me which Arduino input to change division? Thanks!

    Just one more question, is the arcore usb library only for use with the Leonardo boards? I’ve another midi project which would be way better without having to use a dedicated midi port. It’s using a sparkfun board. I’ll give it a go anyway, still at a beginners level with this!

    Cheers and happy Easter!

    #1517

    jonncgiles
    Participant

    Hi Liam and fellow sound people:

    I was wondering if there is a pin assignment map for this patch. I’ve gone over the code a few times, but since C++ coding isn’t my strength, I am struggling to use the patch. Any help would be greatly appreciated and thanks again for all the help.

    jg

    • This reply was modified 1 year, 1 month ago by  jonncgiles.
    #1519

    rssutcliffe
    Participant

    Although there is no map that I’m aware of, the pins are as described in the top of the .ino sketch file, and on the original post above.

    Mozzi osc output is on Pin 9 of the arduino.

    What are you struggling with? Does it trigger with midi? Do you see pin 13 LED blink in time with Midi clock? You may have to enable midi clock output in your sequencer/daw on the Leonardo port. Did you try to patch the mozzi output into the vca input to check the waveforms?

    Regards,

    #1520

    liamfpower
    Participant

    Hi guys, yeah, take a look at the top of the .ino I have tried to make it pretty clear?
    As far as bits of the code are concerned, the digital input on pin D2 increments a “waveNumber” which cycles through available waveforms which come out of mozzi pin 9, not much difference between the two triangle waveforms but bleh, look slightly different through scope.

    And a changing voltage on A5 (C1-2, and LFO) varies the clock division for midi clock input. This then comes out of D13, if you are sending midi clock to the nano synth you should see D13 blink in time with the incoming clock signal. That’s pretty much it except for the regular gate on pin 5 and the DAC functions which I can’t take credit for.
    This is unofficial, third party firmware and should be considered to be perpetually in beta. I am a pretty novice coder and it probably isn’t the most elegant code so sorry if you’ve had a hard time navigating it.
    Cheers
    Liam

    #1521

    rssutcliffe
    Participant

    Hi Liam, yes it’s working well for me; thanks very much indeed! Be interested to hear of any other hacks you might come up with.

Viewing 15 posts - 1 through 15 (of 34 total)

You must be logged in to reply to this topic.