Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Code size reduction and speed optimalisation #1

Open
JBSchueler opened this issue Apr 15, 2018 · 3 comments
Open

Code size reduction and speed optimalisation #1

JBSchueler opened this issue Apr 15, 2018 · 3 comments

Comments

@JBSchueler
Copy link

I ran into your project as I was searching for multi tones on a arduino with a single output.
But your code seems to be even better as I was searching for.

While I was trying some MIDI files, I noticed must of them where to big.
Looking at your code, there is some room for optimization.

I will make some suggestions in the upcoming submit

@JBSchueler
Copy link
Author

Unfortunately I am not able to push a new branch...

@JBSchueler
Copy link
Author

These are the 4 files that have been edited.

added support
Arduino ATMEGA2560 support, PWM pin 10

code saving
No floating point calculation when requesting a new note
Removed pinMode() and replace by direct access to DRR
Removed unused variables, saves RAM as well
Optimized Timer2 setup
ISR optimized

smf2seq.js
Made changes to notes
Upper nibble is now octave and lower nibble the note
This changes help code size reduction on the arduino.

arduino-midi-player.zip

@JBSchueler
Copy link
Author

Added 2 repositories
arduino-midi-player for UNO and ATmega2560

arduino-midi-player for STM32F103C8T6

The ATmega2560 can handle midi file up to 64kb of size.

the STM32 can handle midi file up to 64kb of size and simultaneous notes up to 20.

There is still an issue in the timing (issue of the original) but I am unable to locate the issues.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant