If you have a problem or need to report a bug please email : support@dsprobotics.com
There are 3 sections to this support area:
DOWNLOADS: access to product manuals, support files and drivers
HELP & INFORMATION: tutorials and example files for learning or finding pre-made modules for your projects
USER FORUMS: meet with other users and exchange ideas, you can also get help and assistance here
NEW REGISTRATIONS - please contact us if you wish to register on the forum
Users are reminded of the forum rules they sign up to which prohibits any activity that violates any laws including posting material covered by copyright
Fixed length freq per midi-key
4 posts
• Page 1 of 1
Fixed length freq per midi-key
I wanted to have signals that run for a specified time when a note-on event for special keys is recognized. My current solution is filtering the incoming midi and then generate midi notes with Note Event, since I can assign a time value.
The downside is that any new note of the same key overrides the older one, so I also implemented a counter that spits out a new midi note number for each orignial note on event. That's ok, since I only need the start and the time, generating a fixed freqenzy from it.
But I need this construction for each key I use and that seems a bit weird. So I looked for simpler solutions. Midi to Sample isn't sufficient since I don't get a fixed length for each note-on. I also tried dsp code (but that's my weak point). I can easily seperate the keys and send out frequencies on dedicated streamouts, but I don't see how to time those freq. I played around with a counter, but that stopped each signal on a streamout, not just the one that timed out.
Generally, what I'm looking for is a timing system that converts incoming note-ons to to a start-stop-mechanic, where each midi key can be triggered even overlapping without stopping the prior event (up to 32 times), and also for each midi key the start-stop-mechanic can be edited individually in case of duration.
Is my Note Event solution the best I can achieve, or are there any other ideas?
The downside is that any new note of the same key overrides the older one, so I also implemented a counter that spits out a new midi note number for each orignial note on event. That's ok, since I only need the start and the time, generating a fixed freqenzy from it.
But I need this construction for each key I use and that seems a bit weird. So I looked for simpler solutions. Midi to Sample isn't sufficient since I don't get a fixed length for each note-on. I also tried dsp code (but that's my weak point). I can easily seperate the keys and send out frequencies on dedicated streamouts, but I don't see how to time those freq. I played around with a counter, but that stopped each signal on a streamout, not just the one that timed out.
Generally, what I'm looking for is a timing system that converts incoming note-ons to to a start-stop-mechanic, where each midi key can be triggered even overlapping without stopping the prior event (up to 32 times), and also for each midi key the start-stop-mechanic can be edited individually in case of duration.
Is my Note Event solution the best I can achieve, or are there any other ideas?
"There lies the dog buried" (German saying translated literally)
- tulamide
- Posts: 2714
- Joined: Sat Jun 21, 2014 2:48 pm
- Location: Germany
Re: Fixed length freq per midi-key
the length must be different for each midi key?
you can do it in polyphonic, with a simple envelope hold,
it is less easy to manage the length per midi-key,
but you could use a LUT table witch have the hold value per midi-key,
using the midi key value as index to pass the hold value to the envelope.
you can do it in polyphonic, with a simple envelope hold,
it is less easy to manage the length per midi-key,
but you could use a LUT table witch have the hold value per midi-key,
using the midi key value as index to pass the hold value to the envelope.
- Tronic
- Posts: 539
- Joined: Wed Dec 21, 2011 12:59 pm
Re: Fixed length freq per midi-key
Is this what you are looking for?
I borrowed the bar editor form additive osc - output is in 0-1 range. then I multiply it by general scale factor (samplerate*maxtime in seconds) output is an array with lengths in samples. Then I convert it to mem and read it, using midi pitch as an index. Length is send to counter, which outputs TRUE if length gets exceeded and that kills the voice using envelope primitive.
If you what to prolong the voice on retriggering rather than starting new one, that is a little bit more complicated. You will need to use the "memin hack" Trog and I were working on. Basically what you need to do is create two table mems (I recommend trogs ASM shared mem) one to store boolean whether the key is on and other to store boolean bursts for counter resets. Each voice when triggered first checks key boolean. If false, then plays as normal. If true, kills itself immediately and sets boolean burst true. The playing voice will be checking the boolean burst on start of every sample. If it finds it true, then sets it false and resets the counter to 0.
I borrowed the bar editor form additive osc - output is in 0-1 range. then I multiply it by general scale factor (samplerate*maxtime in seconds) output is an array with lengths in samples. Then I convert it to mem and read it, using midi pitch as an index. Length is send to counter, which outputs TRUE if length gets exceeded and that kills the voice using envelope primitive.
If you what to prolong the voice on retriggering rather than starting new one, that is a little bit more complicated. You will need to use the "memin hack" Trog and I were working on. Basically what you need to do is create two table mems (I recommend trogs ASM shared mem) one to store boolean whether the key is on and other to store boolean bursts for counter resets. Each voice when triggered first checks key boolean. If false, then plays as normal. If true, kills itself immediately and sets boolean burst true. The playing voice will be checking the boolean burst on start of every sample. If it finds it true, then sets it false and resets the counter to 0.
- Attachments
-
- FixedTime.fsm
- (12.2 KiB) Downloaded 740 times
- KG_is_back
- Posts: 1196
- Joined: Tue Oct 22, 2013 5:43 pm
- Location: Slovakia
Re: Fixed length freq per midi-key
Thank you both! That gives me a new approach. I didn't think of controlling the time by envelope hold in the poly section.
KG_is_back if you don't mind, I will use your example as a starting base for my (possible) solution. It is very close to what I'm looking for, but not quite, since the 'Wave Read makes the duration still dependant on the played key (higher keys play shorter, lower keys longer). But I think I know how to overcome this issue.
KG_is_back if you don't mind, I will use your example as a starting base for my (possible) solution. It is very close to what I'm looking for, but not quite, since the 'Wave Read makes the duration still dependant on the played key (higher keys play shorter, lower keys longer). But I think I know how to overcome this issue.
"There lies the dog buried" (German saying translated literally)
- tulamide
- Posts: 2714
- Joined: Sat Jun 21, 2014 2:48 pm
- Location: Germany
4 posts
• Page 1 of 1
Who is online
Users browsing this forum: No registered users and 54 guests