Old 09-20-2019, 11:32 AM   #201
mplay
Human being with feelings
 
Join Date: Jan 2009
Location: Curaçao
Posts: 311
Default

Could droplet have the option to only output one note at the time so when I use a mono synth I can experiment with droplet for melodies. Just thought I'd ask 😄
mplay is offline   Reply With Quote
Old 09-24-2019, 06:12 AM   #202
geraintluff
Human being with feelings
 
geraintluff's Avatar
 
Join Date: Nov 2009
Location: mostly inside my own head
Posts: 328
Default

Quote:
Originally Posted by mplay View Post
Could droplet have the option to only output one note at the time so when I use a mono synth I can experiment with droplet for melodies. Just thought I'd ask 😄
That's an interesting idea. I think it might be more flexible to have a separate "polyphony limit" effect placed after Droplets.

I don't know if one already exists, but here's one I just knocked together. Set it to "1" for monophonic output.



Geraint

Last edited by geraintluff; 09-24-2019 at 06:23 AM.
geraintluff is offline   Reply With Quote
Old 09-24-2019, 06:42 AM   #203
mplay
Human being with feelings
 
Join Date: Jan 2009
Location: Curaçao
Posts: 311
Default

Awesome! It's playing in the background as I'm typing, now all I have to do is wait and I have my hit record
mplay is offline   Reply With Quote
Old 09-24-2019, 11:21 AM   #204
mplay
Human being with feelings
 
Join Date: Jan 2009
Location: Curaçao
Posts: 311
Default

I have to say it's pretty fun, I've modulated the rate, Independence and regularity to slowly change and just have it playing in the background. Like a monkey banging on a typewriter, eventually something nice comes out, lol
mplay is offline   Reply With Quote
Old 12-17-2019, 07:40 AM   #205
GonZ
Human being with feelings
 
Join Date: Oct 2018
Posts: 48
Default

Hi, first of all saying thanks for such awesome plugins!

I've been using ZynAddSubFX for a long time. Since it's a 32 bit "plugin" (in fact it's a bridge from the original software) I'm moving on to PadSynth. I really love how simple and powerfull it is at the same time. But today I've realized that the default generated sample seems to have an issue (I think something zero-crossing related) because a little "click" can be listened in a periodic time.

Could it be fixed?

Thanks for all,
Gonzalo
GonZ is offline   Reply With Quote
Old 02-10-2020, 10:46 AM   #206
dahya
Human being with feelings
 
Join Date: Oct 2019
Posts: 35
Default

Hi Geraint, firstly I think your effects/plugins are amazing, keep up the good work !

I've been trying to get your midi harmony to work, but I'm struggling as there doesn't seem to be much documentation / videos on how to make use of it. I've tried creating my own pattern, but as there are no grid lines for the pitch it's hard to set it so it is the original pitch (or even any other pitch, you have to guess). You may want to think about adding rows/grid lines where the notes can slot in to a particular pitch, so the centre row would be the original for example?

Also I was hoping to do more complex things, for example I could enter a pattern for a bass line but I can't get the note to sustain more than one 'beat' / tick. For example if I wanted a bass line where the first note is a dotted note, I can't get it to 'hold' that first note.

I've posted a request in the forum to find something that does a kind of 'auto accompaniment' like the yamaha/casio keyboards, and where we can create our own patterns:

https://forum.cockos.com/showthread....=1#post2243081

and your 'midi harmony' seems to be nearly what I want, although I am struggling to get it to work for different pattern variations.

Any help on this subject would be appreciated, thanks.
dahya is offline   Reply With Quote
Old 02-11-2020, 09:33 AM   #207
Fingers mcginty
Human being with feelings
 
Join Date: Apr 2019
Posts: 26
Default

Apologies if I've missed it in this thread but I've downloaded the zip file. How to I install the effects so reaper sees them?
Fingers mcginty is offline   Reply With Quote
Old 02-11-2020, 09:45 AM   #208
dahya
Human being with feelings
 
Join Date: Oct 2019
Posts: 35
Default

Quote:
Originally Posted by Fingers mcginty View Post
Apologies if I've missed it in this thread but I've downloaded the zip file. How to I install the effects so reaper sees them?

Check the top of this page:

https://geraintluff.github.io/jsfx/
dahya is offline   Reply With Quote
Old 02-11-2020, 11:30 AM   #209
Fingers mcginty
Human being with feelings
 
Join Date: Apr 2019
Posts: 26
Default

Could you be a bit more specific? I need to know where to place the files in my windows based system.
Fingers mcginty is offline   Reply With Quote
Old 02-11-2020, 01:15 PM   #210
Fingers mcginty
Human being with feelings
 
Join Date: Apr 2019
Posts: 26
Default

Never mind ...I got it sorted
Fingers mcginty is offline   Reply With Quote
Old 02-12-2020, 03:36 AM   #211
geraintluff
Human being with feelings
 
geraintluff's Avatar
 
Join Date: Nov 2009
Location: mostly inside my own head
Posts: 328
Default

Quote:
Originally Posted by GonZ View Post
I'm moving on to PadSynth. [...] the default generated sample seems to have an issue (I think something zero-crossing related) because a little "click" can be listened in a periodic time.
That's odd. I don't get that - could you send me a rendered version? (Email's in my profile.)
geraintluff is offline   Reply With Quote
Old 02-12-2020, 04:44 AM   #212
geraintluff
Human being with feelings
 
geraintluff's Avatar
 
Join Date: Nov 2009
Location: mostly inside my own head
Posts: 328
Default

Quote:
Originally Posted by dahya View Post
I've been trying to get your midi harmony to work, but I'm struggling as there doesn't seem to be much documentation / videos on how to make use of it. I've tried creating my own pattern, but as there are no grid lines for the pitch it's hard to set it so it is the original pitch (or even any other pitch, you have to guess).
Yeah, I didn't get around to making a video for this - sorry for that.

The pitch sequence isn't relative, it's absolute (similar to Droplets). The sequence uses the centre and a range to select a target note/range, and then it rounds that to the nearest "allowed" note. In the display at the top, you can see the "allowed" notes in grey, and the active notes in orange.

So if your range is set to "C4 / 12st", then the pattern will produce target notes will be in the range C3-C5. It then approximates these notes as best it can, using the allowed notes from the input.

Quote:
Originally Posted by dahya View Post
Also I was hoping to do more complex things, for example I could enter a pattern for a bass line but I can't get the note to sustain more than one 'beat' / tick. For example if I wanted a bass line where the first note is a dotted note, I can't get it to 'hold' that first note.
Ah yeah - that would be cool. Instead of having pitch/vel, it would be neat to be able to specify some time-steps as "sustain".

What you could try is the "MIDI" option for Target. Basically, instead of relying on the in-built sequence, you specify your own sequence using a different MIDI channel (16 by default). This lets you put any pattern you like in there, and change them over time etc.

I just recorded a (quite rough!) demo for you, to illustrate how that can work: https://youtu.be/emfZvlxiJkU - apologies for the very loud mouse-clicks.



I forgot to say in the video, but one important detail is that if two notes in the "target" input are back-to-back but end up rounding to the same output note, then it will just continue that note. So, if you need them to be separate, you have to leave a bit of space at the end of each note.

Geraint

Last edited by geraintluff; 02-12-2020 at 06:30 AM.
geraintluff is offline   Reply With Quote
Old 02-12-2020, 04:50 AM   #213
dahya
Human being with feelings
 
Join Date: Oct 2019
Posts: 35
Default

Wow, that's great, thanks for that GeraintLuff, I was actually going to ask you about using a midi input for the sequences instead ! I'll take a look at this later today and see how it goes, and thanks for taking the time out to do the video too, much appreciated.
dahya is offline   Reply With Quote
Old 02-12-2020, 09:49 AM   #214
dahya
Human being with feelings
 
Join Date: Oct 2019
Posts: 35
Default

Quote:
Originally Posted by geraintluff View Post
What you could try is the "MIDI" option for Target. Basically, instead of relying on the in-built sequence, you specify your own sequence using a different MIDI channel (16 by default). This lets you put any pattern you like in there, and change them over time etc.

I just recorded a (quite rough!) demo for you, to illustrate how that can work: https://youtu.be/emfZvlxiJkU - apologies for the very loud mouse-clicks.



I forgot to say in the video, but one important detail is that if two notes in the "target" input are back-to-back but end up rounding to the same output note, then it will just continue that note. So, if you need them to be separate, you have to leave a bit of space at the end of each note.

Geraint

Hi Geraint, many thanks for producing the video, however I don't think I've been able to replicate what you're doing in the video properly yet. From what I can understand, the set up you have in the video is as follows (please correct me where I am wrong):

Track Contents:
Track 1 - Synth
Track 2 - MIDI Harmony plugin
Track 3 - 'Allowed Chords'
Track 4 - 'Target Sequence'

Track Routing:
Track 4 ('Target Sequence') on MIDI Channel 16 --> Track 2 (MIDI Harmony plugin )
Track 3 ('Allowed Chords') on MIDI Channel 1 --> Track 1 (Synth)
Track 2 (MIDI Harmony plugin) on all MIDI Channels --> Track 1 (Synth)

MIDI Harmony Plug Set up:
Target = MIDI
Control Channel = Channel 16

Have I got this routing correct? I'm not sure where Track 3 ('Allowed Chords') should be routed to?

Thanks for your assistance.

Dahya
dahya is offline   Reply With Quote
Old 02-13-2020, 01:42 AM   #215
geraintluff
Human being with feelings
 
geraintluff's Avatar
 
Join Date: Nov 2009
Location: mostly inside my own head
Posts: 328
Default

Quote:
Originally Posted by dahya View Post
Track Routing:
Track 4 ('Target Sequence') on MIDI Channel 16 --> Track 2 (MIDI Harmony plugin )
Track 3 ('Allowed Chords') on MIDI Channel 1 --> Track 1 (Synth)
Track 2 (MIDI Harmony plugin) on all MIDI Channels --> Track 1 (Synth)
Ah, there's your issue. The Allowed Chords also needs to be sent to MIDI Harmony. Without that, I expect MIDI Harmony will output nothing, and the synth will be playing the chords you sent it directly.

Here's the example project from the video: https://stash.reaper.fm/v/38293/MIDI...ny%20demo2.RPP. I tend to use implicit routing using nested-tracks, because I find it easier. The only tricky bit is the "target sequence" track, which has its "send to parent" disabled.

A more compact version (which represents how I actually use it) is here: https://stash.reaper.fm/v/38295/MIDI...%20compact.RPP - in this one, the "allowed chords" are on the main track itself (which contains both MIDI Harmony and the synth. It uses this very simple "MIDI Channel Cast" effect to move the "target sequence" to channel 16 without any weird routing.

Regardless of how it's arranged, this should be the overall pattern:
  • Allowed Chords -> MIDI Harmony, on channel 1
  • Target Sequence -> MIDI Harmony, on channel 16
  • MIDI Harmony -> synth

Sorry for the fuss, and lack of video - MIDI Harmony isn't my most polished effect, so I appreciate you putting it through its paces!

Geraint
geraintluff is offline   Reply With Quote
Old 02-13-2020, 03:58 PM   #216
dahya
Human being with feelings
 
Join Date: Oct 2019
Posts: 35
Default

Ok, so I've tried the demo2 project and that works fine, thanks. Also tried the Compact version project, and I get no sound - there's midi data being input and output, but no sound. If I add a different synth (and disable the Humonica) then that works.

So I think I get the idea of the routing now, and I think I can get it to work, but it seems that there's more to it than that. For example, trying to use a bass pattern as the 'target sequence', and I noticed that it only seems to work properly if I set the 'Shift' to 'Up Only'. Whereas if I have chords in the 'target sequence', then 'Shift' = up/down works better.

Also, sometimes a particular chord in a sequence (from the 'Allowed Chords') becomes the same chord as the previous one, eg if the sequence is C, Am, G, it seems to produce C, C, G....I don't know why..?

I think what we need is some explanations of what each control is supposed to do, and what the plugin is trying to do, so we know what to expect and if it works as expected.

I kind of like the idea of the plugin, but I'm struggling to get it work as I think it should work...
dahya is offline   Reply With Quote
Old 02-17-2020, 09:10 AM   #217
Ozman
Human being with feelings
 
Join Date: Feb 2015
Posts: 634
Default

That MIDI Harmony plugin will be quite useful.
It kinda reminds me of Bitwig's Harmony Tool, but better.

Ozman is offline   Reply With Quote
Old 02-17-2020, 11:50 AM   #218
TonE
Human being with feelings
 
Join Date: Feb 2009
Location: Reaper HAS send control via midi !!!
Posts: 2,300
Default

Midi Harmony, sounds great, thanks for sharing, how is the difference to midi vocoder? If there should be any significant difference, one can imagine what will be the result of midi harmony + midi vocoder then?
TonE is offline   Reply With Quote
Old 02-17-2020, 11:58 AM   #219
TonE
Human being with feelings
 
Join Date: Feb 2009
Location: Reaper HAS send control via midi !!!
Posts: 2,300
Default

Quote:
Originally Posted by geraintluff View Post
Here's the example project from the video: https://stash.reaper.fm/v/38293/MIDI...ny%20demo2.RPP. I tend to use implicit routing using nested-tracks, because I find it easier. The only tricky bit is the "target sequence" track, which has its "send to parent" disabled.
I also prefer nested track style, I should say mega nested , that is why I created folderify. This is kind of a hack for achieving modular routing to some degree, and you can record each routing point as midi or audio, if you want.

https://www.youtube.com/watch?v=8Jbod_BCw5k
TonE is offline   Reply With Quote
Old 03-24-2020, 09:40 PM   #220
pingosimon
Human being with feelings
 
Join Date: Nov 2018
Posts: 43
Default

Hey, Geraint! How difficult would it be to make a more customizable version of Piano Display?

I'd LOVE to be able to cut off a couple octaves from the left and right side of the keyboard. In other words, zoom in on the part of the keyboard that I'm using. I poked around in the JSFX file myself, but found that the highlighted keys didn't follow my edits to the keyboard

Some other cool features:
- disable note name labels, and labels for each C octave
- slow down the note scroll speed
- change colors


I'd gladly donate, even for just the keyboard resize function!
pingosimon is offline   Reply With Quote
Old 03-24-2020, 10:57 PM   #221
TonE
Human being with feelings
 
Join Date: Feb 2009
Location: Reaper HAS send control via midi !!!
Posts: 2,300
Default

Quote:
Originally Posted by pingosimon View Post
I'd gladly donate, even for just the keyboard resize function!
This should be easy just by replacing some hard values with variables which any user could set somewhere, at the top usually.

You could replace all
127 with n * 12 - 1
128 with n * 12

and defining n = 5, at the top if you want only 5 octaves. For other octaves accordingly.

Here a quick test.
PHP Code:
desc:Piano Display (by Geraint Luff)

in_pin:none
out_pin
:none

import ui
-lib.jsfx-inc
import piano
-ui.jsfx-inc
import synth
-framework-obj.jsfx-inc

@init

freemem 
0;
freemem ui_setup(freemem);
freemem synth_setup(freemem);
synth_setup_each(synth1);
synth_setup_each(synth2);
synth_setup_each(synth3);
synth_setup_each(synth4);
synth_setup_each(synth5);
synth_setup_each(synth6);
synth_setup_each(synth7);
synth_setup_each(synth8);
synth_setup_each(synth9);
synth_setup_each(synth10);
synth_setup_each(synth11);
synth_setup_each(synth12);
synth_setup_each(synth13);
synth_setup_each(synth14);
synth_setup_each(synth15);
synth_setup_each(synth16);

attack_samples 0.01*srate;
release_samples 0.01*srate;

@
block

synth_block
();
synth_block_each(synth1)
&& 
synth_block_each(synth2)
&& 
synth_block_each(synth3)
&& 
synth_block_each(synth4)
&& 
synth_block_each(synth5)
&& 
synth_block_each(synth6)
&& 
synth_block_each(synth7)
&& 
synth_block_each(synth8)
&& 
synth_block_each(synth9)
&& 
synth_block_each(synth10)
&& 
synth_block_each(synth11)
&& 
synth_block_each(synth12)
&& 
synth_block_each(synth13)
&& 
synth_block_each(synth14)
&& 
synth_block_each(synth15)
&& 
synth_block_each(synth16);

@
sample

function process_note(note*) (
    
synth_sample_each(note) ? (
        
synth_release(note) >= ? (
            
synth_stop(note);
        );
    );
    
synth_continue(note);
);

process_note(synth1)
&& 
process_note(synth2)
&& 
process_note(synth3)
&& 
process_note(synth4)
&& 
process_note(synth5)
&& 
process_note(synth6)
&& 
process_note(synth7)
&& 
process_note(synth8)
&& 
process_note(synth9)
&& 
process_note(synth10)
&& 
process_note(synth11)
&& 
process_note(synth12)
&& 
process_note(synth13)
&& 
process_note(synth14)
&& 
process_note(synth15)
&& 
process_note(synth16);

@
gfx 1168 170

5;
PIANO_ROLL_SCREEN 1;
PIANO_ROLL_PERIOD 1;
ui_reserve_image(PIANO_ROLL_SCREEN);

function 
set_colour(note*) (
    
ui_color(255*synth_velocity(note)/(n*12-1), 255*(synth_velocity(note)/(n*12-1)), 255);
);

function 
draw_note(note*) (
    
synth_on(note) ? (
        
set_colour(note);
        
piano_fill_key(synth_midinote(note), 0, (n*12-1));
        
piano_push_key(synth_midinote(note), 0, (n*12-1));
            
ui_color(000);
            
piano_key_name(#note, synth_midinote(note));
            
ui_text(#note);
        
ui_pop();
    );
    
synth_continue(note);
);

function 
draw_roll_note(note*, g_wg_hpixelslocal(left) (
    
synth_on(note) ? (
        
set_colour(note);
        
left g_w*synth_midinote(note)/(n*12) + 0.5;
        
gfx_rect(leftg_h pixelsg_w/(n*12), pixels);
    );
    
synth_continue(note);
);

ui_start("main");
ui_screen() === "main" ? (
    
ui_split_bottom(ui_width()*0.0728);
    
piano_draw(0, (n*12-1));

        
draw_note(synth1)
        && 
draw_note(synth2)
        && 
draw_note(synth3)
        && 
draw_note(synth4)
        && 
draw_note(synth5)
        && 
draw_note(synth6)
        && 
draw_note(synth7)
        && 
draw_note(synth8)
        && 
draw_note(synth9)
        && 
draw_note(synth10)
        && 
draw_note(synth11)
        && 
draw_note(synth12)
        && 
draw_note(synth13)
        && 
draw_note(synth14)
        && 
draw_note(synth15)
        && 
draw_note(synth16);
    
ui_pop();

    
gfx_dest PIANO_ROLL_SCREEN;
    
gfx_getimgdim(PIANO_ROLL_SCREENg_wg_h);
    
g_w != ui_width() || g_h != ui_height() ? (
        
gfx_setimgdim(PIANO_ROLL_SCREENg_w ui_width(), g_h ui_height());
        
gfx_r gfx_g gfx_b 0;
        
gfx_a 1;
        
gfx_rect(00g_wg_h);
    );

    
g_t time_precise();
    
g_dt g_t g_t_old;
    
g_t_old g_t;
    
pixels ceil(g_dt/PIANO_ROLL_PERIOD*g_h);
    
gfx_blit(PIANO_ROLL_SCREEN100pixelsg_wg_h pixels00g_wg_h pixels);
    
gfx_r gfx_g gfx_b 0;
    
gfx_rect(0g_h pixelsg_wpixels);

    
draw_roll_note(synth1g_wg_hpixels)
    && 
draw_roll_note(synth2g_wg_hpixels)
    && 
draw_roll_note(synth3g_wg_hpixels)
    && 
draw_roll_note(synth4g_wg_hpixels)
    && 
draw_roll_note(synth5g_wg_hpixels)
    && 
draw_roll_note(synth6g_wg_hpixels)
    && 
draw_roll_note(synth7g_wg_hpixels)
    && 
draw_roll_note(synth8g_wg_hpixels)
    && 
draw_roll_note(synth9g_wg_hpixels)
    && 
draw_roll_note(synth10g_wg_hpixels)
    && 
draw_roll_note(synth11g_wg_hpixels)
    && 
draw_roll_note(synth12g_wg_hpixels)
    && 
draw_roll_note(synth13g_wg_hpixels)
    && 
draw_roll_note(synth14g_wg_hpixels)
    && 
draw_roll_note(synth15g_wg_hpixels)
    && 
draw_roll_note(synth16g_wg_hpixels);

    
gfx_dest = -1;
    
gfx_blit(PIANO_ROLL_SCREEN1000g_wg_hui_left(), ui_top());
    
control_finish_technical();
    
ui_color(2552552550.3);
    
ui_border();
); 
You might also want some additional shifting.
TonE is offline   Reply With Quote
Old 03-24-2020, 11:14 PM   #222
TonE
Human being with feelings
 
Join Date: Feb 2009
Location: Reaper HAS send control via midi !!!
Posts: 2,300
Default

Quote:
Originally Posted by pingosimon View Post
- slow down the note scroll speed
I divided pixels by 10, 10 times slower, adjust to your taste.

PHP Code:
pixels ceil(g_dt/PIANO_ROLL_PERIOD*g_h/10); 
TonE is offline   Reply With Quote
Old 03-25-2020, 04:35 PM   #223
pingosimon
Human being with feelings
 
Join Date: Nov 2018
Posts: 43
Default

Awesome! Can I tip you a few bucks?

Here's my edit.
- Replaced some "0" with "24" to start the keyboard at C1 instead of C-1.
- Removed the note name on key press. (Still can't figure out how to remove all the "C" labels)
- Made the keyboard a bit taller by editing this part:
PHP Code:
ui_screen() === "main" ? (
    
ui_split_bottom(ui_width()*0.15); 
-Watch out, your replacement of all "255" with "n*12-1" edited the colors, too! So I changed them back. (Some knobs for this would be cool!)
PHP Code:
function set_colour(note*) (
  
ui_color(255*synth_velocity(note)/127255*(synth_velocity(note)/127), 255);
); 


One problem: the scrolling notes are not aligned to the keys now. I can't find that setting...


PHP Code:
desc:Piano Display (by Geraint Luff)

in_pin:none
out_pin
:none

import ui
-lib.jsfx-inc
import piano
-ui.jsfx-inc
import synth
-framework-obj.jsfx-inc

@init

freemem 
0;
freemem ui_setup(freemem);
freemem synth_setup(freemem);
synth_setup_each(synth1);
synth_setup_each(synth2);
synth_setup_each(synth3);
synth_setup_each(synth4);
synth_setup_each(synth5);
synth_setup_each(synth6);
synth_setup_each(synth7);
synth_setup_each(synth8);
synth_setup_each(synth9);
synth_setup_each(synth10);
synth_setup_each(synth11);
synth_setup_each(synth12);
synth_setup_each(synth13);
synth_setup_each(synth14);
synth_setup_each(synth15);
synth_setup_each(synth16);

attack_samples 0.01*srate;
release_samples 0.01*srate;

@
block

synth_block
();
synth_block_each(synth1)
&& 
synth_block_each(synth2)
&& 
synth_block_each(synth3)
&& 
synth_block_each(synth4)
&& 
synth_block_each(synth5)
&& 
synth_block_each(synth6)
&& 
synth_block_each(synth7)
&& 
synth_block_each(synth8)
&& 
synth_block_each(synth9)
&& 
synth_block_each(synth10)
&& 
synth_block_each(synth11)
&& 
synth_block_each(synth12)
&& 
synth_block_each(synth13)
&& 
synth_block_each(synth14)
&& 
synth_block_each(synth15)
&& 
synth_block_each(synth16);

@
sample

function process_note(note*) (
    
synth_sample_each(note) ? (
        
synth_release(note) >= ? (
            
synth_stop(note);
        );
    );
    
synth_continue(note);
);

process_note(synth1)
&& 
process_note(synth2)
&& 
process_note(synth3)
&& 
process_note(synth4)
&& 
process_note(synth5)
&& 
process_note(synth6)
&& 
process_note(synth7)
&& 
process_note(synth8)
&& 
process_note(synth9)
&& 
process_note(synth10)
&& 
process_note(synth11)
&& 
process_note(synth12)
&& 
process_note(synth13)
&& 
process_note(synth14)
&& 
process_note(synth15)
&& 
process_note(synth16);

@
gfx 1168 170

7;
PIANO_ROLL_SCREEN 1;
PIANO_ROLL_PERIOD 1;
ui_reserve_image(PIANO_ROLL_SCREEN);

function 
set_colour(note*) (
  
ui_color(255*synth_velocity(note)/127255*(synth_velocity(note)/127), 255);
);

function 
draw_note(note*) (
    
synth_on(note) ? (
        
set_colour(note);
        
piano_fill_key(synth_midinote(note), 24, (n*12-1));

    );
    
synth_continue(note);
);

function 
draw_roll_note(note*, g_wg_hpixelslocal(left) (
    
synth_on(note) ? (
        
set_colour(note);
        
left g_w*synth_midinote(note)/(n*12) + 0.5;
        
gfx_rect(leftg_h pixelsg_w/(n*12), pixels);
    );
    
synth_continue(note);
);

ui_start("main");
ui_screen() === "main" ? (
    
ui_split_bottom(ui_width()*0.15);
    
piano_draw(24, (n*12-1));

        
draw_note(synth1)
        && 
draw_note(synth2)
        && 
draw_note(synth3)
        && 
draw_note(synth4)
        && 
draw_note(synth5)
        && 
draw_note(synth6)
        && 
draw_note(synth7)
        && 
draw_note(synth8)
        && 
draw_note(synth9)
        && 
draw_note(synth10)
        && 
draw_note(synth11)
        && 
draw_note(synth12)
        && 
draw_note(synth13)
        && 
draw_note(synth14)
        && 
draw_note(synth15)
        && 
draw_note(synth16);
    
ui_pop();

    
gfx_dest PIANO_ROLL_SCREEN;
    
gfx_getimgdim(PIANO_ROLL_SCREENg_wg_h);
    
g_w != ui_width() || g_h != ui_height() ? (
        
gfx_setimgdim(PIANO_ROLL_SCREENg_w ui_width(), g_h ui_height());
        
gfx_r gfx_g gfx_b 0;
        
gfx_a 1;
        
gfx_rect(00g_wg_h);
    );

    
g_t time_precise();
    
g_dt g_t g_t_old;
    
g_t_old g_t;
    
pixels ceil(g_dt/PIANO_ROLL_PERIOD*g_h/7);
    
gfx_blit(PIANO_ROLL_SCREEN100pixelsg_wg_h pixels00g_wg_h pixels);
    
gfx_r gfx_g gfx_b 0;
    
gfx_rect(0g_h pixelsg_wpixels);

    
draw_roll_note(synth1g_wg_hpixels)
    && 
draw_roll_note(synth2g_wg_hpixels)
    && 
draw_roll_note(synth3g_wg_hpixels)
    && 
draw_roll_note(synth4g_wg_hpixels)
    && 
draw_roll_note(synth5g_wg_hpixels)
    && 
draw_roll_note(synth6g_wg_hpixels)
    && 
draw_roll_note(synth7g_wg_hpixels)
    && 
draw_roll_note(synth8g_wg_hpixels)
    && 
draw_roll_note(synth9g_wg_hpixels)
    && 
draw_roll_note(synth10g_wg_hpixels)
    && 
draw_roll_note(synth11g_wg_hpixels)
    && 
draw_roll_note(synth12g_wg_hpixels)
    && 
draw_roll_note(synth13g_wg_hpixels)
    && 
draw_roll_note(synth14g_wg_hpixels)
    && 
draw_roll_note(synth15g_wg_hpixels)
    && 
draw_roll_note(synth16g_wg_hpixels);

    
gfx_dest = -1;
    
gfx_blit(PIANO_ROLL_SCREEN1000g_wg_hui_left(), ui_top());
    
control_finish_technical();
    
ui_color(2552552550.3);
    
ui_border();
); 

Last edited by pingosimon; 03-26-2020 at 04:44 PM.
pingosimon is offline   Reply With Quote
Old 03-26-2020, 12:32 AM   #224
TonE
Human being with feelings
 
Join Date: Feb 2009
Location: Reaper HAS send control via midi !!!
Posts: 2,300
Default

Quote:
Originally Posted by pingosimon View Post
-Watch out, your replacement of all "255" with "n*12-1" edited the colors, too! So I changed them back. (Some knobs for this would be cool!)
Where did I write this?
TonE is offline   Reply With Quote
Old 03-26-2020, 04:45 PM   #225
pingosimon
Human being with feelings
 
Join Date: Nov 2018
Posts: 43
Default

Oh sorry, I meant your replacement of 127

The original plugin has

PHP Code:
function set_colour(note*) (
  
ui_color(255*synth_velocity(note)/127255*(synth_velocity(note)/127), 255);
); 
But your edit had
PHP Code:
 function set_colour(note*) (
    
ui_color(255*synth_velocity(note)/(n*12-1), 255*(synth_velocity(note)/(n*12-1)), 255);
); 

Last edited by pingosimon; 03-26-2020 at 04:57 PM.
pingosimon is offline   Reply With Quote
Old 03-26-2020, 04:58 PM   #226
TonE
Human being with feelings
 
Join Date: Feb 2009
Location: Reaper HAS send control via midi !!!
Posts: 2,300
Default

Yes, but I did not replace 255 anywhere, only 127, as you can see.
TonE is offline   Reply With Quote
Old 03-26-2020, 05:01 PM   #227
TonE
Human being with feelings
 
Join Date: Feb 2009
Location: Reaper HAS send control via midi !!!
Posts: 2,300
Default

Ok, I see, there it needs to stay at 127, you say, ok, could be. Cool you discovered this, I just quickly tried and posted, did not try anything much.
TonE is offline   Reply With Quote
Old 03-26-2020, 05:38 PM   #228
pingosimon
Human being with feelings
 
Join Date: Nov 2018
Posts: 43
Default

No big deal! It still works with n*, the colors just changed a little bit. But since it was unintended, I figured, better to leave it as in the original.
pingosimon is offline   Reply With Quote
Old 03-27-2020, 10:49 AM   #229
TonE
Human being with feelings
 
Join Date: Feb 2009
Location: Reaper HAS send control via midi !!!
Posts: 2,300
Default

Alignment problem you still have? Is your above code your latest version you are using now?
TonE is offline   Reply With Quote
Old 03-27-2020, 10:59 AM   #230
TonE
Human being with feelings
 
Join Date: Feb 2009
Location: Reaper HAS send control via midi !!!
Posts: 2,300
Default

Here my friend, when you shift min, you should also shift max. Now notes aligned again and showing 7 octaves, as you wanted it seems.

PHP Code:
desc:Piano Display (by Geraint Luff)

in_pin:none
out_pin
:none

import ui
-lib.jsfx-inc
import piano
-ui.jsfx-inc
import synth
-framework-obj.jsfx-inc

@init

freemem 
0;
freemem ui_setup(freemem);
freemem synth_setup(freemem);
synth_setup_each(synth1);
synth_setup_each(synth2);
synth_setup_each(synth3);
synth_setup_each(synth4);
synth_setup_each(synth5);
synth_setup_each(synth6);
synth_setup_each(synth7);
synth_setup_each(synth8);
synth_setup_each(synth9);
synth_setup_each(synth10);
synth_setup_each(synth11);
synth_setup_each(synth12);
synth_setup_each(synth13);
synth_setup_each(synth14);
synth_setup_each(synth15);
synth_setup_each(synth16);

attack_samples 0.01*srate;
release_samples 0.01*srate;

@
block

synth_block
();
synth_block_each(synth1)
&& 
synth_block_each(synth2)
&& 
synth_block_each(synth3)
&& 
synth_block_each(synth4)
&& 
synth_block_each(synth5)
&& 
synth_block_each(synth6)
&& 
synth_block_each(synth7)
&& 
synth_block_each(synth8)
&& 
synth_block_each(synth9)
&& 
synth_block_each(synth10)
&& 
synth_block_each(synth11)
&& 
synth_block_each(synth12)
&& 
synth_block_each(synth13)
&& 
synth_block_each(synth14)
&& 
synth_block_each(synth15)
&& 
synth_block_each(synth16);

@
sample

function process_note(note*) (
    
synth_sample_each(note) ? (
        
synth_release(note) >= ? (
            
synth_stop(note);
        );
    );
    
synth_continue(note);
);

process_note(synth1)
&& 
process_note(synth2)
&& 
process_note(synth3)
&& 
process_note(synth4)
&& 
process_note(synth5)
&& 
process_note(synth6)
&& 
process_note(synth7)
&& 
process_note(synth8)
&& 
process_note(synth9)
&& 
process_note(synth10)
&& 
process_note(synth11)
&& 
process_note(synth12)
&& 
process_note(synth13)
&& 
process_note(synth14)
&& 
process_note(synth15)
&& 
process_note(synth16);

@
gfx 1168 170

7;
PIANO_ROLL_SCREEN 1;
PIANO_ROLL_PERIOD 1;
ui_reserve_image(PIANO_ROLL_SCREEN);

function 
set_colour(note*) (
  
ui_color(255*synth_velocity(note)/127255*(synth_velocity(note)/127), 255);
);

function 
draw_note(note*) (
    
synth_on(note) ? (
        
set_colour(note);
        
piano_fill_key(synth_midinote(note), 24, (n*12-1+24));

    );
    
synth_continue(note);
);

function 
draw_roll_note(note*, g_wg_hpixelslocal(left) (
    
synth_on(note) ? (
        
set_colour(note);
        
left g_w*synth_midinote(note)/(n*12) + 0.5;
        
gfx_rect(leftg_h pixelsg_w/(n*12), pixels);
    );
    
synth_continue(note);
);

ui_start("main");
ui_screen() === "main" ? (
    
ui_split_bottom(ui_width()*0.15);
    
piano_draw(24, (n*12-1+24));

        
draw_note(synth1)
        && 
draw_note(synth2)
        && 
draw_note(synth3)
        && 
draw_note(synth4)
        && 
draw_note(synth5)
        && 
draw_note(synth6)
        && 
draw_note(synth7)
        && 
draw_note(synth8)
        && 
draw_note(synth9)
        && 
draw_note(synth10)
        && 
draw_note(synth11)
        && 
draw_note(synth12)
        && 
draw_note(synth13)
        && 
draw_note(synth14)
        && 
draw_note(synth15)
        && 
draw_note(synth16);
    
ui_pop();

    
gfx_dest PIANO_ROLL_SCREEN;
    
gfx_getimgdim(PIANO_ROLL_SCREENg_wg_h);
    
g_w != ui_width() || g_h != ui_height() ? (
        
gfx_setimgdim(PIANO_ROLL_SCREENg_w ui_width(), g_h ui_height());
        
gfx_r gfx_g gfx_b 0;
        
gfx_a 1;
        
gfx_rect(00g_wg_h);
    );

    
g_t time_precise();
    
g_dt g_t g_t_old;
    
g_t_old g_t;
    
pixels ceil(g_dt/PIANO_ROLL_PERIOD*g_h/7);
    
gfx_blit(PIANO_ROLL_SCREEN100pixelsg_wg_h pixels00g_wg_h pixels);
    
gfx_r gfx_g gfx_b 0;
    
gfx_rect(0g_h pixelsg_wpixels);

    
draw_roll_note(synth1g_wg_hpixels)
    && 
draw_roll_note(synth2g_wg_hpixels)
    && 
draw_roll_note(synth3g_wg_hpixels)
    && 
draw_roll_note(synth4g_wg_hpixels)
    && 
draw_roll_note(synth5g_wg_hpixels)
    && 
draw_roll_note(synth6g_wg_hpixels)
    && 
draw_roll_note(synth7g_wg_hpixels)
    && 
draw_roll_note(synth8g_wg_hpixels)
    && 
draw_roll_note(synth9g_wg_hpixels)
    && 
draw_roll_note(synth10g_wg_hpixels)
    && 
draw_roll_note(synth11g_wg_hpixels)
    && 
draw_roll_note(synth12g_wg_hpixels)
    && 
draw_roll_note(synth13g_wg_hpixels)
    && 
draw_roll_note(synth14g_wg_hpixels)
    && 
draw_roll_note(synth15g_wg_hpixels)
    && 
draw_roll_note(synth16g_wg_hpixels);

    
gfx_dest = -1;
    
gfx_blit(PIANO_ROLL_SCREEN1000g_wg_hui_left(), ui_top());
    
control_finish_technical();
    
ui_color(2552552550.3);
    
ui_border();
); 
TonE is offline   Reply With Quote
Old 03-27-2020, 11:16 AM   #231
TonE
Human being with feelings
 
Join Date: Feb 2009
Location: Reaper HAS send control via midi !!!
Posts: 2,300
Default

Quote:
Originally Posted by pingosimon View Post
- Removed the note name on key press. (Still can't figure out how to remove all the "C" labels)
File "piano-ui.jsfx-inc" change line 63 to:
PHP Code:
    format = (octaveKey === 0) ? "" //"C%i" 
We just comment out the printing using //, replacing it with empty String "".
Have fun my friend. No tips necessary, thanks a lot, I count it given, your offer is already more than enough.
TonE is offline   Reply With Quote
Old 03-27-2020, 02:00 PM   #232
pingosimon
Human being with feelings
 
Join Date: Nov 2018
Posts: 43
Default

Thanks, you're awesome! Editing piano-ui worked. I've heard of "commenting out" code before, but never done it. (I should do that with my other note name edit, instead of just deleting it).

Alignment is still off though:
Attached Images
File Type: gif Untitled.gif (24.6 KB, 8 views)

Last edited by pingosimon; 03-27-2020 at 02:18 PM.
pingosimon is offline   Reply With Quote
Old 03-27-2020, 03:23 PM   #233
TonE
Human being with feelings
 
Join Date: Feb 2009
Location: Reaper HAS send control via midi !!!
Posts: 2,300
Default

Alignment finally corrected, hopefully, sorry still for the mistake in it before, I recognized it a bit later, I thought it is already perfect, where it was not.

I modified this line, just for information, put parenthesis and -24.
left = g_w*(synth_midinote(note)-24)/(n*12) + 0.5;

PHP Code:
desc:Piano Display (by Geraint Luff)

in_pin:none
out_pin
:none

import ui
-lib.jsfx-inc
import piano
-ui.jsfx-inc
import synth
-framework-obj.jsfx-inc

@init

freemem 
0;
freemem ui_setup(freemem);
freemem synth_setup(freemem);
synth_setup_each(synth1);
synth_setup_each(synth2);
synth_setup_each(synth3);
synth_setup_each(synth4);
synth_setup_each(synth5);
synth_setup_each(synth6);
synth_setup_each(synth7);
synth_setup_each(synth8);
synth_setup_each(synth9);
synth_setup_each(synth10);
synth_setup_each(synth11);
synth_setup_each(synth12);
synth_setup_each(synth13);
synth_setup_each(synth14);
synth_setup_each(synth15);
synth_setup_each(synth16);

attack_samples 0.01*srate;
release_samples 0.01*srate;

@
block

synth_block
();
synth_block_each(synth1)
&& 
synth_block_each(synth2)
&& 
synth_block_each(synth3)
&& 
synth_block_each(synth4)
&& 
synth_block_each(synth5)
&& 
synth_block_each(synth6)
&& 
synth_block_each(synth7)
&& 
synth_block_each(synth8)
&& 
synth_block_each(synth9)
&& 
synth_block_each(synth10)
&& 
synth_block_each(synth11)
&& 
synth_block_each(synth12)
&& 
synth_block_each(synth13)
&& 
synth_block_each(synth14)
&& 
synth_block_each(synth15)
&& 
synth_block_each(synth16);

@
sample

function process_note(note*) (
    
synth_sample_each(note) ? (
        
synth_release(note) >= ? (
            
synth_stop(note);
        );
    );
    
synth_continue(note);
);

process_note(synth1)
&& 
process_note(synth2)
&& 
process_note(synth3)
&& 
process_note(synth4)
&& 
process_note(synth5)
&& 
process_note(synth6)
&& 
process_note(synth7)
&& 
process_note(synth8)
&& 
process_note(synth9)
&& 
process_note(synth10)
&& 
process_note(synth11)
&& 
process_note(synth12)
&& 
process_note(synth13)
&& 
process_note(synth14)
&& 
process_note(synth15)
&& 
process_note(synth16);

@
gfx 1168 170

7;
PIANO_ROLL_SCREEN 1;
PIANO_ROLL_PERIOD 1;
ui_reserve_image(PIANO_ROLL_SCREEN);

function 
set_colour(note*) (
  
ui_color(255*synth_velocity(note)/127255*(synth_velocity(note)/127), 255);
);

function 
draw_note(note*) (
    
synth_on(note) ? (
        
set_colour(note);
        
piano_fill_key(synth_midinote(note), 24, (n*12-1)+24);

    );
    
synth_continue(note);
);

function 
draw_roll_note(note*, g_wg_hpixelslocal(left) (
    
synth_on(note) ? (
        
set_colour(note);
        
left g_w*(synth_midinote(note)-24)/(n*12) + 0.5;
        
gfx_rect(leftg_h pixelsg_w/(n*12), pixels);
    );
    
synth_continue(note);
);

ui_start("main");
ui_screen() === "main" ? (
    
ui_split_bottom(ui_width()*0.15);
    
piano_draw(0, (n*12-1));

        
draw_note(synth1)
        && 
draw_note(synth2)
        && 
draw_note(synth3)
        && 
draw_note(synth4)
        && 
draw_note(synth5)
        && 
draw_note(synth6)
        && 
draw_note(synth7)
        && 
draw_note(synth8)
        && 
draw_note(synth9)
        && 
draw_note(synth10)
        && 
draw_note(synth11)
        && 
draw_note(synth12)
        && 
draw_note(synth13)
        && 
draw_note(synth14)
        && 
draw_note(synth15)
        && 
draw_note(synth16);
    
ui_pop();

    
gfx_dest PIANO_ROLL_SCREEN;
    
gfx_getimgdim(PIANO_ROLL_SCREENg_wg_h);
    
g_w != ui_width() || g_h != ui_height() ? (
        
gfx_setimgdim(PIANO_ROLL_SCREENg_w ui_width(), g_h ui_height());
        
gfx_r gfx_g gfx_b 0;
        
gfx_a 1;
        
gfx_rect(00g_wg_h);
    );

    
g_t time_precise();
    
g_dt g_t g_t_old;
    
g_t_old g_t;
    
pixels ceil(g_dt/PIANO_ROLL_PERIOD*g_h/7);
    
gfx_blit(PIANO_ROLL_SCREEN100pixelsg_wg_h pixels00g_wg_h pixels);
    
gfx_r gfx_g gfx_b 0;
    
gfx_rect(0g_h pixelsg_wpixels);

    
draw_roll_note(synth1g_wg_hpixels)
    && 
draw_roll_note(synth2g_wg_hpixels)
    && 
draw_roll_note(synth3g_wg_hpixels)
    && 
draw_roll_note(synth4g_wg_hpixels)
    && 
draw_roll_note(synth5g_wg_hpixels)
    && 
draw_roll_note(synth6g_wg_hpixels)
    && 
draw_roll_note(synth7g_wg_hpixels)
    && 
draw_roll_note(synth8g_wg_hpixels)
    && 
draw_roll_note(synth9g_wg_hpixels)
    && 
draw_roll_note(synth10g_wg_hpixels)
    && 
draw_roll_note(synth11g_wg_hpixels)
    && 
draw_roll_note(synth12g_wg_hpixels)
    && 
draw_roll_note(synth13g_wg_hpixels)
    && 
draw_roll_note(synth14g_wg_hpixels)
    && 
draw_roll_note(synth15g_wg_hpixels)
    && 
draw_roll_note(synth16g_wg_hpixels);

    
gfx_dest = -1;
    
gfx_blit(PIANO_ROLL_SCREEN1000g_wg_hui_left(), ui_top());
    
control_finish_technical();
    
ui_color(2552552550.3);
    
ui_border();
); 

Last edited by TonE; 03-27-2020 at 03:35 PM.
TonE is offline   Reply With Quote
Old 03-27-2020, 05:03 PM   #234
pingosimon
Human being with feelings
 
Join Date: Nov 2018
Posts: 43
Default

Yeah, there it is! thanks so much!

For anyone else reading, here's "Piano Display Small"

PHP Code:
desc:Piano Display (by Geraint Luff)

in_pin:none
out_pin
:none

import ui
-lib.jsfx-inc
import piano
-ui.jsfx-inc
import synth
-framework-obj.jsfx-inc

@init

freemem 
0;
freemem ui_setup(freemem);
freemem synth_setup(freemem);
synth_setup_each(synth1);
synth_setup_each(synth2);
synth_setup_each(synth3);
synth_setup_each(synth4);
synth_setup_each(synth5);
synth_setup_each(synth6);
synth_setup_each(synth7);
synth_setup_each(synth8);
synth_setup_each(synth9);
synth_setup_each(synth10);
synth_setup_each(synth11);
synth_setup_each(synth12);
synth_setup_each(synth13);
synth_setup_each(synth14);
synth_setup_each(synth15);
synth_setup_each(synth16);

attack_samples 0.01*srate;
release_samples 0.01*srate;

@
block

synth_block
();
synth_block_each(synth1)
&& 
synth_block_each(synth2)
&& 
synth_block_each(synth3)
&& 
synth_block_each(synth4)
&& 
synth_block_each(synth5)
&& 
synth_block_each(synth6)
&& 
synth_block_each(synth7)
&& 
synth_block_each(synth8)
&& 
synth_block_each(synth9)
&& 
synth_block_each(synth10)
&& 
synth_block_each(synth11)
&& 
synth_block_each(synth12)
&& 
synth_block_each(synth13)
&& 
synth_block_each(synth14)
&& 
synth_block_each(synth15)
&& 
synth_block_each(synth16);

@
sample

function process_note(note*) (
    
synth_sample_each(note) ? (
        
synth_release(note) >= ? (
            
synth_stop(note);
        );
    );
    
synth_continue(note);
);

process_note(synth1)
&& 
process_note(synth2)
&& 
process_note(synth3)
&& 
process_note(synth4)
&& 
process_note(synth5)
&& 
process_note(synth6)
&& 
process_note(synth7)
&& 
process_note(synth8)
&& 
process_note(synth9)
&& 
process_note(synth10)
&& 
process_note(synth11)
&& 
process_note(synth12)
&& 
process_note(synth13)
&& 
process_note(synth14)
&& 
process_note(synth15)
&& 
process_note(synth16);

@
gfx 1168 170

4;
PIANO_ROLL_SCREEN 1;
PIANO_ROLL_PERIOD 1;
ui_reserve_image(PIANO_ROLL_SCREEN);

function 
set_colour(note*) (
  
ui_color(255*synth_velocity(note)/127255*(synth_velocity(note)/127), 255);
);

function 
draw_note(note*) (
    
synth_on(note) ? (
        
set_colour(note);
        
piano_fill_key(synth_midinote(note), 36, (n*12-1)+36);

    );
    
synth_continue(note);
);

function 
draw_roll_note(note*, g_wg_hpixelslocal(left) (
    
synth_on(note) ? (
        
set_colour(note);
        
left g_w*(synth_midinote(note)-36)/(n*12) + 0.5;
        
gfx_rect(leftg_h pixelsg_w/(n*12), pixels);
    );
    
synth_continue(note);
);

ui_start("main");
ui_screen() === "main" ? (
    
ui_split_bottom(ui_width()*0.15);
    
piano_draw(0, (n*12-1));

        
draw_note(synth1)
        && 
draw_note(synth2)
        && 
draw_note(synth3)
        && 
draw_note(synth4)
        && 
draw_note(synth5)
        && 
draw_note(synth6)
        && 
draw_note(synth7)
        && 
draw_note(synth8)
        && 
draw_note(synth9)
        && 
draw_note(synth10)
        && 
draw_note(synth11)
        && 
draw_note(synth12)
        && 
draw_note(synth13)
        && 
draw_note(synth14)
        && 
draw_note(synth15)
        && 
draw_note(synth16);
    
ui_pop();

    
gfx_dest PIANO_ROLL_SCREEN;
    
gfx_getimgdim(PIANO_ROLL_SCREENg_wg_h);
    
g_w != ui_width() || g_h != ui_height() ? (
        
gfx_setimgdim(PIANO_ROLL_SCREENg_w ui_width(), g_h ui_height());
        
gfx_r gfx_g gfx_b 0;
        
gfx_a 1;
        
gfx_rect(00g_wg_h);
    );

    
g_t time_precise();
    
g_dt g_t g_t_old;
    
g_t_old g_t;
    
pixels ceil(g_dt/PIANO_ROLL_PERIOD*g_h/7);
    
gfx_blit(PIANO_ROLL_SCREEN100pixelsg_wg_h pixels00g_wg_h pixels);
    
gfx_r gfx_g gfx_b 0;
    
gfx_rect(0g_h pixelsg_wpixels);

    
draw_roll_note(synth1g_wg_hpixels)
    && 
draw_roll_note(synth2g_wg_hpixels)
    && 
draw_roll_note(synth3g_wg_hpixels)
    && 
draw_roll_note(synth4g_wg_hpixels)
    && 
draw_roll_note(synth5g_wg_hpixels)
    && 
draw_roll_note(synth6g_wg_hpixels)
    && 
draw_roll_note(synth7g_wg_hpixels)
    && 
draw_roll_note(synth8g_wg_hpixels)
    && 
draw_roll_note(synth9g_wg_hpixels)
    && 
draw_roll_note(synth10g_wg_hpixels)
    && 
draw_roll_note(synth11g_wg_hpixels)
    && 
draw_roll_note(synth12g_wg_hpixels)
    && 
draw_roll_note(synth13g_wg_hpixels)
    && 
draw_roll_note(synth14g_wg_hpixels)
    && 
draw_roll_note(synth15g_wg_hpixels)
    && 
draw_roll_note(synth16g_wg_hpixels);

    
gfx_dest = -1;
    
gfx_blit(PIANO_ROLL_SCREEN1000g_wg_hui_left(), ui_top());
    
control_finish_technical();
    
ui_color(2552552550.3);
    
ui_border();
); 


"Piano Display Medium"

PHP Code:
desc:Piano Display (by Geraint Luff)

in_pin:none
out_pin
:none

import ui
-lib.jsfx-inc
import piano
-ui.jsfx-inc
import synth
-framework-obj.jsfx-inc

@init

freemem 
0;
freemem ui_setup(freemem);
freemem synth_setup(freemem);
synth_setup_each(synth1);
synth_setup_each(synth2);
synth_setup_each(synth3);
synth_setup_each(synth4);
synth_setup_each(synth5);
synth_setup_each(synth6);
synth_setup_each(synth7);
synth_setup_each(synth8);
synth_setup_each(synth9);
synth_setup_each(synth10);
synth_setup_each(synth11);
synth_setup_each(synth12);
synth_setup_each(synth13);
synth_setup_each(synth14);
synth_setup_each(synth15);
synth_setup_each(synth16);

attack_samples 0.01*srate;
release_samples 0.01*srate;

@
block

synth_block
();
synth_block_each(synth1)
&& 
synth_block_each(synth2)
&& 
synth_block_each(synth3)
&& 
synth_block_each(synth4)
&& 
synth_block_each(synth5)
&& 
synth_block_each(synth6)
&& 
synth_block_each(synth7)
&& 
synth_block_each(synth8)
&& 
synth_block_each(synth9)
&& 
synth_block_each(synth10)
&& 
synth_block_each(synth11)
&& 
synth_block_each(synth12)
&& 
synth_block_each(synth13)
&& 
synth_block_each(synth14)
&& 
synth_block_each(synth15)
&& 
synth_block_each(synth16);

@
sample

function process_note(note*) (
    
synth_sample_each(note) ? (
        
synth_release(note) >= ? (
            
synth_stop(note);
        );
    );
    
synth_continue(note);
);

process_note(synth1)
&& 
process_note(synth2)
&& 
process_note(synth3)
&& 
process_note(synth4)
&& 
process_note(synth5)
&& 
process_note(synth6)
&& 
process_note(synth7)
&& 
process_note(synth8)
&& 
process_note(synth9)
&& 
process_note(synth10)
&& 
process_note(synth11)
&& 
process_note(synth12)
&& 
process_note(synth13)
&& 
process_note(synth14)
&& 
process_note(synth15)
&& 
process_note(synth16);

@
gfx 1168 170

6;
PIANO_ROLL_SCREEN 1;
PIANO_ROLL_PERIOD 1;
ui_reserve_image(PIANO_ROLL_SCREEN);

function 
set_colour(note*) (
  
ui_color(255*synth_velocity(note)/127255*(synth_velocity(note)/127), 255);
);

function 
draw_note(note*) (
    
synth_on(note) ? (
        
set_colour(note);
        
piano_fill_key(synth_midinote(note), 24, (n*12-1)+24);

    );
    
synth_continue(note);
);

function 
draw_roll_note(note*, g_wg_hpixelslocal(left) (
    
synth_on(note) ? (
        
set_colour(note);
        
left g_w*(synth_midinote(note)-24)/(n*12) + 0.5;
        
gfx_rect(leftg_h pixelsg_w/(n*12), pixels);
    );
    
synth_continue(note);
);

ui_start("main");
ui_screen() === "main" ? (
    
ui_split_bottom(ui_width()*0.15);
    
piano_draw(0, (n*12-1));

        
draw_note(synth1)
        && 
draw_note(synth2)
        && 
draw_note(synth3)
        && 
draw_note(synth4)
        && 
draw_note(synth5)
        && 
draw_note(synth6)
        && 
draw_note(synth7)
        && 
draw_note(synth8)
        && 
draw_note(synth9)
        && 
draw_note(synth10)
        && 
draw_note(synth11)
        && 
draw_note(synth12)
        && 
draw_note(synth13)
        && 
draw_note(synth14)
        && 
draw_note(synth15)
        && 
draw_note(synth16);
    
ui_pop();

    
gfx_dest PIANO_ROLL_SCREEN;
    
gfx_getimgdim(PIANO_ROLL_SCREENg_wg_h);
    
g_w != ui_width() || g_h != ui_height() ? (
        
gfx_setimgdim(PIANO_ROLL_SCREENg_w ui_width(), g_h ui_height());
        
gfx_r gfx_g gfx_b 0;
        
gfx_a 1;
        
gfx_rect(00g_wg_h);
    );

    
g_t time_precise();
    
g_dt g_t g_t_old;
    
g_t_old g_t;
    
pixels ceil(g_dt/PIANO_ROLL_PERIOD*g_h/7);
    
gfx_blit(PIANO_ROLL_SCREEN100pixelsg_wg_h pixels00g_wg_h pixels);
    
gfx_r gfx_g gfx_b 0;
    
gfx_rect(0g_h pixelsg_wpixels);

    
draw_roll_note(synth1g_wg_hpixels)
    && 
draw_roll_note(synth2g_wg_hpixels)
    && 
draw_roll_note(synth3g_wg_hpixels)
    && 
draw_roll_note(synth4g_wg_hpixels)
    && 
draw_roll_note(synth5g_wg_hpixels)
    && 
draw_roll_note(synth6g_wg_hpixels)
    && 
draw_roll_note(synth7g_wg_hpixels)
    && 
draw_roll_note(synth8g_wg_hpixels)
    && 
draw_roll_note(synth9g_wg_hpixels)
    && 
draw_roll_note(synth10g_wg_hpixels)
    && 
draw_roll_note(synth11g_wg_hpixels)
    && 
draw_roll_note(synth12g_wg_hpixels)
    && 
draw_roll_note(synth13g_wg_hpixels)
    && 
draw_roll_note(synth14g_wg_hpixels)
    && 
draw_roll_note(synth15g_wg_hpixels)
    && 
draw_roll_note(synth16g_wg_hpixels);

    
gfx_dest = -1;
    
gfx_blit(PIANO_ROLL_SCREEN1000g_wg_hui_left(), ui_top());
    
control_finish_technical();
    
ui_color(2552552550.3);
    
ui_border();
); 
pingosimon is offline   Reply With Quote
Reply

Thread Tools
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off

Forum Jump


All times are GMT -7. The time now is 01:04 PM.


Powered by vBulletin® Version 3.8.11
Copyright ©2000 - 2020, vBulletin Solutions Inc.