anchor.diff:  , jack2
   , supercollider
   , qwt
  -, osmid
   }:
   
   let
   
     supercollider_single_prec = supercollider.override {  fftw = fftwSinglePrec; };
   
  +  pname = "sonic-pi";
  +  version = "3.3.1";
  +  src = fetchFromGitHub {
  +    owner = "sonic-pi-net";
  +    repo = "sonic-pi";
  +    rev = "v${version}";
  +    sha256 = "sha256-AE7iuSNnW1SAtBMplReGzXKcqD4GG23i10MIAWnlcPo=";
  +  };
  +
  +  # sonic pi uses it's own aubioonset with hardcoded parameters but will compile a whole aubio for it
  +  # let's just build the aubioonset instead and link against aubio from nixpkgs
  +  aubioonset = mkDerivation {
  +    name = "aubioonset";
  +    src = src;
  +    sourceRoot = "source/app/external/aubio/examples";
  +    buildInputs = [jack2 aubio libsndfile];
  +    patchPhase = ''
  +      sed -i "s@<aubio.h>@<aubio/aubio.h>@" jackio.c utils.h
  +    '';
  +    buildPhase = ''
  +      gcc -o aubioonset -laubio jackio.c utils.c aubioonset.c
  +    '';
  +    installPhase = ''
  +      install -D aubioonset $out/aubioonset
  +    '';
  +  };
  +
   in
   
   mkDerivation rec {
  -  version = "3.2.2";
  -  pname = "sonic-pi";
  -
  -  src = fetchFromGitHub {
  -    owner = "samaaron";
  -    repo = "sonic-pi";
  -    rev = "v${version}";
  -    sha256 = "1nlkpkpg9iz2hvf5pymvk6lqhpdpjbdrvr0hrnkc3ymj7llvf1cm";
  -  };
  +  inherit pname version src;
   
     buildInputs = [
       bash
  
positive.code:   dontWrapQtApps = true;
    preFixup = ''
      wrapQtApp "$out/bin/sonic-pi" \
        --prefix PATH : ${lib.makeBinPath [ bash jack2 ruby supercollider ] } \
        --set AUBIO_LIB "${aubio}/lib/libaubio.so"
      makeWrapper \
        $out/app/server/ruby/bin/sonic-pi-server.rb \
        $out/bin/sonic-pi-server \
        --prefix PATH : ${lib.makeBinPath [ bash jack2 ruby supercollider ] } \
        --set AUBIO_LIB "${aubio}/lib/libaubio.so"
    '';
  
    meta = {
      homepage = "https://sonic-pi.net/";
      description = "Free live coding synth for everyone originally designed to support computing and music lessons within schools";
      license = lib.licenses.mit;
      maintainers = with lib.maintainers; [ Phlogistique kamilchm c0deaddict ];
      platforms = lib.platforms.linux;
    };
  }
  
negative.code:     aubio
      supercollider_single_prec
      boost
      erlang
      alsa-lib
      rtmidi
    ];
  
    dontUseCmakeConfigure = true;
  
    prePatch = ''
      sed -i '/aubio/d' app/external/linux_build_externals.sh
      sed -i '/aubio/d' app/linux-prebuild.sh
      patchShebangs app
    '';
  
    configurePhase = ''
      runHook preConfigure
  
      ./app/linux-prebuild.sh
      ./app/linux-config.sh
  
      runHook postConfigure
    '';
  
    buildPhase = ''
      runHook preBuild
  
      pushd app/build
      cmake --build . --config Release
      popd
  
      runHook postBuild
    '';
  
    installPhase = ''
  