PlayNote macro for your needs

For Flowcode users to discuss projects, flowcharts, and any other issues related to Flowcode 6.

Moderator: Benj

Post Reply
User avatar
Benj
Matrix Staff
Posts: 15312
Joined: Mon Oct 16, 2006 10:48 am
Location: Matrix TS Ltd
Has thanked: 4803 times
Been thanked: 4314 times
Contact:

Re: PlayNote macro for your needs

Post by Benj »

Nice work, good to see some of my code being re-used :D

There is a simulation set of macros to allow you to stream out a sound so you could in theory add a simulation version of the macro and then wrap the two macros up together into a component to play a note in hardware or in the sim.

If you want details of how to pull this off then let me know.

EtsDriver
Posts: 444
Joined: Tue Apr 15, 2014 4:19 pm
Location: Kajaani, Finland
Has thanked: 345 times
Been thanked: 227 times
Contact:

Re: PlayNote macro for your needs

Post by EtsDriver »

This is porting made from V5 flowcodebuggy PlayNote macro, its easy to implement to new things. Got inspiration to port that macro to stand alone from here. All rights for creating it goes to MatrixMultimedia, and their copyrights apply to this macro.
Here you can look at the musical values that this macro uses.
When calling, you must give two parameters:
https://www.dropbox.com/s/jvyr2esk516wrzu/PlayNote1.PNG

For changing port, look for these two inside the macro.
https://www.dropbox.com/s/quzbf2n047n5dd5/PlayNote2.PNG

Here you can download the PlayNote.fcm for V6 Flowcode: https://www.dropbox.com/s/pavoe1u71oqtd0a/PlayNote.fcm

Works with AVR and PIC. Here is little test code for this (PIC16F88, piezo connected to PB0):
https://www.dropbox.com/s/k1p1qyoqwb3r2 ... testi.fcfx
If MatrixM feels that this is not okay to share with users, or if this breaks your copyrights somehow, then be welcome to delete this topic.

Hope this helps someone for making their projects sound nice! :)

EDIT: If someone thinks this is funny how posts are oriented, see here:
My topic was first approved, then it was disapproved...
My Email, from someone wrote:
Post disapproved - "PlayNote macro for your needs"

Hello EtsDriver,

You are receiving this notification because your post "PlayNote macro for
your needs" at "Matrix Multimedia user forums" was disapproved by a
moderator or administrator.

The following reason was given for the disapproval:

The reported message does not fit into any other category, please use the
further information field.

Duplicated post


--
Thanks,

Matrix Multimedia ltd.
Forums manager.
forums@matrixmultimedia.co.uk
http://www.matrixmultimedia.com
Here you can find notes for reference:
viewtopic.php?f=13&t=4015
Last edited by EtsDriver on Tue Apr 15, 2014 7:00 pm, edited 1 time in total.
Ill just keep the good work up!

medelec35
Matrix Staff
Posts: 9520
Joined: Sat May 05, 2007 2:27 pm
Location: Northamptonshire, UK
Has thanked: 2585 times
Been thanked: 3815 times
Contact:

Re: PlayNote macro for your needs

Post by medelec35 »

Hi EtsDriver,
Sorry my fault.
I saw you have posted the same post so I thought you have duplicated it.
I did not know you had deleted the original

I can move this thread to correct section
Martin

EtsDriver
Posts: 444
Joined: Tue Apr 15, 2014 4:19 pm
Location: Kajaani, Finland
Has thanked: 345 times
Been thanked: 227 times
Contact:

Re: PlayNote macro for your needs

Post by EtsDriver »

You can move it, this is still meant for FC6. I cannot use Private Messages because im so new here, so i cannot answer directly to your PM.
Ill just keep the good work up!

medelec35
Matrix Staff
Posts: 9520
Joined: Sat May 05, 2007 2:27 pm
Location: Northamptonshire, UK
Has thanked: 2585 times
Been thanked: 3815 times
Contact:

Re: PlayNote macro for your needs

Post by medelec35 »

Hi EtsDriver.
Thanks, great first post :)
I'm sorry about the confusion caused.
I believe I know what happened, and I have p'm Ben about it
I'm sure there will not be the same issue in the future.

Best regards

Martin
Martin

User avatar
Benj
Matrix Staff
Posts: 15312
Joined: Mon Oct 16, 2006 10:48 am
Location: Matrix TS Ltd
Has thanked: 4803 times
Been thanked: 4314 times
Contact:

Re: PlayNote macro for your needs

Post by Benj »

Hello,

Woops, :D not sure how to fix the layout so I think we might have to live with it :lol:

Here is a demo of playing sounds via the simulation if you wanted to investigate this area.
Attachments
sound_wave_05.fcfx
(45.26 KiB) Downloaded 301 times

EtsDriver
Posts: 444
Joined: Tue Apr 15, 2014 4:19 pm
Location: Kajaani, Finland
Has thanked: 345 times
Been thanked: 227 times
Contact:

Re: PlayNote macro for your needs

Post by EtsDriver »

Benj wrote:Hello,

Woops, :D not sure how to fix the layout so I think we might have to live with it :lol:

Here is a demo of playing sounds via the simulation if you wanted to investigate this area.
Tried to play with your code, but i couldnt hear any sounds :/ if i simulate it fast as possible, the flowcode just jams for couple of seconds and then it shows simulation completed in 1,xx seconds. My laptop is HP dv6 medialaptop, and it has 6GB ram, IDT-High Definition Audio CODEC sound system, AMD Phenom II P960 Quad-Core Processor 1,80GHz, so i dont think the problem is on my machine?

EDIT: Found fix, i needed to download some piano sample.waw file and put it onto same folder with flowchart with name /sounds/, then modify the piano_load sound to the file i had. Found fix for the unstability too. had to set process affinity to only use core 3, then the simulation runs fine. Dont know is this some kind software bug or bug with 4 core cpus. :/
Attachments
Sieppaa.PNG
Affinity for FC6.exe
(169.17 KiB) Downloaded 3016 times
Ill just keep the good work up!

Post Reply