Coder Social home page Coder Social logo

Comments (4)

Sammy1Am avatar Sammy1Am commented on August 20, 2024

Apologies for the new layout being a bit different-- there's a lot of compromise and I've tried to find a balance that works least-worst (and you said "a bit" confusing, I so haven't failed entirely πŸ˜‰).

We can definitely help you solve this; I don't have Moppy up in front of me now so I'm going from memory, but hopefully this will be enough to get you going (we'll start with just the Arduinos and get to the drums later):

  1. In MoppyConfig.h (for the Arduino Code) for your Leonardo, you'll leave DEVICE_ADDRESS as 0x01, and set MAX_SUB_ADDRESS to 6. This basically assigns that Arduino as "Device 1" and says it has 6 drives. In MoppyConfig.h for the Uno, you'll change DEVICE_ADDRESS to 0x02 and MAX_SUB_ADDRESS to 4.
  2. In the GUI, when you've connected your Arduinos and checked the appropriate COM boxes, you should see both Arduinos show up in the Network area on the top right of the window with the appropriate number of sub addresses
  3. You'll need two rows of Mapper in the mappers section at the bottom (click the "+" to add another row):
    • For the first row, your condition will be c<=6 (which will evaluate to true for MIDI channels 1-6). The device address for that row will be 1 (The Leonardo). The subaddress will be c (which means the MIDI channel number will map directly to subaddress number), and you can just choose "Straight Through" for the note.
    • The second row will have address c>=7 && c<=10*, device address 2 (The Uno), subaddress c-6 (MIDI channels 7-10 will map to subaddress 1-4), and once again "Straight Through" for the note

And then you're pretty much good to go for the notes. Channels 1-6 will route to the Leonardo, 7-10 to the Uno. The mappers are using Javascript, so you can do more complex mapping there if you need to.

* Channel 10 is MIDI's "traditional" drum channel. There's no reason in theory you can't put drums on any channel, but if for some reason you can't, you'll need to work around that channel for the Arduinos playing notes. So if you wanted 7-9 and 11, your condition would be (c>=7 && c<=9) || c==11 and your subaddress could be something like c==11?c-7:c-6.


And now the drums. Not sure what the speakers are connected to, but assuming it's either a software synth or a MIDI device, you'll need to enable the MIDI passthrough option in the synthesizer control on the top left, which will send all the MIDI notes being played to the MIDI OUT port of your choice (you can get a virtual MIDI cable if you're looking to route them back to the same PC with the Moppy Control software). VMPK is a simple synthesizer program you can use to output the sound, however I don't know for sure if it will allow you to select only the drum track.

If the drums are being synthesized by a third Arduino, you'll want to give it e.g. DEVICE_ADDRESS 0x03, and then route only the drums channel to that address.

Hopefully that gives you enough to go on. The Mappers are understandably slightly more daunting in their script-based-ness than the previous UI, but the flexibility they allow fix a lot of peoples' issues without having a whole bunch of separate mapping systems. Definitely let me know if you need more info though.

from moppy2.

 avatar commented on August 20, 2024

Hey no problem thanks for clearing that up. In the previous version it was basically channel x you can enable or turn off. and set either the port or the midi out just for those channels. that's basically what threw me off. Also as I already know from before the floppy drives can do C1 to B5 where as the nema 17's seem to be set to C1 to F#5 (F Sharp) on the L298n for the stepper motors.

from moppy2.

 avatar commented on August 20, 2024

Also here's a weird question. I have a spare 5th stepper motor and unused pins on the Leonardo that aren't in use. Can it handle both types or do they need to be seperate?

from moppy2.

Sammy1Am avatar Sammy1Am commented on August 20, 2024

Huh, well...

The short (easy) answer is: No, they need to be separate as each Arduino stack can only specify a single instrument type.

The long (difficult) answer is: There are no technical limitations that would prevent you from doing that. πŸ˜‰ Your two best approaches (that I can think of off hand) are:

  • Make your own custom instrument type that combines the code from FloppyDrives and L298N based on which subaddress is being called (maybe slightly easier, but definitely messier)
  • Make a new MultiInstrument instrument that forwards system and devices messages sent to it to multiple instrument instances (instantiate both FloppyDrives and L298N). There are a number of challenges here including the amount of memory available on the devices, and potential variable naming conflicts since this wasn't thought of at first; but the result would be more elegant, and reusable by any pair (or tuple!) of instruments.

Closing this issue since its original problem seems resolved, but feel free to reopen or open new ones if something else comes up.

from moppy2.

Related Issues (20)

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.