Offline
Sweden

This is my custom MIDI out version of the Arduinoboy.

https://github.com/ledfyr/ab-midiout-lite

Background:
I started out trying to slim down the original Arduinoboy code to the bare minimum needed to handle LSDJ MIDI out. The main motivation was to learn how the code worked and if possible solve an issue I'd had with notes dropping out.
I managed to solve the issue by removing a buffering/timeout handling of previously played notes. My solution keeps at most one previous note per channel instead of a list, and I got rid of the timeout handling. I never fully understood the intention of the original code in this area, but as far as I know my changes haven't broken anything. If anyone has ideas or knowledge about this, feel free to share.
Later I added some more functions, just because.

Functions:
- MIDI clock out (tap tempo control of BPM)
- Velocity
- Chords
- Channel switching (channels can be switched rapidly giving you access to 16 channels - though only 4 notes at a time)
- CC scaling 0-127 instead of 0-120

Gotcha #1: If you want to change between two different chords, you must kill the first note (chord) before changing and starting the next - otherwise notes from the first chord will be left hanging. So do it in this order: set chord, play note, kill note, set other chord, play note ... and so on.

Gotcha #2: All settings (channel switching etc) are lost when you power off the Arduinoboy. Keep a row in the top of your LSDJ songs with settings, play this row to "load" them before starting the song.

See readme in the link above for installation instructions and more info. This code should work with any Arduino based build following the original schematics by trash80.

Please let me know if anything is unclear and I'll try to help. Enjoy!

Offline

Curious to why you removed the LED flashing.

Offline
Sweden
DSC wrote:

Curious to why you removed the LED flashing.

No real reason apart from keeping it as simple and stripped down as possible. LED flashing can probably be added again without any impact on performance, but I personally like the concept that the Arduino does as little as possible besides handling the precious note sequencing.

Offline
NUMBSKULL

Kind of might make an "arduinoboy lite" hardware that targets only this build.

If I send you a teensyboy, will you get it working on it? I know many people really like this fork.

EDIT:
Actually, thinking about it here, I'm pretty sure this will work on the GBA MIDI board I'll be releasing very soon with very little modifications to your code...

Last edited by catskull (Dec 1, 2017 10:56 pm)

Offline
Sweden
catskull wrote:

Kind of might make an "arduinoboy lite" hardware that targets only this build.

If I send you a teensyboy, will you get it working on it? I know many people really like this fork.

EDIT:
Actually, thinking about it here, I'm pretty sure this will work on the GBA MIDI board I'll be releasing very soon with very little modifications to your code...

Hey, I saw your facebook posts about the GBA MIDI board. Looks way cool - I'll be sure to pick one up when they're ready. Using that board as an Arduinoboy for MIDI out would simply be awesome.

Thanks for the offer - I'll PM you!

Offline
Salt Lake City, UT

Ahh just found my issue... I think I was trying to use N00 instead K00 to end the notes using chords.
Do you think it would be possible for chords to kill with N00? I've been trying to use NOI as a external drum sequencer as well as retaining the original NOI sounds. Using N00 would enable the MIDI notes to be killed without cutting of a longer NOI sound.

Offline
Sweden
toasterpastries wrote:

Ahh just found my issue... I think I was trying to use N00 instead K00 to end the notes using chords.
Do you think it would be possible for chords to kill with N00? I've been trying to use NOI as a external drum sequencer as well as retaining the original NOI sounds. Using N00 would enable the MIDI notes to be killed without cutting of a longer NOI sound.

I tested this on my rig today, N00 actually does kill chords for me. I would guess the reason we get different results is this:
N00 generates a MIDI note ON with note value 0. Some synths/drum machines may recognize this as a note OFF, others may see this as the lowest possible note or filter it out as an invalid note.

If this is correct, I can change so that N00 generates a note OFF instead. Or does anyone use N00 to reach the lowest note? I wouldn't want to break things. If nobody seems to do that, I'll probably change this in the next few days.

Offline
Unsubscribe

n00 sends ALL NOTES off.  This is a good way to kill stuck notes, or kill droning notes at the end of a phrase, so I wouldnt mess with its function.

You should consider making special note functions work at the Fx end of the spectrum, since those are probably less used?

Last edited by herr_prof (Dec 2, 2017 4:51 pm)

Offline
Unsubscribe
Ledfyr wrote:
DSC wrote:

Curious to why you removed the LED flashing.

No real reason apart from keeping it as simple and stripped down as possible. LED flashing can probably be added again without any impact on performance, but I personally like the concept that the Arduino does as little as possible besides handling the precious note sequencing.

I find it useful as a midi command being sent from a lsdj channel status at least.

Oh I just got an idea, since there arent any aboy modes in your fork, maybe have the pushbutton do a midi panic?
https://coolsoft.altervista.org/en/forum/thread/293

Offline
Sweden
herr_prof wrote:

n00 sends ALL NOTES off.  This is a good way to kill stuck notes, or kill droning notes at the end of a phrase, so I wouldnt mess with its function.

You should consider making special note functions work at the Fx end of the spectrum, since those are probably less used?


herr_prof wrote:

I find it useful as a midi command being sent from a lsdj channel status at least.

Oh I just got an idea, since there arent any aboy modes in your fork, maybe have the pushbutton do a midi panic?


It does not look like N00 sends ALL NOTES OFF, and I also think I was wrong with my note ON idea. I checked the code and it looks like N00 just sends a regular note OFF of the previous played note, just like what happens with the K command (but K kills the sound in the GB channel too). If you check the code you see that the only way to send an ALL NOTES OFF is to stop the sequencer (this looks the same in my fork and the original code).
So sorry @toasterpastries, I have no good explanation why N00 doesn't work to kill notes/chords for you, it looks like it should work, and it works as expected for me.

Regarding using F (or any other existing command): the Fxx command (finetune) does not send any data from the Gameboy to the Arduinoboy, so a modified LSDJ rom would need to be used for this to work.
I want to keep my code compatible with the official LSDJ versions, and I don't know nearly enough about Gameboy development to attempt anything like that.
The signals sent from the Gameboy to the Arduionoboy are: start/stop seq, note on/off, CC and program changes.
My functions use 4 of the 7 available CC numbers (the X command), so there are still 3 CC numbers available to use normally. Sacrificing a few CCs felt better for me than sacrificing e.g. notes or program changes (though maybe I could live without program changes).
Though it would be cool with dedicated commands instead of using up some CC numbers, however much more work is needed for this to happen (it affects both LSDJ and Arduinoboy code).

I agree that the LED blinking is nice for status and just to see that it's working, but for me the "simplicity factor" is more important.

MIDI panic via the pushbutton is a good idea, I can see how this would be a useful function. Personally I use a panic button on my synth when needed, which is very rarely. I'll keep this in mind.

Offline
Salt Lake City, UT
Ledfyr wrote:

So sorry @toasterpastries, I have no good explanation why N00 doesn't work to kill notes/chords for you, it looks like it should work, and it works as expected for me.

To be honest it's been at least 2 months since I last tried it so I might be remembering it completely wrong. Thanks for looking into it.

Also curious about the clock... If I edit MIN_BPM and MAX_BPM, will the values in between scale? Like if I edit it to being 80-140, I'll end up with smaller steps in tempo?

Offline
Sweden
toasterpastries wrote:

To be honest it's been at least 2 months since I last tried it so I might be remembering it completely wrong. Thanks for looking into it.

Also curious about the clock... If I edit MIN_BPM and MAX_BPM, will the values in between scale? Like if I edit it to being 80-140, I'll end up with smaller steps in tempo?

No prob, let me know if you still have issues with killing chords.

There is no scaling between MIN_BPM and MAX_BPM. These are the bounds for tap tempo (when you ”tap” command X4y every beat) to avoid setting undesired tempos by mistake.
MIN_BPM is also used to set tempo the first time you tap X4y like this:
tempo = MIN_BPM + y*8

So use the closest BPM value the first tap and then let the tap tempo function find the perfect BPM by sending X4y a few more times.

Offline
Sweden

Now with Teensy support! See readme for details.

Offline
Salt Lake City, UT

Can you elaborate on what the values in this line are? Are these the MIDI CCs that are sent if a custom function (e.g. tempo, chord) is disabled?

byte midiCcNumbers[7] = {1, 2, 3, 7, 10, 11, 12};

Last edited by toasterpastries (Feb 22, 2018 2:25 am)

Offline
Sweden
toasterpastries wrote:

Can you elaborate on what the values in this line are? Are these the MIDI CCs that are sent if a custom function (e.g. tempo, chord) is disabled?

byte midiCcNumbers[7] = {1, 2, 3, 7, 10, 11, 12};

The values in that list are the MIDI CC numbers sent when you use the X command in LSDJ.
The four last ones cannot be used since they are overridden by my custom functions (velocity, clock, chords, channel).
The rest (1, 2, 3) can be used to send CC from LSDJ. You can change them if you want other CC numbers.
The second digit in the X command is the scaled CC value (will be multiplied with 8).
If you disable a custom function, then it will work as a regular CC.

Examples
X03  (CC#1 value: 3x8=24)
X12  (CC#2 value: 16)
X2F  (CC#3 value: 127)

Offline

@ledfyr I have a question: if I buy a teensyboy from Catskull, do you know if it will be able to send data to the GB too (using the USB port)?
I know I will have to code this, but I am asking if the hardware is supporting this
Thx