My favorites | Sign in
Project Home Downloads Wiki Source
Search
for
Mac  
Mac version progress
Featured
Updated Apr 27, 2012 by williamj...@tiscali.co.uk

Introduction

Accordion emulation written in C. Uses Mac keyboard and space bar to emulate a three row button accordion. There is a choice of midi instruments and keys, now including C System and B System. A Mac version has been released.If you like this, please make a donation.

  • Keys: F/Bb/Eb, G/C/F, A/D/G, C#/D/G, B/C/C#, C System, B System
  • Instruments: Standard midi set, defaults to accordion

Playing

Hold the keyboard facing away from you with the Esc button at the top. Play the keys, waggling the space bar as it were the bellows. The escape key, the control key and the alt key may also be used as the bellows. If you don't know how to play button accordion, see http://info.melodeon.net.
The latest Mac version includes bass on the function keys, but I discovered while testing on a Macbook that there not a lot of point because all the keys appear to have hard coded functions assigned to them. And the display is in the way. The bass now works on the number keys.

Donate

If you like this, please make a donation.

Downloads

Comment by conjunto...@ymail.com, Oct 31, 2010

this is gay how do you play any ways

Comment by stefan.b...@gmail.com, Jan 30, 2011

I discovered your project while searching for an emulation for chromatic button accordion (I play Piano-accordion and wanted to try something on a button accordion). Great work! May I suggest to extend the project to include a chromatic button accordion in c and b? It also would be nice to see the notes underneath the key of the keyboard for easy orientation. Thank you!

Comment by project member williamj...@tiscali.co.uk, Feb 4, 2011

If you set the key to B/C/C# you get a standard three row semitone layout with single bass notes instead of chords (Windows version)

Comment by daria.gu...@gmail.com, Apr 3, 2012

I'd like to ask for the same thing: could you either add both c-chromatic and b-chromatic layouts or add an option to set up the layout via an external file (better)?

Unfortunately, B/C/C# is not the same thing as (either) chromatic layout. It is just another diatonic layout, however tricky. It is also bisonoric (plays different notes when inhaling and exhaling).

True chromatic accordions are unisonoric (play the same sound in or out). This is why they are so much easier to learn - you just need to memorize one layout instead of two. And you get transposition by simple geometrical offset.

(I would like to have a go on it myself, but the code doesn't compile on my 64-bit SnowLeo? :( The binary works though. )

Comment by project member williamj...@tiscali.co.uk, Apr 3, 2012

Another user had a similar problem with another of my projects. If you replace all instances of ReleaseMenu? in the source code with DisposeMenu?, and build a 32bit application it should work ok.

I don't know anything about c-chromatic and b-chromatic layouts. The data for the notes are in tables at the beginning of the program. The table for a single diatonic row is in

BYTE notes[BUTTONS][2]...
However you will need to make changes to the logic in the code to switch from diatonic to a unisonic layout. The code which will need changing is around the lines
	int note = notes[k][bellows] + keyvals[key][i];
Comment by project member williamj...@tiscali.co.uk, Apr 6, 2012

I have added C chromatic and B chromatic to the windows version. Unfortunately the midi output on my not-a-mac has stopped working, so I can't test the mac version until I can use my daughter's macbook.

Comment by daria_gu...@yahoo.com, Apr 13, 2012

Hi Bill,

Thanks for the suggestion. Also, thank you very much for sharing the code on code.google.com ! I have never compiled any mac-specific C code before, so this was my first experience both with Audio and GUI.

I found a way to cross-compile your program in 32bit under SnowLeopard?, I just did it via command line without any Xcode:

gcc -m32 -fpascal-strings -framework Carbon -framework AudioUnit? -framework AudioToolbox? -o Accordion.app/Contents/MacOS/Accordion Accordion.c
It was necessary because Carbon library is not supported beyond SnowLeopard? and in 64bit mode. Now they promote and support Cocoa all the way.

Some deprecated methods and types (AUGraphNewNode, AUGraphGetNodeInfo and ComponentDescription?) had to be changed in the AudioToolbox? framework, but the GUI compiles under 32bit without any problems. Neither "ReleaseMenu?" nor "DisposeMenu?" were used in the code, so they didn't need to be changed.

Both a mac laptop and an external aluminium keyboard that I have access to have very hard key bindings for keys F1-F12, so chords didn't work for me initially. But when I substituted scan codes to the number keys (1-9,0,-,=) everything worked and I could finally hear what chords are used on diatonic melodeons (I have never touched a real melodeon myself). Very interesting!

Then I added a 'Q' key and implemented and made a B-chromatic prototype. It worked very well, although I didn't pursue it any further and so my prototype doesn't support switching between melodeons and chromatic accordions. I haven't touched the code for a couple of weeks, and then noticed that you implemented both chromatic layouts in a Windows version. Although I don't have a Windows machine, I'd like to thank you on behalf of others :)

The Stradella chord matrix on chromatic accordions has 5 to 6 rows by itself, so sadly there is no way they can be mapped to the same keyboard. However the row of numbers could be very useful as a duplication of the lowest row (Z-M) on both C-chrom and B-chrom. Usually, if a chromatic accordion has more than 3 rows (they come in 3,4,5 and 6-row varieties), the rest are duplications of the basic 3. Additional rows allow you to minimise hand movements in fast passages.

Unfortunately (although I have a few ideas how this app could be extended) I don't have time at the moment even to merge my B-chromatic into your original version. But I can send you the files if they are of any interest...

Cheers,

Leo.

Comment by project member williamj...@tiscali.co.uk, Apr 14, 2012

I have posted the mac code for the latest version including c chromatic and b chromatic to the svn repository here http://code.google.com/p/accordion/source/browse. I won't be able to test it and post a new version for a few weeks.

Comment by daria_gu...@yahoo.com, Apr 15, 2012

Hi Bill,

Thanks for the update. A few glitches:

1) In order for the code to compile on SnowLeopard? without deprecation warnings you'll need to change the following:

1a)

ComponentDescription? cd;
becomes
AudioComponentDescription? cd;

1b)

status = AUGraphNewNode(graph, &cd, 0, NULL, &synthNode);
becomes
status = AUGraphAddNode(graph, &cd, &synthNode);

1c)

status = AUGraphGetNodeInfo(graph, synthNode, NULL, 0, NULL, &synthUnit);
becomes
status = AUGraphNodeInfo(graph, synthNode, NULL, &synthUnit);

2) The pre-colouring of the keys in chromatic mode is nice, however after you play it once the key stays white again :) Would make sense to reverse the current colour rather than just turn it white or black.

3) There is some restriction on which notes can be played at the same time. Some chords just won't. I could not figure out yet whether this is due to using four MIDI channels, or due to some internal keyboard controller limitations (it is probably not expected by MacOSX developers that four letter keys are pressed and held at the same time). I am more inclined to believe this is keyboard-related bug. An example on my mac is inability to press anything else if you are already holding keys "T" and "B". However if you are holding "B" and "Y", the only insensitive keys are "T" and "N". It puzzles me a lot, and I wonder if it is reproducible on other macs.

4) It would be nice to extend the keyboard with the keys that are "mute" at the moment ("Q" on the left and "]" on the right). However it may be tricky to integrate them into diatonic mode, as this would introduce a shift through the pattern.

5) It would be nice for diatonic accordion players to re-gain access to the chords (that are currently masked by bindings of the F1-F12 keys) by moving them to the row of numbers (1-9,0,-,=). The number of the keys is the same, so it is a matter of substituting the keyboard scan codes.

Cheers,

Leo.

Comment by project member williamj...@tiscali.co.uk, Apr 15, 2012

I will update the AUGraph code when I get a machine that can run a later version of OSX than 10.4. I will try reversing the highlighting of the keys. The restrictions on the number of simultaneous notes is due to the keyboard. It varies by keyboard. I've got an old PC keyboard that I don't have enough fingers to beat. I picked the current range for the c-system and b-system layout after consultation on melodeon.net. It is apparently usual for small chromatic and piano accordions to start with the G below middle C. I will investigate incorporating the number keys for the bass.

Comment by project member williamj...@tiscali.co.uk, Apr 16, 2012

I have posted the mac code for the latest version incorporating the suggestions above to the svn repository here http://code.google.com/p/accordion/source/browse. I can't update the AUGraph code because the updated functions aren't available in 10.4, and they are only deprecated in 10.5 and 10.6. Unfortunately Apple move the goal posts faster than I can keep up. I won't be able to test it and post a new version for a few weeks.

Comment by project member williamj...@tiscali.co.uk, Apr 22, 2012

New version incorporating the above now released.


Sign in to add a comment
Powered by Google Project Hosting