What's an octave between friends . . .

CloudsClouds Member Posts: 1,599
This might be of some interest to someone, somewhere.

When making a keyboard instrument (piano, synth etc) in GS you could, of course, import a sound for each key, but that would take up a lot of memory (depending on the sound + sustain/decay of the sound sample).

So you might want to consider importing just a single note and simply copying the same 'sound' file to each piano key and tuning each note to the correct pitch using GS's pitch control.

. . . .so here is the magic number you need to turn a single note sample into a whole (in tune !) musical keyboard.

Each note should be x 1.059463636363636 (105.9463636363636 %) the pitch of the previous (lower) note.

So, going up, the pitch control for each key should read:

1.00000
1.05946
1.12246
1.18921
1.25992
1.33484
1.41422

. . . . etc (multiply each note by 1.059463636363636 to get the next note).
«1

Comments

  • CloudsClouds Member Posts: 1,599
    I used this formula and a very short (looped in GS) sawtooth wave to make a fully working and playable keyboard in less than 100kb !
  • GraphicWarehouseGraphicWarehouse Member Posts: 927
    could you give us the file it sounds cool
  • ChobbifaceChobbiface PRO Posts: 491
    Awesome tip Tynan, favourited if that's a word
  • CloudsClouds Member Posts: 1,599
    @ MJMDesign

    Where can I host it ?
  • GraphicWarehouseGraphicWarehouse Member Posts: 927
    mediafire
  • CloudsClouds Member Posts: 1,599
    edited January 2012
    Cheers MJM . . . . !

    Here you go: http://www.mediafire.com/?hc19y0c7r2403cx

    I've just thrown together 1 octave in 10 minutes, but it should give you the idea - just one note and the rest of the keyboard is tuned from that note.

    Ignore/delete all the other moving crap (it's my amazing self playing music disaster) - also because this is just thrown together where the sharps overlap the white notes both will play at the same time, so don't press there ! But of course on a real project you can do it all properly and have it so they don't overlap.
  • scitunesscitunes Member, Sous Chef Posts: 4,047
    wow! very cool!
  • GraphicWarehouseGraphicWarehouse Member Posts: 927
    thanks but for some reason game salad preview player doesn't work with other peoples projects idk why? but looks cool and I can still see the code and resources.
  • CloudsClouds Member Posts: 1,599
    @ MJM

    What version of GS are you on ?
  • CloudsClouds Member Posts: 1,599
    @ scitunes "wow! very cool!"

    It's almost music.

    : D
  • LeonardDeveloperLeonardDeveloper Member Posts: 4,630
    Wow!! Tynan, I never thought of this... This is a fabulous idea!! Wow you really are talented! You did all this with just a macbook, Toyota, AK 47 & A cave in the sahara!!!!!!
    Your my role model!
  • SlickZeroSlickZero Houston, TexasMember, Sous Chef Posts: 2,870
    Oh cool, you got it down to the decimal. I've been doing it by ear so far, because I didn't know the math to correspond to octave pitch. Thanks for the formula, Tynan.
  • CloudsClouds Member Posts: 1,599
    I just divided A♯ (466.164Hz) by A (440Hz) which gave me the relationship between notes, I knew I was on the right track when the numbers double per octave. You can of course use any two adjacent pitches/frequencies.
  • LiquidGameworksLiquidGameworks Anchorage, AKMember, Sous Chef Posts: 956
    @Tynan Excellent stuff. You ought to incorporate that into an "End of the world" theme :)
  • CloudsClouds Member Posts: 1,599
    @ LiquidGameworks
    "Excellent stuff. You ought to incorporate that into an "End of the world" theme :)"

    And here's me thinking it would make an excellent ballad !

    : P
  • JohnPapiomitisJohnPapiomitis Member Posts: 6,256
    awesome stuff, thanks for sharing!
  • CloudsClouds Member Posts: 1,599
    @ JohnPapiomitis

    'Thanks' ? What good are 'thanks' to me, I can't feed my 7 children on 'thanks', I want 10% of the royalties of all dance tunes you make with my keyboard, 20% of all middle-of-the-road soft rock ballads and 18% of all hip-hop tracks above 80bpm.
  • mynameisacemynameisace Hull, UKMember Posts: 2,484
    Yup, great formula! I had a piano on one of my games that I used this on and if anyone remembers the user 'XyloFun', go and download his apps if you want to see what can be done with this method. I'm sure his apps will still be on the app store, although I've not seen him around here in AGES!

    I don't know if the pitch-shifting function has improved on Gamesalad, but even with commercial pitch altering software like Melodyne; stuff sounds weird after you alter it too much. I used to go a tone and a half either way before using the next sample.

    Peace, love and gingerbread men.
    Ace
  • old_kipperold_kipper Member Posts: 1,420
    I tried this when making a simple synth with GS, and took it further with a ADSR for each tone and 'filter' by running harmonics as secondary samples in parallel that you trigger at the same time as the base tone and add at different volumes based on desired amount of harmonic. I had some problems with getting the ADSR working but Tenrdrmer sorted out a method for cancelling interpolates with a second one for me (I think he put the method up here on the forum a while ago). The relationship of tones is best if you have a read up on, as there is a compensation within the relationship of pitches which is not directly mathematical, but is pretty close. These effect the beat frequencies of harmonics which generate richer filling out of harmonics, and by playing with formula for relationships of tones it can be heard. Hope this helps.

    KIpper.
  • ozboybrianozboybrian PRO Posts: 2,102
    ^^^^^ this guy taught me all about that stuff, he's the best!
    @old_kipper where you been lately? haven't seen you on Skype for a while mate.
  • CloudsClouds Member Posts: 1,599
    @ mynameisace

    "I don't know if the pitch-shifting function has improved on Gamesalad, but even with commercial pitch altering software like Melodyne; stuff sounds weird after you alter it too much. I used to go a tone and a half either way before using the next sample."

    The process Melodyne uses and a a good old fashioned simple increase of the sample rate are two entirely different methods - basically with GS you are playing back the sample faster as you go higher, so a drum loop played an octave higher is going twice as fast (and is pitched up an octave).
  • CloudsClouds Member Posts: 1,599
    @ old_kipper

    I struggled trying to do a decent ADSR (by interpolating music volume) - but for filtering (I was emulating a low pass, but it could work equally well for other stuff) I got a basic sound and a LP filtered version and using a slider to interpolate the volume between the two, so when the slider was up the filter was 'open' - when down it was 'closed' - I did it with two sounds, but you could, in theory layer a few samples together for all kinds of fun !
  • mynameisacemynameisace Hull, UKMember Posts: 2,484
    Yeah, I was just saying that with even dedicated pitch altering software it still sounds crappy after a certain point, so with something that is just built in to a game creation tool, sound will be degraded pretty quickly :)

    Ace
  • CloudsClouds Member Posts: 1,599
    edited January 2012
    @ mynameisace

    That's kind of my point, it doesn't (can't) suffer from all those weird artefacts that clever pitch-shifting software can produce (format issues especially) - it just gets faster ! In the same way that the sound coming from a reel to reel tape recorder when increased in speed doesn't degrade in any way.

    It will never sound as good as pitch shifted stuff using a good pitch shifter (and neither will sound as good as something that has been multi-sampled) - but one thing it has going for it is a lack or artefacting- because it isn't attempting to alter the pitch v time relationship - it retains that relationship all the way up the keyboard . . .

    It might sound a bit cheap the higher you go but it won't degrade in the sense that it won't introduce artefacting.
  • CloudsClouds Member Posts: 1,599
    . . . as you might be able to tell from my Gamesalad file (above) which sounds exactly like a real Steinway piano.
  • mynameisacemynameisace Hull, UKMember Posts: 2,484
    After 2 tones either way I can hear a difference in the quality of the sound, that's why I kept it to a tone and a half before using another sample when I did it.

    Ace
  • CloudsClouds Member Posts: 1,599
    edited January 2012
    @ mynameisace

    "After 2 tones either way I can hear a difference in the quality of the sound"

    Yep, the formants follow the pitch so you end up with (watch out technical term coming up) 'Mickey Mousing' as you go up the keyboard, there is a 'difference' in sound, if that difference is degradation to you, then it's degradation (we all have our own definition, mine involves faeces) !

    : )

    : o

    A new sample every tone or so effectively 'resets' the formats to where they would normally be.

  • mynameisacemynameisace Hull, UKMember Posts: 2,484
    Mine involves something sounding like it has faeces on it ;) Hahah

    Ace
  • old_kipperold_kipper Member Posts: 1,420
    I think the issue of degrading sounds is less of a problem with single loops of a waveform, rather than samples of a sound captured. I got my samples by generating tones within Audacity and editing them to a single cycle, but I am sure there are loads of programs out there you could do this with. As to ADSR- I used it on sound levels of the actual level of a sample linked to the interpolate value, and as the sample is so short you couldn't hear any stepping (which you would on a longer sample as GS only seems to change sound levels at the triggering of the sound or loop point (if I remember correctly), rather than during it playing. You could use the global sound or music level if you were happy with monophonic samples and didn't want to stack harmonics but you have to use sound at a sample level if you want more than one sound at a time.

    I did have some clicking issues with samples rising from 0, but cut this out with using a volume of something like 0.001 instead of 0. This changed with updates of GS but I am still running 9.82 Not sure if this would still be the case. Reading between the lines I think Android might well be a problem at the moment for this type of thing.

    @osboybrian Been off in the real world on other stuff, but hope to get it together to do TOTB4...
Sign In or Register to comment.