Skip to content

Commit

Permalink
Merge branch 'master' of https://github.com/jesusvallejo/Midi2Vol
Browse files Browse the repository at this point in the history
  • Loading branch information
jesusvallejo committed Oct 10, 2021
2 parents f3703e0 + 1cead85 commit ef86518
Show file tree
Hide file tree
Showing 2 changed files with 34 additions and 73 deletions.
43 changes: 20 additions & 23 deletions README-es.md
Expand Up @@ -11,37 +11,34 @@ Control de Volumen de Windows® para Nano. Slider -- [Linux](https://github.com/



Este proyecto esta desarrollado en principio para Nano. Slider, sin embargo debería ser realmente sencillo crear una versión para cualquier pontenciometro que funcione via MIDI.
Esta aplicacion funciona solo en Windows® y en consecuencia no funcionará en ninguna otra plataforma, esto se debe a que ha sido escrita especificamente en C# para poder controlar el volumen del equipo.
Este proyecto esta desarrollado en principio para [Nano. Slider](https://www.keebwerk.com/nano-slider/), sin embargo debería ser realmente sencillo crear una versión para cualquier pontenciómetro que funcione via MIDI.
Esta aplicación funciona solo en Windows®([Version para Linux](https://github.com/jesusvallejo/Midi2Vol-Linux)).

La aplicación se ejecuta en la bandeja de iconos para ser menos intrusiva, por el momento las únicas opciones son Exit(para cerrar la aplicación) y Add/remove the StartUp run(para añadir o eliminar la ejecución durante el encendido).
Durante la instalacion la aplicacion sera añadida para su ejecución durante el encendido por defecto, en caso de no querer que esto ocurra podra eliminarla facilmente con la opcion Add/remove the StartUp run.
La aplicación se ejecuta en la bandeja de iconos para ser menos intrusiva.

Existen tres versiones de la aplicación, las tres vesiones son exactamente iguales a excepción del icono mostrado, de modo que la aplicación se puede parecer a tu Nano. Slider.
Esta versión tiene control de volumen para aplicaciones(Usa el mixer de windows y puede controlar el volumen de aplicaciones como Spotify o Google Chrome) y dispositivos(Además puede controlar el volumen del dispositivo del sistema que reproduce sonido en ese momento, auriculares, altavoces).

Se incluye un binario para su instalación, sin embargo recomiendo que lo compiles tu mismo.
Se provee tal cual esta , y carece de cualquier garantia.(ver [Licencia](https://raw.githubusercontent.com/jesusvallejo/Midi2Vol/master/LICENSE))
Estos ajustes se pueden modificar usando el botón config o editando el archivo config.json(se encuentra en el directorio
```\user\AppData\midi2vol\```, se recomienda usar el menu para evitar problemas de parsing en el archivo).

Para que este software funcione jundo con el Nano. Slider tendrás que añadir unas lineas de codigo a tu keymap, o usar este: https://github.com/jesusvallejo/nanokeymaps/ (Incluye el .hex compilado para facilitar el flasheo y probar las funciones del software)

Se incluyen [binarios ](https://github.com/jesusvallejo/Midi2Vol/releases) para su instalación, sin embargo recomiendo que lo compiles tu mismo.
Los binarios vienen sin firmar ya que el certificado cuesta anualmente.

Se provee tal cual está , y carece de cualquier tipo de garantía.(ver [Licencia](https://raw.githubusercontent.com/jesusvallejo/Midi2Vol/master/LICENSE))

Siempre se agradece cualquier mejora o propuesta.

Este projecto usa las siguientes librerias:
Este projecto usa las siguientes librerías:

- ~~AudioSwitcher.AudioApi.CoreAudio : https://github.com/xenolightning/AudioSwitcher~~
En desuso, ahora usa NAudio, AudioSwitcher inicializaba muy lento
Midi handling:
- NAudio: https://github.com/naudio/NAudio

Volume handling:
- CSCore: https://github.com/filoe/cscore

TODO
- [x] Update code to better integrate official name: Midi2Vol
- [x] Msi installer
- [x] Edition Icon
- [x] Separate classes into multiple files to improve readability
- [x] Add auto launch on boot
- [x] Add menu to Apply/Remove auto launch on boot
- [x] Add Hot-Plug support
- [x] Solved Bug: wont work after sleep mode
- ~~[ ] One Msi installer, multiple icons that can be selected to fit any Nano. Slider appearance~~ Deprecated
- [ ] Ask on install , whether to run on Startup or not
- [x] Set proper public/private flags to code
- [x] Test stability
- [ ] Allow control when changing audio output Devices
- [ ] Check wether the AppRaw input in config menu is an hex.
- [ ] Make it easier for user to change app icons.(not sure if possible)
- [ ] Check .json parsing errors
64 changes: 14 additions & 50 deletions README.md
Expand Up @@ -11,55 +11,19 @@ English | [Español](./README-es.md)

Windows® Volume Control for Nano. Slider -- [Linux](https://github.com/jesusvallejo/Midi2Vol-Linux)

This is mainly developed for Nano. Slider, but it can be fairly easily used with any Midi based potentiometer.
It is written only for Windows® and wont work on any other plataform as it has to be written in OS compatible language (C# in this case with .net framework).

The app lives in the tray in order to be less intrusive, for the moment the only options are to exit the app and to Add/remove the StartUp run.

This version has per app volume control as well as current device volume control, it can be configured via the config menu button or editing config.json,to add/edit more apps.In order to make ti work we have to change some things on the qmk keymap,instancitate an app variable as 0x3E,``` uint8_t app = 0x3E; ``` , on slider function we have to change midi_send_cc to ```midi_send_cc(&midi_device, 2, app, 0x7F - (analogReadPin(SLIDER_PIN) >> 3));``` and last use the macro utility to change ``` app ``` value to what ever is configured in the config.json

ex:
```
uint8_t app = 0x3E;
// Defines the keycodes used by our macros in process_record_user
enum custom_keycodes {
QMKBEST = SAFE_RANGE,
SPOTIFY,DISCORD
};
bool process_record_user(uint16_t keycode, keyrecord_t *record) {
switch (keycode) {
case SPOTIFY:
if (record->event.pressed) {
// when keycode SPOTIFY is pressed
app= 0x3F;
} else {
app= 0x3E;
// when keycode SPOTIFY is released
}
break;
case DISCORD:
if (record->event.pressed) {
// when keycode SPOTIFY is pressed
app= 0x40;
} else {
app= 0x3E;
// when keycode SPOTIFY is released
}
break;
}
return true;
}
void slider(void) {
if (divisor++) { // only run the slider function 1/256 times it's called
return;
}
midi_send_cc(&midi_device, 2, app, 0x7F - (analogReadPin(SLIDER_PIN) >> 3));
}
```

I'll provice a binary files but i recommend you to compile it by yourself.
This is mainly developed for [Nano. Slider](https://www.keebwerk.com/nano-slider/), but it coul be fairly easily ported to any Midi based potentiometer.
It is written only for Windows®([Linux Version](https://github.com/jesusvallejo/Midi2Vol-Linux)).

The app lives in the tray in order to be less intrusive.

This version has per app volume control(Windows mixer, could be Spotify , Google Chrome) as well as current device volume control(Earphones,Speakers), it can be configured via the config menu button or editing config.json,to add/edit more apps.(config.json is under ```\user\AppData\midi2vol```, it is recomended to use the menu configurator to avoid parsing errors).

In order to make it work you will need to add some code to your keymap,or pehaps use the one i provide here: https://github.com/jesusvallejo/nanokeymaps/

Remember to use different hex values. Default volume value is: ```0x3E```.

I'll provide [binary files](https://github.com/jesusvallejo/Midi2Vol/releases) but i recommend you to compile it by yourself.Binaries are unsigned as the certificate costs money per year.

It is provided as is, and it comes with no guarantee.(see [Licence](https://raw.githubusercontent.com/jesusvallejo/Midi2Vol/master/LICENSE))

Nevertheless any change, update or upgrade is welcomed.
Expand All @@ -75,5 +39,5 @@ Volume handling:
TODO
- [ ] Check wether the AppRaw input in config menu is an hex.
- [ ] Make it easier for user to change app icons.(not sure if possible)

- [ ] Check .json parsing errors

0 comments on commit ef86518

Please sign in to comment.