Map MIDI keyboard to certain frequencies

For general discussion related FlowStone
Post Reply
toni_aguirre
Posts: 5
Joined: Sun Sep 29, 2013 3:51 pm

Map MIDI keyboard to certain frequencies

Post by toni_aguirre »

I was wondering, would it be possible to map the midi keyboard to an osc but for different frecuencies than usual?
For example, mapping C1 for a sine playing at 40 Hz (instead of the usual 32,7 Hz), a D1 for 71 Hz and so on. I don't want to transpose the notes (I mean, for example 5 Hz above the usual scale frecuencies) but define it completely different. I don t know much about programming in Flowstone, I just managed to build a tone generator and set manually to the desired frecuencies, but they can't be played with the keyboard
KG_is_back
Posts: 1196
Joined: Tue Oct 22, 2013 5:43 pm
Location: Slovakia

Re: Map MIDI keyboard to certain frequencies

Post by KG_is_back »

What you can do, you can define a midi-map...an float array, where each index is note and value is the frequency for that note. Then use float array to mem prim with wave-read. midi->poly component outputs the pitch, the pitch is used as index for the midi-map, and that frequency is passed to the oscillators.
Attachments
customFreqMapped.fsm
(8.87 KiB) Downloaded 779 times
toni_aguirre
Posts: 5
Joined: Sun Sep 29, 2013 3:51 pm

Re: Map MIDI keyboard to certain frequencies

Post by toni_aguirre »

I managed to do the maping, but I'm having some trouble with a simple button. I tried to put a selector with a button to switch between 2 different MIDI to poly (one has portamento, I found it in the forum). Before I placed the switch, the vst runned perfectly, it produced a frequency dependent on the MIDI key, but when I connect it to the switch, even though the switch path allowes the original MIDI to poly path, it won't produce the desired frequencies any more. This switch is very simple, so I don't know why this is caused. Maybe it is because I splited the MIDI in??
EDIT: by placing a Poly Readout in the pitch output of each midi to poly, it has been aparently solved. However, gliding does not work, any idea of why?
Attachments
new scale.fsm
The issue is just after the MIDI signal splits
(444.51 KiB) Downloaded 805 times
KG_is_back
Posts: 1196
Joined: Tue Oct 22, 2013 5:43 pm
Location: Slovakia

Re: Map MIDI keyboard to certain frequencies

Post by KG_is_back »

It's clearly a bug of the selector. It seems you cannot switch between two different midi-to-poly modules.

Also another thing - the schematic will not react to portamento, because wave read prim (the one that reads frequencies form the table based on pitch) has no interpolation. Search for some wave interpolation modules (I recommend linear interpolation for this task).
Post Reply