dlehenbauer / arduino-midi-sound-module Goto Github PK
View Code? Open in Web Editor NEWTurn your Arduino Uno into a 16-voice MIDI sound synthesizer
License: MIT License
Turn your Arduino Uno into a 16-voice MIDI sound synthesizer
License: MIT License
Hi !
In most midi files i hear a hanging note thru the whole time.
If i press stop, the hanging note is gone...
Best regards
Paddy
Daniel,
I've got my breadboard of what you've outlined working wonderfully. Thanks for the awesome project! As a sort of beginner programming challenge I want to implement stereo using a second Arduino. I'm using input option 3, so both Arduino can listen to the same incoming midi stream (no need to try to send data from one to the other). If a midi signal implements panning then each Arduino would scale the volume by the appropriate value.
I've been digging through the source trying to follow (beginner C++ project for me, so trying to follow is half the battle) and it seems like I need to:
uint8_t monoVolume(uint8_t volume, uint8_t velocity) {
// Map 8-bit channel volume and 7-bit velocity to 7-bit mono volume. We've scaled MIDI
// channel volume up to 8-bit so that we can perform an inexpensive '>> 8'.
return (static_cast<uint16_t>(volume) * static_cast<uint16_t>(velocity)) >> 8;
}
uint8_t mixVolume(uint8_t mixVolume, uint8_t stereoMultiplier) {
// Map 8-bit stereo multipler value and 7-bit mono volume to 7-bit final mix volume.
return (static_cast<uint16_t>(mixVolume) * static_cast<uint16_t>(stereoMultiplier)) >> 8;
}
Before I get off the deep end here, does that seem like a reasonable approach to take and do you have any advice to the above?
If this is too much feel free to close. Thanks again for making such a cool project!
Edit: presumably I'd want to drive both Arduinos from the same clock eventually so if it was converted to mono signal the samples would stay in phase.
I received the following error message when I compiled the project today:
"Sketch uses 32388 bytes (100%) of program storage space. Maximum is 32256 bytes.
Global variables use 1027 bytes (50%) of dynamic memory, leaving 1021 bytes for local variables. Maximum is 2048 bytes."
The Arduino IDE is version 1.8.10 and the target was an Arduino/Genuino Uno.
For my purposes, I don't need the MIDI Bend facility so I commented this out and it compiled successfully.
Hi,
I am building a stand alone midi player based on the midi sound module and the MajicDesigns MD_MIDIFile file player. This is quite well along and it is basically working. I can read files from the SD, display their names on an OLED display, select a file and play it. This has been done by some copying of the the example Command Line Interface rather then by any feat of great genius on my part.
One of the functions supported by the file player is a pause function. However it does not work well. When paused the synth is not silenced and when restarted it sounds out of synch somehow. Some investigation of commands being sent shows that the problem seems to be linked to the file player. I will raise that with MajicDesigns.
My question relates to the best way to silence the synth on pause so that it can restart. I am not sure if channel command BX 78 0 (all sound off on channel X) works in the synth side and there is also BX 7B 0 (all notes off on channel X) which also looks like a candidate. Maybe there is another better answer?
I could be wrong but it seems I need to co-ordinate the file player with the synth so that one sends what the other is expecting. So I will start with the synth side and get an understanding and then move to the player side.
Regards, Fred.
I've seen your demo and was amazed that you perfected this feat on an Arduino Uno!
Since your code didn't get the respect it deserved I posted this project on reddit and it was popular.
Your welcome.
Also, I can see potential in your project. I just have one favor; is there a way you could make the code to read a MIDI file from an SD card? If so, then that would really make the Arduino community happy.
Thank you for your time.
Hi,
Firstly thank you for developing this software. Given the hardware it runs on it is a remarkable achievement and it works really well.
I am working on a clock which I want to play the Westminster chimes, as per Big Ben in London, England. Having the clock play the respective MIDI files is a pleasing solution in terms of ability to get a good sound and be able to modify it. Your software makes that a proposition at a very reasonable cost compared to some of the Arduino MIDI solutions.
In the process of development I have encountered an odd phenomenon with the behavior of the display.
Please see the attached file which plays the hour chime melody followed by 6 hour strikes. While I probably won't use the display in final implementation I am having trouble seeing why the display behaves as it does.
west.zip
I am playing this file with Audacity configured to play into the LoopMIDI port then through the Hairless MIDI Serial Bridge to the Arduino which is on USB Port 7. The file plays as expected and sounds good. It is a very simple melody, effectively no chords and only one note at a time. The first time it plays the display shows notes sequentially across the voices as the notes play. First note shows on first voice, second on second voice and so on, until the 16 notes of the melody play out and all the hour strikes show on the first voice.
On all subsequent plays (until the Arduino is reset) the display shows notes on the first and second voices alternately, with the hour strike being on the first voice.
On first glance this looks like an initialization problem, and I started to look for that in the code. However this code, even the display part which is simpler, is complex as necessitated by what it does in such simple hardware. It seems to me that the display side of the code is correct and it is correctly reporting that each note is on a different voice for the first play. I cannot see why that is given the debug information from Hairless. See the attached image showing all notes going to channel 1.
I admit that this is not a desperate problem, but it is an interesting one and I hope you have the time to have a look.
Once again thanks for taking the time to develop such a great piece of software.
Kind Regards,
Fred.
A declarative, efficient, and flexible JavaScript library for building user interfaces.
๐ Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
An Open Source Machine Learning Framework for Everyone
The Web framework for perfectionists with deadlines.
A PHP framework for web artisans
Bring data to life with SVG, Canvas and HTML. ๐๐๐
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
Some thing interesting about web. New door for the world.
A server is a program made to process requests and deliver data to clients.
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
Some thing interesting about visualization, use data art
Some thing interesting about game, make everyone happy.
We are working to build community through open source technology. NB: members must have two-factor auth.
Open source projects and samples from Microsoft.
Google โค๏ธ Open Source for everyone.
Alibaba Open Source for everyone
Data-Driven Documents codes.
China tencent open source team.