Music
Why are my pauses screwing up? I can't seem to get the note·lengths correct. Does anyone know how long it should be between notes? The code isn't complete in the sense that the song isn't finished, however it should be ready to run for those who want to hear it. Note length for things like quater notes, half notes and so on are easy to figure out for duration, but how long should each not be seperated by silence to make it sound like a clear tune?
The biggest problem is that I can't get a distinct break in the notes without a pause. At this point I am not worried so much about shortcuts as getting the notes to be the right length and have a clean break. The Pause 15 makes a pretty clean break but it still sounds kind of wierd to me and I am having trouble pinpointing why. (I don't mean incorrect notes, I mean the rests for the music).
' {$STAMP BS2}
' {$PBASIC 2.5}
FREQOUT 9,500,1047··· ' C6
FREQOUT 9,250,1175··· ' D6
PAUSE 15
FREQOUT 9,500,1319··· ' E6
PAUSE 15
FREQOUT 9,250,1175··· ' D6
PAUSE 15
FREQOUT 9,350,1319··· ' E6
PAUSE 15
FREQOUT 9,350,1175··· ' D6
PAUSE 15
FREQOUT 9,500,1319··· ' E6
PAUSE 50
FREQOUT 9,500,1175··· ' D6
PAUSE 5
FREQOUT 9,250,1319··· ' E6
PAUSE 15
FREQOUT 9,200,1396··· ' F6
PAUSE 15
FREQOUT 9,200,1396··· ' F6
PAUSE 15
FREQOUT 9,300,1319··· ' E6
PAUSE 15
FREQOUT 9,300,1175··· ' D6
PAUSE 15
FREQOUT 9,500,1396··· ' F6
PAUSE 100
FREQOUT 9,500,1319··· ' E6
PAUSE 15
FREQOUT 9,250,1396··· ' F6
PAUSE 15
FREQOUT 9,300,1568··· ' G6
PAUSE 15
FREQOUT 9,200,1319··· ' E6
PAUSE 15
FREQOUT 9,250,1568··· ' G6
PAUSE 15
FREQOUT 9,250,1319··· ' E6
PAUSE 15
FREQOUT 9,450,1568··· ' G6
PAUSE 50
Thoughts?
·
The biggest problem is that I can't get a distinct break in the notes without a pause. At this point I am not worried so much about shortcuts as getting the notes to be the right length and have a clean break. The Pause 15 makes a pretty clean break but it still sounds kind of wierd to me and I am having trouble pinpointing why. (I don't mean incorrect notes, I mean the rests for the music).
' {$STAMP BS2}
' {$PBASIC 2.5}
FREQOUT 9,500,1047··· ' C6
FREQOUT 9,250,1175··· ' D6
PAUSE 15
FREQOUT 9,500,1319··· ' E6
PAUSE 15
FREQOUT 9,250,1175··· ' D6
PAUSE 15
FREQOUT 9,350,1319··· ' E6
PAUSE 15
FREQOUT 9,350,1175··· ' D6
PAUSE 15
FREQOUT 9,500,1319··· ' E6
PAUSE 50
FREQOUT 9,500,1175··· ' D6
PAUSE 5
FREQOUT 9,250,1319··· ' E6
PAUSE 15
FREQOUT 9,200,1396··· ' F6
PAUSE 15
FREQOUT 9,200,1396··· ' F6
PAUSE 15
FREQOUT 9,300,1319··· ' E6
PAUSE 15
FREQOUT 9,300,1175··· ' D6
PAUSE 15
FREQOUT 9,500,1396··· ' F6
PAUSE 100
FREQOUT 9,500,1319··· ' E6
PAUSE 15
FREQOUT 9,250,1396··· ' F6
PAUSE 15
FREQOUT 9,300,1568··· ' G6
PAUSE 15
FREQOUT 9,200,1319··· ' E6
PAUSE 15
FREQOUT 9,250,1568··· ' G6
PAUSE 15
FREQOUT 9,250,1319··· ' E6
PAUSE 15
FREQOUT 9,450,1568··· ' G6
PAUSE 50
Thoughts?
·
Comments
Also, try setting your pauses as constants:
ShortPause CON 50
MediumPause CON 150
LongPause CON 450
Then you can write your code as:
FREQOUT 9,250,1568 ' G6
PAUSE ShortPause
FREQOUT 9,250,1319 ' E6
PAUSE MediumPause
FREQOUT 9,450,1568 ' G6
PAUSE LongPause
This way, changing the value at the CON statement will update all of your values at once.
You could set up timing constants for your notes & rests, and insert the constant names in the FREQOUT statements.
So this:
FREQOUT 9,450,1568 ' G6
PAUSE 50
Becomes:
'---- Rest Durations ----
QtrRest CON 450
'---- Note Durations ----
QtrNote CON 450
'---- Note Pitches ----
G6 CON 1568
' ---- Fur Elise by Beethoven ----
' ---- Format is FREQOUT Pin,Note Duration,Note Pitch ----
FREQOUT 9,QtrNote,G6
PAUSE QtrRest
Doing this helps to make your code self documenting, and it reads much easier:
On Pin 9, play a quarter note of G6, pause for a quarter rest...
Try this:
Edit: It looks like Kevin and I were typing at the same time and thinking the same thing.
▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔
OS-X: because making Unix user-friendly was easier than debugging Windows
links:
My band's website
Our album on the iTunes Music Store
Now if I can figure out how to get it to read music...
The book is available for free download as a pdf at the bottom of this page:
http://www.parallax.com/detail.asp?product_id=28152
-Stephanie Lindsay
I have and am using the Whats a Microcontroller book. Appendix G does go into how to do a ring tone (ie song) however it relies on standard default times. I am trying to find as close to a human sound as I can get and even though the bood goes states "A note could have up to five characters between the commas; here is what each character specifies:··· ,Duration· note· sharp· dot· octave,·· For example: , 2g#.6," (P317 at the bottom).
While this is very helpful I still have to recall my years in highschool band to remember that a flat is a sharp from the note below and that not playing is as important as playing. That aside, how do I do somthing like a tripelette(sp?).
So for example lets say I want to play a stacato C that is a 1/32 note follwed by a B flat whole note. if I use straight computer sounds its going to sound inhumanly perfect·and the spaces will be distinct.·One thing that gives music character is the way we make small and mostly unnoticed errors in hold a note slighlty to long or cutting it fractionally short. Even professionals do this but do it much less then the rest of us.
What I am after isn't just the pauses, but trying to get a human feel and trying to figure out the chromatic scale so that I can do more with the music, give it 'soul' so to speak. That being said, I have contemplated running a random generator set at between .09 seconds and .10 seconds (or perhpas just variants of .09) so that the notes will vary slightly and sound more human, however running a sub like that raises other concerns.
Side note - The time interval was chosen because we passed a stop watch around work and most pepole get .07 to .11 of a second for timed reactions, so I figured split the difference and call .09 and .10 human reaction time.
Lastly, I am intending to get several speakers together and run tones simaltanously on them so chords and different sounds can be used to generate the song more fully. It would be fun to be able to have speakers interconect, however just one speaker doing that would require studing Finite Machines and thats a whole different ball of wax which will have to be melted so to speak.
· Whew! that was a mouth full
I would halve that, for the simple reason, that it is one person playing a tune, and to have such a wide variance will make the melody change to much between notes.
I would think that the variance in changing the attack/hold/decay of a note is more important than the accurate timing of a note being played...
To play multi note chords, mix the ouputs into one amp/speaker...
I remember using a 741 op amp to make some tubular bell sounds.
I had enough boards made up for 3 full octaves, and I mixed the ouputs into a fet, then to a preamp-amp.
They sounded like the real thing...
Bob
Post Edited (Robert Kubichek) : 7/26/2006 3:23:44 AM GMT
If you're modeling singing or a breath-controlled instrument there won't be space between every note. The notes in a phrase will all run together and the spaces will come either where rests are explicitly written or at the end of a phrase. When singing, as a general rule, you breathe with the punctuation. If there is no rest at the end of a sentence, you'll take a breath. And the breath is in time musically (e.g. a sixteenth note or eighth note).
Reaction time is different than musical timing. Reaction time measures how fast you can react to something in a situation where you don't know when it's coming. Musicians know when the downbeat is coming and can be exactly on time (or early or late if the style dictates). No decent musician will be a tenth of a second late. The "human" feel doesn't come from random errors--it comes from deliberate expression.
Here's what I use for pitches:
I hope this helps.
▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔
OS-X: because making Unix user-friendly was easier than debugging Windows
links:
My band's website
Our album on the iTunes Music Store