Sign in to follow this  
SillyCow

Reducing the number of octaves in a song

Recommended Posts

Hi,

I am a programmer and have very limited knowledge in music. 

I am building a robotic glockenspiel that can play midi files.

My problem is that most midi-files I encounter are for a piano.

A piano has a lot of octaves. My 27 note glock has 2.5 octaves.

Most midi that I want to play require more than 2.5 octaves, and as a result I am missing a bunch of notes.

 

Looking around on you-tube I have deduced 2 facts:

1. Some piano music uses redundant notes to sound more robust: I have encountered ferrere-jeaques played with bass chords, whereas all beginner xylophone tutorials teach it with single notes on 1.5 octaves.

2. I have seen some compositions of monster pieces like Tocatta and Fugue altered to be played on a xylophone. They were missing some notes, but they sounded allright.

 

 

As a programmer, I am guessing that there is some sort of musical transformation that I can make on a piano piece to make playable on only 2.5 octaves. As I am not trained in music, I do not know what that process is called, so Google is not helping out. What should I search for?

 

Also, is there some magical music program that could do this for me, and save me the trouble of writing my own algorithm?

Share this post


Link to post
Share on other sites

Anything out of range needs to be transposed up or down to an octave in the glockenspiel's range. I don't know of any way to automate this. However the musical transformation you're talking about is not one thing. It's an array of aesthetic decisions. The arrangements you came across were made by people, and this type of thing requires human judgment. If you make an algorithm that could just move stuff from octave to octave to make it fit the range of the instrument, it would need human tweaking in order to sound right. I'm not saying it's impossible, but at this point it would be simpler to arrange the pieces yourself than it would be to design an algorithm to make complex aesthetic judgments.

Edited by CCH Audio

Share this post


Link to post
Share on other sites

would be simpler to arrange the pieces yourself than it would be to design an algorithm to make complex aesthetic judgments

That's what I feared...

Is there a way to obtain midi files that are intended for a certain instrament?

I am looking for pretty standard stuff, like famous classical works and fanfare.

I don't mind paying.

 

If not, is this "arrangement" process something that I could pay a reasonable amount of money to a freelance to carry out? This is a non profit hobby, so I'd say reasonable is <100$ for several famous pieces. Am I being optimistic here? I have no musical training, so I have no idea if this is a task for a highschooler, or something that requires Beethoven himself :-)

Edited by SillyCow

Share this post


Link to post
Share on other sites

It is a simple task, it just requires some understanding of the structure of a musical piece (which notes form such a coherent part that they should be transposed by the same number of octaves? Which notes can be transposed independently from other close ones as a timbre change that doesn't affect melody too much?) and some aesthetic decisions (in which octave does something sound better? If a melody wanders over an excessive range, where should it be cut into differently transposed pieces?).

Practical editing means selecting notes in a piano roll or notation GUI, dragging them up or down (by a whole number of octaves) and auditioning various alternatives; anybody can do it, find a good MIDI sequencer and try on your own.

 

N.B. If you are targeting a mechanical automated instrument, you don't need to worry about using easy to play notes: in addition to folding part of the notes a whole number of octaves up or down, you can also freely transpose the whole piece by the same number of semitones to make it fit in your feasible note range. Note names change, but all intervals remain the same.

Share this post


Link to post
Share on other sites

freely transpose the whole piece by the same number of semitones to make it fit in your feasible note range

But the pieces take up 4 octaves, whereas I only have 2.5. I can't see how moving the entire piece around would help. Geometrically speaking (for lack of musical lingo), the piece is too wide, moving it left or right will not make it fit in a narrow box...

Edited by SillyCow

Share this post


Link to post
Share on other sites

Awesome project...

 

As a first quick pass, I'd suggest your MIDI parsing routine just force the pitches into the range of your glockenspiel by doing an octave transpose.

It would sound a bit strange on some pieces (i.e it wouldn't make a 'complex aesthetic judgement'), but would let let all the notes be played and it would have the benefit of letting you give it any MIDI file.

The alternative would be to just ignore out-of-range notes.

 

For example

 

 

if (NotePitch > MAXGLOCKPITCH) {       // are we out of range, too high?

   While (NotePitch> MAXGLOCKPITCH) do {  // yes, keep transposing down an octave until we're in range.

      NotePitch -= 12;      // transpose down an octave

  }

}

if (NotePitch < MINGLOCKPITCH) { // are we out of range, too low

  While (NotePitch < MAXGLOCKPITCH) do {  // yes, keep transposing UP an octave until we're in range

      NotePitch += 12;    // tranpose it up an octave

  }

}

// at this point we have a valid NotePitch within range of the glockenspiel

Edited by bschmidt1962

Share this post


Link to post
Share on other sites

 

 

[quote name='bschmidt1962' timestamp='1444331297' post='5256259']
For example
[/quote]

Thanks

 

At the moment, I allready scan to find the best octavem then I cut out all the notes that don't fit.

I will try this method of transposing each musical note separately.

 

I have also thought that maybe I should do the above for each musical bar as a whole instead of individ[quote name='bschmidt1962' timestamp='1444331297' ual notes. Would that be better?

Edited by SillyCow

Share this post


Link to post
Share on other sites

 
if (NotePitch > MAXGLOCKPITCH) {       // are we out of range, too high?

 etc... etc...

}

 

I implemented several steps.

1. I try several transposes for the song. For each time I miss a note I reduce the score of that transpose by: LOG( number_of_times_I_missed_this_Note ).

    1a. The LOG ensures that I don't give too much weight to a single repetitive note that's being missed.

2. I transpose the entire piece by the transpose with the best score.

3. For every not that's not in the range, I add or reduce octaves until it fits (as suggested above).

 

The result sounds a bit off-pitch, but it's still pretty good: result

What do you think?

 

Other pieces sound much better. I purposefully chose the good old "T&F" because it spans a bunch of octaves, and I wanted to push the algorithm to the limit. I think it did pretty well.

 

I'll upload a recording from my glockenspiel soon. (Need to re-glue some mechanical parts again :-( )

Edited by SillyCow

Share this post


Link to post
Share on other sites

I managed to record the new configuration with many notes playing at once.

https://www.youtube.com/watch?v=BT-4n7OKxXw

However... I then misconnected some electrical components, and burnt them out.

That's the shame with H/W vs S/W. There is not CTRL-Z or SVN-Revert.

I now have to wait 4 weeks for the new parts to arrive from China :-(

Also, the solenoids are going too fast for the camera. Each solenoid strikes for 5ms. You need a 200fps camera to catch that...

Edited by SillyCow

Share this post


Link to post
Share on other sites

Hi, 

 

this robotic glockenspiel is simply amazing. I believe you've already received useful tips on how to get things transposed, very cool. Nevertheless things may vary from song to song, perhaps most of the "musical choices" one should do in order to achieve a pleasant rendition might be transformed into automation and programmed, i am a musician so i can't advice you on that.

 

A human being could take into account many aspects at the same time: change the scale if needed, ignore some voices in a poliphonic song etc....

 

I can do the transcriptions, if you wish. Could we please talk by private message? 

 

Cheers

 

 

 

Edit: P.S.

 

Regardless to your will to contact me, i wish to expand on the importance of adapting the scale, this might be useful anyway... let's say your song is in A minor and you feel the bass line playing a F, then G, then A....your glock's lower note is C and you will perform the bass melody too close to the second octave.... transposing everything to E minor could do the job.

Edited by Francesco Pirrone

Share this post


Link to post
Share on other sites

 

...

A human being could take into account many aspects at the same time: change the scale if needed, ignore some voices in a poliphonic song etc....

...

 

 

Edit: P.S.

 

Regardless to your will to contact me, i wish to expand on the importance of adapting the scale, this might be useful anyway... let's say your song is in A minor and you feel the bass line playing a F, then G, then A....your glock's lower note is C and you will perform the bass melody too close to the second octave.... transposing everything to E minor could do the job.

 

 

I tried reading a little bit about scales on Wiki. Went way over my head. (I have no musical background).

Is there a difference between "adapting the scale" and transposing, or is it just another type of transpose?

 

Also, I sent  you a private message, regarding the other stuff.

Share this post


Link to post
Share on other sites

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now

Sign in to follow this