Home
JAQForum Ver 24.01
Log In or Join  
Active Topics
Local Time 06:53 02 Aug 2025 Privacy Policy
Jump to

Notice. New forum software under development. It's going to miss a few functions and look a bit ugly for a while, but I'm working on it full time now as the old forum was too unstable. Couple days, all good. If you notice any issues, please contact me.

Forum Index : Microcontroller and PC projects : Picomite Project Suggestion

Author Message
Volhout
Guru

Joined: 05/03/2018
Location: Netherlands
Posts: 5091
Posted: 07:08am 18 Jun 2021
Copy link to clipboard 
Print this post

This is just an idea that popped up again into my mind this morning while listening to music. It has been on my mind since I saw the stepper motor video on Youtube, I want to share with you:

steppers playing music

With picomite we can do this. I think I figured out what is behind this.

If you look carefully, the motors always run clockwise. This means that the stepper motor has no intelligent control, but simply has the direction fixed. The only thing you need is a square wave at the STEP input with the correct frequency.

Picomite could do this using 4 PWM's set to 50% dutycycle, with varying frequency. (MX170 only has 2 PWM frequency's, so it could not do it).

OK, where to get the music....

I think they use midi files. In midi files, notes and duration and channel are nicely packed. So you need a 4 instrument midi file, or you need to create one from a 4 voice (SATB) choir score. There are several PC programs that can do that for you.

So a midi file must be parsed. You only need to parse the leader (speed), but could even hardcode that. I think the program should use a heartbeat of 1/8 (faster notes won't play nicely anyway on steppers). Then parse the midi channel/tone/duration.

Channel shows what PWM to program
Tone can be used (via a lookup table) to set PWM frequency.
Duration must be translated in heartbeat ticks.

You can test the parser by simply taking the 4 PWM outputs via identical (10k?) resistors to an audio amplifier. Transitions will sound horrible, and everything is square wave, so very sharp, but the music should be recognizable..

The stepper drivers must be set to FULL stepping (not half stepping or micro stepping) because you need them to make noise, not behave good.

The guitar is there to amplify (they probably even use the instruments pickup to connect to an amplifier/recorder).

I thought I pick this up myself, but have few other projects that have been prioritized by my wife. So if someone else feels this is a nice challenge, please prove that the picomite can do this....

Volhout

P.s. you may need to octave the voice when it exceeds 1kHz, since steppers will not run at these very high frequency's)
Edited 2021-06-18 19:27 by Volhout
PicomiteVGA PETSCII ROBOTS
 
hitsware2

Guru

Joined: 03/08/2019
Location: United States
Posts: 719
Posted: 06:36pm 18 Jun 2021
Copy link to clipboard 
Print this post

It sounds like PWM music ( signals ) through an audio amplifier and speaker .
I would surmise the steppers are only there for the visual effect .
The newer controllers with multiple PWM frequencies are quite music capable .
my site
 
Print this page


To reply to this topic, you need to log in.

The Back Shed's forum code is written, and hosted, in Australia.
© JAQ Software 2025