abc for automata !

For discussing abc notation software
greybeard
Posts: 3
Joined: Fri Feb 21, 2014 2:06 pm
Humanity check: a real person
How many letters in "spam" (4)?: 4

abc for automata !

Postby greybeard » Fri Feb 21, 2014 2:22 pm

While keeping my head low(watching out for brickbats), I thought I'd ask here for any thoughts users might have on my quest to build a 21st century automata-playing-dulcimer.

The 'player' is in prototype form, and the electronics are under construction that will drive it using stepper motors.

Having a little familiarity with abc notation through my attempts to learn to play the dulcimer myself (that's hammer, not mountain), it seemed to me that abc might be a good starting point for the music input. This would finish up as a binary input to the stepper motors, with each instruction being an incremental change from the previous position, rather than an absolute position.

While the gap between abc and my required binary is fairly large, I'd be interested in the general reactions of folk here, and any observations they might care to make.

Regards all,
John

jan_olieslagers
Posts: 9
Joined: Sun Nov 21, 2010 11:22 am
Humanity check: a real person
How many letters in "spam" (4)?: 3

Re: abc for automata !

Postby jan_olieslagers » Wed Mar 26, 2014 8:12 pm

Couldn't help spending some time tinkering.
Having no idea of the total hardware setup, I see the biggest issue in the hardware between the PC holding the ABC data and the microcontroller that I assume to be driving the stepper motors. Elegant would be to have the microcontroller/stepper driver to accept midi commands - in that case abc2midi would do all the rest.

greybeard
Posts: 3
Joined: Fri Feb 21, 2014 2:06 pm
Humanity check: a real person
How many letters in "spam" (4)?: 4

Re: abc for automata !

Postby greybeard » Sat Mar 29, 2014 10:06 pm

Hello Jan.

One of my original approaches was to use an Arduino microcontroller to control the output of an SD card which held the data for the automata.
This would be fed, via a serial/parallel register, to a logic board which sent the appropriate signals to the six stepper motors (three for each arm), and which also carries separate homing circuits to locate the hammers in a 'ready' position at the start of playing.
On each arm, two motors control the horizontal position of the hammer, and one controls the actual dynamics of striking - how hard, and timing.

Sometime in the next few days, I should be able to move both arms for the first time using just the logic, and test the homing circuits.
As I get nearer to that stage, I realise how little I know about analysing the problem of the software.
I'm trying to find a way of using ABC notation because so much of the music that I should like to play is available in that form, and it would lend itself to editing as I try to convert it to an instrument that uses two hands, sometimes alternately but not exclusively so.

First I need to extract the pitch, in my case limited to 26 consecutive semitones. This would be compared with the previous note to give the stepping information to the arm. Choosing which arm would be done by me, by inspection, as I process the conversion from ABC to my own software.
(I'm already thinking of a dedicated keyboard that would allow me to input the 'handedness' with a pressure switch mounted on a finger of each hand as I type!)
Then the duration of each note, probably through a separate row of keys, which amounts to a delay before the next note is struck.
Finally, the loudness, which will be controlled by the choice of one of three sub-programs fed to the hammer steppers.

These separate bits of data will be strung together to produce a 16-bit word (some redundancy available for other controls), which, stored on the SD card, is then fed into the logic circuits rather in the manner of driving an LED matrix, with the horizontal 'message' being the stepping/direction information to the 6 motors.

I hope that's not more information than you needed, but it's not a project that lends itself to brevity !

regards
John

jan_olieslagers
Posts: 9
Joined: Sun Nov 21, 2010 11:22 am
Humanity check: a real person
How many letters in "spam" (4)?: 3

Re: abc for automata !

Postby jan_olieslagers » Wed Apr 16, 2014 8:30 pm

John, excuse my long silence. I am afraid I will have still less time in future, yet here goes for some further musings:

-) where you mention "homing circuits", do you mean limit switches as described at https://en.wikipedia.org/wiki/Limit_switch ?

-) your mechanical setup seems over complicated to me. I think you could much simplify the project by having more than two hammers. My idea would be to have as many hammers as there are lateral positions, perhaps 4 or 5, so as to do away with need for lateral motion. But of course this is not what you asked for, I ought not really to give unrequested comments... And perhaps you want to give your creation a human appearance, like the 18th century fake chess automaton? (see https://en.wikipedia.org/wiki/The_Turk ) ?

-) I still hold to my original idea: the easiest solution would be to convert your abc music to midi files, then have a PC program that further converts midi to the 16-bit words that your Arduino interprets to control the stepper motors. This should not be too hard, could certainly be done in C, likely also in one of them new-fangled scripting languages like perl or python, perhaps even in raw shell with some awk and sed thrown in. I think you could help a software developer by creating some tune, then create manually the SD-file that corresponds to it; the programmer could than adjust the code until the output matches your manual creation. Perhaps the most complicated part could be writing the "raw" data to the SD-card, an alternative might be to send out the data through a serial port and have the Arduino read that, and buffer for "playback".

It certainly seems like a great project! Bunch of friends of mine are learning to play the hammer dulcimer and I could surely poke some fun at them with this creation!

emmagia
Posts: 2
Joined: Sat Sep 20, 2014 5:44 am
Humanity check: a real person
How many letters in "spam" (4)?: 4

Re: abc for automata !

Postby emmagia » Sat Sep 20, 2014 5:46 am

I have decided to offer the switch described above in my version 0.01, now available for download. I adopted the following interpretation of ABC2.0, paragraph 2.3: A line not ending with a backslash shall not force a line break in the printed result. If this is implemented in any software (which one?), it is a contradiction to the behaviour of abcm2ps, so my switch is necessary. I am looking forward to more comments.
emma

greybeard
Posts: 3
Joined: Fri Feb 21, 2014 2:06 pm
Humanity check: a real person
How many letters in "spam" (4)?: 4

Re: abc for automata !

Postby greybeard » Sat Oct 11, 2014 4:25 pm

Hi Jan,
To continue the extended conversation !

The wiki entry last line is the right one - there will be an optical switch which tells the circuitry that each stepper has moved the hammer to a 'home position', a reference point when setting up at the beginning of each piece of music. This will allow me to use the same mechanical set up to operate on different percussion instruments.
No, to your first thoughts re mechanical complication, and yes, to me aiming at the 18th century automata. Hovever, avoiding the 'uncanny valley' effect, by having an obviously artificial wood/metal construction.

Thank you for your thoughts in the last paragraph. It will take me a while to get back to the software side, as the prototype mechanics had much too much load, and I have completely redesigned and rebuilt them, hence the delay in my reply.

I think I might be in for at least another 6 months work before 'first light' is seen, but I hope that I shall be able post a video here at the apropriate time.

Hi emmagia,
To be honest I have no idea what your post refers to.
Could you please explain, or have you mis-posted ?


Return to “Software”

Who is online

Users browsing this forum: No registered users and 1 guest

cron